-2

for a pincode 121003 google geocode api is not giving results although the same pincode is being found out on google maps. What could be the possible issue here ??

https://maps.googleapis.com/maps/api/geocode/json?address=121003&key=API_KEY

  • Could you share your code? And do you have an API_KEY that should be passed in the request? – puchal Feb 08 '21 at 15:51
  • Yes I do have API_KEY and there is nothing like code in this, was just curious why google geocode api is not returning anything for this pincode. – Devanshoo Udhani Feb 08 '21 at 15:56
  • 1
    Duplicate of [Google Maps API Geocode Postal Code and set Country code?](https://stackoverflow.com/questions/11747901/google-maps-api-geocode-postal-code-and-set-country-code) – MrUpsidown Feb 08 '21 at 16:01

1 Answers1

-1

If I add zipcode: to that URL:

https://maps.googleapis.com/maps/api/geocode/json?address=zipcode:121003&key=API_KEY

It returns a result in India:

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "121003",
               "short_name" : "121003",
               "types" : [ "postal_code" ]
            },
            {
               "long_name" : "Tilpat",
               "short_name" : "Tilpat",
               "types" : [ "political", "sublocality", "sublocality_level_1" ]
            },
            {
               "long_name" : "Faridabad",
               "short_name" : "Faridabad",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Haryana",
               "short_name" : "HR",
               "types" : [ "administrative_area_level_1", "political" ]
            },
            {
               "long_name" : "India",
               "short_name" : "IN",
               "types" : [ "country", "political" ]
            }
         ],
geocodezip
  • 158,664
  • 13
  • 220
  • 245