Is Wikidata a good API for getting location information?
Posted by SubzeroCola@reddit | learnprogramming | View on Reddit | 3 comments
In my app, I am trying to find out information about various cities by using their Wikidata codes. But I've noticed some strange things.
I'm requesting the data in JSON format, and the data extracted contains the various names of the city, and stuff like "citydistrict".
For example, if i try querying the Canadian city of "Toronto" (Code: Q919169), I am getting 2 strings:
But it nowhere says that its a city of Canada. I cannot find the Canada keyword anywhere.
Isn't that pretty important? For it to mention that Toronto exists within Canada?
Am I using this wrong?
Grithga@reddit
I can't speak for the API as a whole, but it looks like you're querying "Old Toronto", which is just a part of the actual city.
The city itself is found under Toronto (Q172) and contains several references to Canada.
SubzeroCola@reddit (OP)
Thanks! But shouldn't OldToronto also have some kind of a breadcrumb trail that leads to Toronto and then Ontario and Canada?
Grithga@reddit
I see references to the City of Toronto (Q172) in the Old Toronto response, so I assume the problem is the request you're making.