Hacker News new | ask | show | jobs
by 01acheru 1233 days ago
A geo places API with the actual international ids of those places. There are a lot of geo something APIs but I still cannot find one where I can:

- Ask for all admin1 regions of a country and have all their actual data (like: all states in the US, or all regions in Italy)

- Ask for all admin2 regions in a given admin1 region (all counties in the state of TX, all provinces in the region of Lombardy). As you can already see "US.TX" is an identifier but "IT.Lombardy" is not, it is language dependent and I'm sure there are international identifiers for those but they are lacking in almost all geo something APIs

- Ask for all admin3 in some admin2

- Ask for all admin-whatever on a given ZIP code

- Ask for all ZIP codes in a given admin-something

- Bonus point if it supports i18n and l10n

If anyone knows of one please tell me, I would pay for it right now.

2 comments

You can use Wikidata and its Sparql query language for this. Although it's not straight forward for all countries, e.g. some have especial properties for regional breakdowns that are not defined as ISO standard subregions.
Thanks for the suggestion, but I already tried it in the past and it is almost impossible to have correct results, it just takes a missing category on a country/state/province/city to make it all fall apart.

For example it is common to receive historical entities if they are mislabeled, entities that no longer exist because they were merged... it is good for a side project but not suitable for production.

What is the use case for you?
I'll try to say it in the least words I can so that it might be easier to explain:

Suppose I want to let my users input their customer's addresses. First of all I need some auto completion: the "state" select must suggest only states of the country selected previously and then so on with province, then city. The ZIP code must be one of the ZIP codes of the admin area selected.

Then they should be able to make this data accessible to other entities, for example a shipping company, so the identifiers of those address components must be "universal". But each of those address components also need localization and internationalization: if shared with an Italian I want the region to be called "Lombardia", if it is shared with an American it should be called "Lombardy", etc...

I hope it is clear enough :)