문제

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 |

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top