Question

I want to parse the short_name of the google maps detail search for the country and want to know if this is the iso-code (iso 3166-1) or just an abbreviation from google? On the google pages i only find a description of the meaning of the field.

e. g.

, {
  "long_name": "United States",
  "short_name": "US",
  "types": [ "country", "political" ]
} 

In the google docs i only found this:

short_name is an abbreviated textual name for the address component, if available. For example, an address component for the state of Alaska may have a long_name of "Alaska" and a short_name of "AK" using the 2-letter postal abbreviation.

So the short name is also available for other parts for example states. But maybe someone used this also and can verify that the short_name of the country fits the ISO-Code standard. I just tested some countries and it fits so far.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top