Questions tagged [wikipedia-api]

Related to the use of the MediaWiki API on Wikipedia. Consider also the tags [wikipedia] if your question isn't about the API or [mediawiki-api] if your question isn't about Wikipedia.

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.

In addition, there is a REST API that allows fetching commonly used data in a simple format. A list of all endpoints can be found in the REST API Documentation.

Please make sure to read the etiquette for best practices for using the API and general usage guidelines.

1085 questions
25
votes
3 answers

How to get Wikidata ID for an Wikipedia article by API?

How to obtain Wikidata ID from English Wikipedia article name, also for redirects? Is there API call? Example: Karachi >> Q8660 Karaachi >> Q8660 How to approach changes in assignment? Now Media in Karachi is redirect to Media of Pakistan (Wikidata…
Shoussi Elbril
  • 261
  • 3
  • 5
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
21
votes
4 answers

How to get Wikipedia page from Wikidata Id?

How to get Wikipedia page (in a particular language, say French) from the Wikidata Id (ex: Q19675)? The question seems obvious but strangely, I find nothing on the web. I'm looking for a url command that I could use with requests Python module,…
Patrick
  • 2,577
  • 6
  • 30
  • 53
20
votes
6 answers

How to use Wikipedia API to get the page view statistics of a particular page in wikipedia?

The stats.grok.se tool provides the pageview statistics of a particular page in wikipedia. Is there a method to use the wikipedia api to get the same information? What does the page views counter property actually mean?
lipid
  • 231
  • 1
  • 2
  • 6
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
19
votes
2 answers

Wikipedia Category Hierarchy from dumps

Using Wikipedia's dumps I want to build a hierarchy for its categories. I have downloaded the main dump (enwiki-latest-pages-articles) and the category SQL dump (enwiki-latest-category). But I can't find the hierarchy information. For example, the…
fersarr
  • 3,399
  • 3
  • 28
  • 35
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
3 answers

How do I get all articles about people from Wikipedia?

What would be the easiest way to get all articles about people from Wikipedia? I know I can download a dump of all the pages, but then how do I filter those and get only the ones about people? I need as many as I can get (preferably more than a…
Johnny
  • 7,073
  • 9
  • 46
  • 72
18
votes
2 answers

Wikipedia API - get random page(s)

I'm trying to get a JSON result with a set of random pages from Wikipedia, including their titles, content and images. I've played around with their API sandbox, and so far the best I've got is…
Petter
  • 773
  • 2
  • 9
  • 19
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
17
votes
3 answers

Wikipedia API for python

I am trying to see the table of contents in a wikipedia page using Wikipedia API for python. Here is my code. >>> import wikipedia >>> ny = wikipedia.page("New York") >>> ny.sections But I am getting an empty list [] as the result. When I go to the…
mahacoder
  • 895
  • 3
  • 14
  • 29
17
votes
3 answers

get Thumbnail image from wikimedia commons

I do have a filename from wikimedia commons and I want to access the thumbnail-image directly. Example: Tour_Eiffel_Wikimedia_Commons.jpg I found a way to get json-data containing the url to the thumbnail I…
user2033412
  • 1,950
  • 2
  • 27
  • 47
17
votes
1 answer

Freebase / DBpedia / wikidata.org -- differences

I'm looking to enhance several "objects" in my application with human-readable data. To that end, I've seen Freebase, DBpedia and wikidata.org, and am currently working with Freebase. I can't help but wonder, though, what I am missing. So: what's…
Nitzan Shaked
  • 13,460
  • 5
  • 45
  • 54
15
votes
5 answers
15
votes
3 answers

Limits of the Wikipedia API

I read that wikipedia's API is called MediaWiki. My question is regarding this API. Does this API have a maximum of calls per day/ hours / minutes ? I can't seem to find it.
Olivier_s_j
  • 5,490
  • 24
  • 80
  • 126
1
2
3
72 73