I am having an issue with google geo-loaction services. essentially we are using it for a zip code validator and there is an issue with zip code '12593'. This zip code is showing as being in Spain. (see screenshot here = http://prntscr.com/hkkafh.
See xml here https://maps.googleapis.com/maps/api/geocode/xml?&address=12593)
This zip code though is a USA based zip code as can be seen here = https://www.google.com/search?num=100&q=us+zip+code+12593&oq=us+zip+code+12593 (google search results.)
I understand that google is not the othority on zip codes however I would expect google to understand that this zip code may have two seperate locations.
any idea How I can get the api to understand I am looking for zip codes specifically in the USA?
The zip code you're trying to find isn't reachable by the geocoding api. This near one is reachable:
https://maps.googleapis.com/maps/api/geocode/json?&components=country:US|postal_code:12516
To search by zip code and restrict by country (i.e. US), you must use the subparameters of the components query parameter like in the URL above
components
...&components=country:US|postal_code:[YOUR PARAMETER]
(got this parameter info on https://developers.google.com/maps/documentation/geocoding/intro#ComponentFiltering)
1.4m articles
1.4m replys
5 comments
57.0k users