How to get coordinates from a Wikipedia page through API?

馋奶兔 提交于 2019-12-12 09:43:28

问题


I want to get the coordinates of a Wikipedia page through their API. I want to put the page title as 'titles' parameter. I have searched SO for a solution but seems they are scrapping the page then extracting. Is it possible through their API?


回答1:


You need to use Wikipedia API. For your example with Kinkaku-ji the query will be:

https://en.wikipedia.org/w/api.php?action=query&prop=coordinates&titles=Kinkaku-ji

For more than one title use pipe to separate them: titles=Kinkaku-ji|Paris|...



来源:https://stackoverflow.com/questions/40098656/how-to-get-coordinates-from-a-wikipedia-page-through-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!