How to get location of the Wikipedia article with Mediawiki API in terms of city/country? Let's say I want to determine what country, what city the Sagrada Familia cathedral is located in? What property should I use?
相关问题
- Using AJAX to get a specific DOM Element (using Ja
- Getting search results from wikidata website, but
- How to decode these characters? á é í
- Scrape Data from Wikipedia
- Get URL for mediawiki page given the Title - progr
相关文章
- Passing an equal sign ('=') to a parameter
- Json deserialize from wikipedia api with c#
- Get location with Wikimedia API
- Creating custom edit buttons for MediaWiki
- Working example of wikitext-to-HTML in ANTLR 3
- Python regex for finding contents of MediaWiki mar
- How to get all URLs in a Wikipedia page
- What's wrong with this authorization exchange?
Try the following query:
https://en.wikipedia.org/w/api.php?action=query&prop=coordinates&titles=Sagrada%20Fam%C3%ADlia&coprop=country|type|name|dim|region
And see Extension:GeoData for documentation.
I'm not sure if we can get the city name using Wikipedia API, but there are some ways to convert a coordinate to a city name, see: Given the lat/long coordinates, how can we find out the city/country? or use a SPARQL query on wikidata. (the query is a copy of the one in this answer, with radius and coordinates changed.)