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?
Asked
Active
Viewed 184 times
1 Answers
4
Try the following query:
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.)

AXO
- 8,198
- 6
- 62
- 63
-
I would ideally want to use only one API and one API call to receive a complete set of return parameters for a single request. My request is actually for a coordinates and the ideal return values are the place and what city and country this place belongs to. With MediaWiki GeoData API it is sometimes probable to get the country affinity of the place (because the "country" is one of the defined properties), while the city can't be distinguished because it is not the property of a place. Looks like it is impossible to receive all above 3 results in one API call. – chainastole Aug 25 '18 at 10:40