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?
For example, the English Wikipedia is at https://en.wikipedia.org/w/api.php . For testing new accounts or test edits to pages, use the test wiki endpoint https://test.wikipedia.org/w/api.php . In the query string in the URL, add the action parameter. It tells the API which action to perform.
What is the Wikipedia API? The Wikipedia API (official documentation) is supported by the MediaWiki's API and provide access to Wikipedia and other MediaWiki data without interacting with the user interface.
Written collaboratively by largely anonymous volunteers, anyone with Internet access and in good standing can write and make changes to Wikipedia articles (except in limited cases where editing is restricted to prevent disruption or vandalism).
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|...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With