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
127
votes
5 answers

Is there a Wikipedia API?

On my Wikipedia user page, I run a Wikipedia script that displays my statistics (number of pages edited, number of new pages, monthly activity, etc.). I'd like to put this information on my blog. Is there an API that would allow me to do something…
rbrayb
  • 46,440
  • 34
  • 114
  • 174
123
votes
9 answers

How can I retrieve Wiktionary word content?

How may Wiktionary's API be used to determine whether or not a word exists?
Armentage
  • 12,065
  • 8
  • 33
  • 33
71
votes
9 answers

Get Text Content from mediawiki page via API

I'm quite new to MediaWiki, and now I have a bit of a problem. I have the title of some Wiki page, and I want to get just the text of a said page using api.php, but all that I have found in the API is a way to obtain the Wiki content of the page…
Le_Coeur
  • 1,521
  • 5
  • 28
  • 44
64
votes
8 answers

How to use wikipedia api if it exists?

I'm trying to find out if there's a Wikipedia API (I think it is related to the MediaWIki?). If so, I would like to know how I would tell Wikipedia to give me an article about the new york yankees for example. What would the REST URL be for this…
chris
  • 20,791
  • 29
  • 77
  • 90
39
votes
12 answers

How to get plain text out of Wikipedia

I'd like to write a script that gets the Wikipedia description section only. That is, when I say /wiki bla bla bla it will go to the Wikipedia page for bla bla bla, get the following, and return it to the chatroom: "Bla Bla Bla" is the name of a…
Wifi
  • 391
  • 1
  • 3
  • 4
38
votes
4 answers

Searching Wikipedia using the API

I want to search Wikipedia using the query action. I am using this URL: http://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch=apple That works, but I want to get into the first result of the search. How can I do that? Note:…
Muhammad Ashraf
  • 1,252
  • 1
  • 14
  • 32
38
votes
3 answers

How to obtain a list of titles of all Wikipedia articles

I'd like to obtain a list of all the titles of all Wikipedia articles. I know there are two possible ways to get content from a Wikimedia powered wiki. One would be the API and the other one would be a database dump. I'd prefer not to download the…
Flavio
  • 1,507
  • 5
  • 17
  • 30
35
votes
4 answers

How can I get the Infobox from a Wikipedia article by the MediaWiki API?

Wikipedia articles may have Infobox templates. By the following call I can get the first section of an article which includes an Infobox. http://en.wikipedia.org/w/api.php?action=parse&pageid=568801§ion=0&prop=wikitext I want a query which will…
Erdem
  • 964
  • 1
  • 8
  • 17
28
votes
5 answers

Is there any API in Java to access wikipedia data

I want to know: is there any API or a query interface through which I can access Wikipedia data?
neha
21
votes
6 answers

How to group wikipedia categories in python?

For each concept of my dataset I have stored the corresponding wikipedia categories. For example, consider the following 5 concepts and their corresponding wikipedia categories. hypertriglyceridemia: ['Category:Lipid metabolism disorders',…
EmJ
  • 4,398
  • 9
  • 44
  • 105
19
votes
9 answers

Parsing a Wikipedia dump

For example using this Wikipedia dump: http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=lebron%20james&rvprop=content&redirects=true&format=xmlfm Is there an existing library for Python that I can use to create an array with the…
tomwu
  • 397
  • 1
  • 3
  • 11
18
votes
6 answers

Retrieving image license and author information in wiki commons

I am trying to use the wikimedia API for wiki commons at: http://commons.wikimedia.org/w/api.php It seems like the commons API is very immature and the part at their document that mentions the possibility to retrieve license and author information…
Meir
  • 205
  • 3
  • 8
18
votes
5 answers

How to download images programmatically from Wikimedia Commons without registering for a Bot account?

It seems like the only way to get approval for a Bot account is if it adds to or edits information already on Wikimedia. If you try to download any images, without a bot account, using some of the api libraries out there you get error messages…
tomvon
  • 5,121
  • 3
  • 22
  • 16
15
votes
5 answers
14
votes
3 answers

How to get image URL property from Wikidata item by API?

I've made an android app that uses the JSON Google image search API to provide images but I have noticed that Google have stopped supporting it. I have also discovered that Wikidata sometimes provides a image property on some items, however I can't…
1
2 3
41 42