Nasir Ahmed
Nasir Ahmed

Reputation: 521

How to get coordinates from a Wikipedia page through API?

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?

Kinkaku-ji

Upvotes: 8

Views: 1878

Answers (1)

Termininja
Termininja

Reputation: 7036

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|...

Upvotes: 14

Related Questions