Questions tagged [mediawiki-api]

The MediaWiki API is the interface for automated editing processes ("bots") and other programs to access data in a MediaWiki wiki.

Documentation for the API is available at mediawiki.org; a summary of all available parameters and short help is available by accessing the API endpoint on the wiki, e.g. here for the English .

Please make sure to check out the Etiquette page to get acquainted with the best practices and usage guidelines for using the API.

629 questions
6
votes
1 answer

Mediawiki API: How do I list all pages of a category and for each page show all of it's categories?

I am using the following wikimedia API to list all pages with a certain category: https://www.mediawiki.org/wiki/API:Categorymembers E.g. https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Physics This gives me a…
6
votes
3 answers

How to decode these characters? á é í

I'm querying the MediaWiki API to get Wikipedia data into my Filemaker database. When I load the data into a browser, the characters show up properly but when it comes into Filemaker, characters with diacriticals get converted to these odd…
sombreptile
  • 87
  • 2
  • 4
5
votes
1 answer

Wikipedia API: Cannot query Picture of the Day URL

I read the MediaWiki API documentation but I cannot find how to get the current URL of the picture of the day. Following RTFM, I call the query from Commons:Potd to its page URL. It returns pageid=2518149, it is the current POTD page. Then I try to…
Massimo
  • 3,171
  • 3
  • 28
  • 41
5
votes
1 answer

Case Insensitivity on Wikipedia API Calls

I am attempting to add case-insensitivity to my Wikipedia api calls. Wikipedia is case-sensitive in how it names pages. So, http://en.wikipedia.org/wiki/Cat will yield a page about the animal, http://en.wikipedia.org/wiki/CAT will yield a…
5
votes
1 answer

How to get the name of Wikipedia article in other language

I'm trying to extract English Wikipedia articles related to a list of Arabic articles, let's say I have this article https://ar.wikipedia.org/wiki/%D8%A7%D9%84%D9%82%D8%AF%D8%B3 and I need to extract the English version of it…
Afnan Ahmad
  • 163
  • 5
5
votes
1 answer

wikipedia api search titles generator

Trying to search tiles through the api using a generator. I notice that there are two possible generators, with both I have problems: prefix search - doesn't work well if I have multiple words and the order is reversed in the query (for example…
Ilan lewin
  • 1,599
  • 1
  • 14
  • 24
5
votes
1 answer

How to download a category of words from Wiktionary?

I want to download all countable nouns (Category:English countable nouns) from Wiktionary, I tried some corpus on Index of /enwiktionary/latest/, but it looks hard to extract the category I want. Can anybody tell me which one I should use and how to…
Tong Gao
  • 601
  • 6
  • 9
5
votes
0 answers

Get all category members and go over subcategories in MediaWiki API

I need the list of pages under particular category and it's subcategories. I know how to get query from Wikipedia. A simple query to get Pages of a category as mentioned here is to define the parameters of query as: action = query list =…
5
votes
3 answers

Using MediaWiki to pull text from a Wikia page but it comes back in a big mess is there a better way I could do this to pull text from each section?

I am developing an Android app that pulls information from a Wikia page and displays it in the app. I currently am pulling all Categories to navigate and have my app set up to display the page in a WebView but I would like to just pull the info and…
kikurself
  • 153
  • 1
  • 10
5
votes
5 answers

How can I get the principal image from MediaWiki API?

Hello I'm using Curl to get information from Wikipedia,and I want to receive only information about the principal image,I don't want to receive all images of an article.. For example.. If I want to get info about all images of the English Language…
Carlos
  • 177
  • 1
  • 3
  • 8
4
votes
1 answer

prop=extracts not returning all extracts in the WikiMedia API

I would like to use the wikipedia API to return the extract from multiple wikipedia articles at once. I am trying, for example, the following request (I just chose the pageids…
Ian Hincks
  • 3,608
  • 3
  • 23
  • 20
4
votes
2 answers

Wikipedia API: how to retrieve multiple titles AND resolve redirects in 1 call?

It appears from the MediaWiki API:Query page that you can only resolve a redirect one at a time. The document even says "The example below isn't really useful because it doesn't use any query modules, but shows how the redirects parameter…
BobR
  • 273
  • 3
  • 10
4
votes
3 answers

HttpClient and non-ASCII URL characters (á,é,í,ó,ú)

'Long time reader, first time poster' here. I'm in the process of making a bot for a spanish Wiki I administer. I wanted to make it from scratch, since one of the purposes of me making it is to practice Java. However, I ran into some trouble when…
ianmartorell
  • 345
  • 1
  • 3
  • 12
4
votes
2 answers

Get more general Category from the Category of a Wikipedia page

I'm using Python wikipedia library to obtain the list of the categories of a page. I saw it's a wrapper of MediaWiki API. Anyway I'm wondering how to generalize the categories to marco categories, like these Main topic classifications. For example…
4
votes
1 answer

How to get the Wikidata-related using page prop API of mediawiki

I saw a couple of solution to get the Wikidata Item from Wikipedia page. Generally, they use this pageprop query API: https://en.wikipedia.org/w/api.php?action=query&prop=pageprops&redirects=1&titles=LONDON But in my small version of media wiki,…
Loredra L
  • 1,485
  • 2
  • 16
  • 32