Question

I am trying to search for only people from Wikipedia and return them in some format (ideally using regex, but a simpler search is okay).

The following query is close, but doesn't allow me to include a specific search query and it appears to only included dead people (well I believe historic figures).

http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=wikipedia&srprop=timestamp&eititle=Template:Persondata

The following query works although I can't seem to limit the results to people only.

http://en.wikipedia.org/w/api.php?action=query&list=embeddedin&eititle=Template:Persondata&eilimit=100&format=xml&redirects

API sandbox |

Was it helpful?

Solution

You want to use Wikidata APIs for semantic searches. Example search for P31 → 5 ("is a human"), using the Wikidata Query Service: http://tools.wmflabs.org/wikidata-todo/autolist.html?q=CLAIM%5B31%3A5%5D

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top