Search code examples
wikipediawikipedia-apimediawiki-api

Using MediaWiki api to search for events on a specific date


I'm trying to use mediawiki api to get all people whose born or death on specific date.

I wonder how I can make a query like this and what are the title and the prop for this kind of query?

I'm tried to use multiple titles but that doesn't work. It takes each title and makes it as simple query but doesn't use all titles in same query.

http://en.wikipedia.org/w/api.php?action=query&titles=born|in|1991&prop=info&format=jsonfm

Solution

  • That is not possible to do (yet) through the mediawiki API. But there is a service that makes this doable without downloading a dump from Wikidata: Wikidata query. This will give you the Wikidata entities (here is everyone born in 1991).

    To get more information about the entities you use the mediawiki API on Wikidata, see example in this answer: https://stackoverflow.com/a/24840939/3814290