Manish Kumar
Manish Kumar

Reputation: 131

Geocoding Service is not returning any result for the US Zip Code 90210

The Geocoding Service is not returning any result for the US Zip Code 90210, which is the zip code for “BEVERLY HILLS CA”.

But the Geocoding is working for other US zip codes. Kindly help me here. Please let me know if you have any questions.

https://maps.google.com/maps/api/geocode/json?key=***********************************&address=90210

Upvotes: 5

Views: 1587

Answers (2)

GrowthCode
GrowthCode

Reputation: 55

Adding the |country:US didn't give the correct Geocode location. It sends you to a Lat Lng in rural Kansas. Adding the state in addition to the country did fix the issue for me:

Geocoder.search("#{zip_code}|country:US|state:#{state}")

Upvotes: 0

bryanbloomquist
bryanbloomquist

Reputation: 61

I'm glad you posted this question, I was having the same issue. I used rafon's answer and added |country:US at the end of the url and it worked perfectly.

https://maps.google.com/maps/api/geocode/json?key={KEY}&components=postal_code:90210|country:US

Upvotes: 6

Related Questions