Wikipedia API: How to get the City of a Place / Page / Article -
i want city of eiffel tower page using wikipedia api.
i used below code abstract intro, wikipageid, wikiurl, thumbnail/image, wikidataid & coordinates of wiki title eiffel_tower.
https://en.wikipedia.org/w/api.php?action=query&titles=eiffel_tower&prop=extracts|info|pageimages|coordinates|pageprops&exintro&explaintext&redirects&inprop=url
how parent of places?
suppose want city / district / state / country of wikipedia places page.
for eiffel tower page wikipedia show location detail in paris [city] , france [country].
first find wikidata id of article (manually following "wikidata item" link in sidebar, programmatically e.g. using action=query&prop=pageprops
api module), use wikidata query service , e.g.
Comments
Post a Comment