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
10
votes
6 answers

Parse birth and death dates from Wikipedia?

I'm trying to write a python program that can search wikipedia for the birth and death dates for people. For example, Albert Einstein was born: 14 March 1879; died: 18 April 1955. I started with Fetch a Wikipedia article with Python import…
JBWhitmore
  • 11,576
  • 10
  • 38
  • 52
9
votes
9 answers

How do I grab just the parsed Infobox of a wikipedia article?

I'm still stuck on my problem of trying to parse articles from wikipedia. Actually I wish to parse the infobox section of articles from wikipedia i.e. my application has references to countries and on each country page I would like to be able to…
Ali
  • 7,353
  • 20
  • 103
  • 161
9
votes
1 answer

How to query Wiktionary API and get part of speech

I'd like to get the part of speech and maybe the definition for English words. I found a link like this: http://en.wikipedia.org/w/api.php?action=query&list=search&srwhat=text&srsearch=don%27t but it doesn't seem to get me the results I see on…
Andrew
  • 6,254
  • 16
  • 59
  • 93
9
votes
2 answers

API to retrieve info about famous people

I'm looking for some callable way to get information about famous people and celebrities. Given a string, I'd like to determine if it's the name of a famous person, and if so, if they're alive and perhaps what category they fall into (e.g. Actor,…
Sander Smith
  • 1,371
  • 4
  • 20
  • 30
9
votes
1 answer

How to get a short snippet of text and the main image of Wikipedia articles by API?

I'm trying to create a simple clone of Wikipedia that allows the user to search for a subject, and then display 10 results that contain the article's image and a short snippet of text. I've been able to pass the user supplied search field to my…
user5862470
9
votes
1 answer

How do I get a list of MediaWiki namespaces?

How do I get a list of MediaWiki namespaces? Ideally with name and number.
the
  • 21,007
  • 11
  • 68
  • 101
9
votes
1 answer

Wikipedia search API get redirect pageID

I get many Wikipedia pageIDs in DB, and some of them are already redirected to somewhere else. So I want to know how to get these new pageIDs. I check the Wikipedia web: http://en.wikipedia.org/wiki/?curid=11601783 It says (Redirected from....)…
Benny Ae
  • 1,897
  • 7
  • 25
  • 37
9
votes
2 answers

Random article API call is returning User talk pages?

I'm trying to pull a random article from the WikiMedia API, but my code seems to only grab User talk pages... $(document).ready(function(){ …
theintellects
  • 1,320
  • 2
  • 16
  • 28
8
votes
4 answers

Wikipedia API: how to get the number of revisions of a page?

Anyone know how to get the number of revisions of a wikipedia page using mediawiki API? I have read this API documentation, but can't find the related API: Revision API
masu.mo
  • 783
  • 1
  • 12
  • 22
8
votes
4 answers

How to retrieve parts of Wikipedia content into Android App?

Basically, I want to retrieve content from wikipedia. But I want to display it inside my Android Apps directly. Not immidiately redirect to the internet browser, but to display it inside my apps first. Currently, I manage to request the Wikipedia…
Yeo
  • 11,416
  • 6
  • 63
  • 90
8
votes
1 answer

Retrieve another language of a Wikipedia page

Task: We have Wikipedia English page and need to retrieve the same page address in Russian. I know the Semantic Web solution - use simple query to DbPedia, but I am curious whether there are traditional solutions. I have asked the same question in…
SiberianGuy
  • 24,674
  • 56
  • 152
  • 266
8
votes
1 answer

Does Wikipedia API support CORS or only JSONP available?

This question related to another question, which was asked year ago. Author asked how to make cros-origin request using JavaScript and Wikipedia API and one comment was: en.wikipedia.org doesn't seem to allow CORS and he was advised to use JSONP…
Alexan
  • 8,165
  • 14
  • 74
  • 101
8
votes
3 answers

Retrieve a list of all Wikipedia languages programmatically

I need to retrieve a list of all existing languages for a certain wiki project. For example, all Wikivoyage or all Wikipedia languages, just like on their landing pages. I prefer to do this via MediaWiki API, if it's possible. Thanks for your time.
Damjan Pavlica
  • 31,277
  • 10
  • 71
  • 76
8
votes
6 answers

How do I get the HTML of a wiki page with Pywikibot?

I'm using pywikibot-core, and I used before another python Mediawiki API wrapper as Wikipedia.py (which has a .HTML method). I switched to pywikibot-core 'cause I think it has many more features, but I can't find a similar method. (beware: I'm not…
Aubrey
  • 507
  • 4
  • 20
8
votes
3 answers

retrieve data from Wikipedia and show it using angularjs

I am new to angularjs. I am trying to get data from wikipedia and show it in the front end. I retrived the data from wiki using the following php code $url =…
MdN
  • 89
  • 1
  • 10