0

I saw zipcode 22222 is for Arlington, VA in United States but when search this from Google Map api it doesn't show me country name United States

http://maps.googleapis.com/maps/api/geocode/json?address=22222

Please let me know what I am doing wrong in here?

I tried with http://maps.google.com/maps/api/geocode/json?components=country:US|postal_code:22222&sensor=false which gives no result that means United States doesn't have zipcode=22222 but on internet 22222 belongs to VA, US

duncan
  • 31,401
  • 13
  • 78
  • 99
mohit
  • 1,878
  • 1
  • 16
  • 27
  • 1
    How can it know what country you want to lookup with that zip code? I think you need this format http://maps.google.com/maps/api/geocode/json?components=country:AU|postal_code:2340&sensor=false – Thaina Yu Jan 19 '16 at 07:54
  • Thanks but still not working http://maps.google.com/maps/api/geocode/json?components=country:US|postal_code:22222&sensor=false – mohit Jan 19 '16 at 07:59

1 Answers1

0

Use zip_code not postal_code I think this returns the correct.

http://maps.google.com/maps/api/geocode/json?components=country:US|zip_code:22222

code_bash
  • 701
  • 1
  • 5
  • 16
  • Thanks but I don't think zip_code is a valid parameter. Response will be same when you remove zip_code or write anything in place of zip_code. Secondly, with zip_code it should have given me the State name? – mohit Jan 19 '16 at 12:55
  • Well then I would just use (http://maps.google.com/maps/api/geocode/json?components=country:US%7Cpostal_code:22206) and submit a bug report to google maps. Also this (https://goo.gl/dFJ8i2) – code_bash Jan 19 '16 at 13:33