0

Is it possible to get info on subarea by providing pincode using google APIs? For example when I give pincode as 600020 it gives chennai as result, however this city contains pincodes from 600001 - 600132(approx). What I would like get from google is subarea information, something like a list containing adyar, gandhinagar etc. I am trying to query like:

http://maps.google.com/maps/api/geocode/json?address=india&components=postal_code:600020&sensor=false

Check here for related question.

Community
  • 1
  • 1
bubble
  • 3,408
  • 5
  • 29
  • 51
  • 1
    You mean like [this](http://www.geocodezip.com/v3_GoogleEx_geocoding-reverse2postcodeC.html?address=600020)? – geocodezip Sep 11 '13 at 03:12
  • @geocodezip a little different, I think the link which you sent does not take pin code as an input, I would like to have pincode as input – bubble Sep 12 '13 at 15:27
  • It takes an address (or a set of coordinates to reverse geocode). If that happens to be a uniquely resolvable pincode, it works. For 6[00020, you need to specify the country](http://www.geocodezip.com/v3_GoogleEx_geocoding-reverse2postcodeC.html?address=600020%20india) – geocodezip Sep 12 '13 at 16:56
  • looks like its slightly inaccurate. It says a particular locality to be in neighbourhood but in actual its a sub-locality falling inside the first one – bubble Sep 13 '13 at 04:15
  • 1
    The API does what it does. You can submit issues with the data provided to google, it might get fixed eventually. – geocodezip Sep 13 '13 at 10:16
  • @geocodezip Exactly what I was looking for! Thanks! – eozzy Jun 18 '15 at 03:30

1 Answers1

2

I was not able to fetch the area names directly from the pincode. Instead I am doing this. I fetch the lat and lng of the pincode using Geocoding API. Using that lat and lng, I am hitting the same geocode but with the latlong this time and getting the list of area names. Here is the implementation.

https://maps.googleapis.com/maps/api/geocode/json?address=india&components=postal_code:600100&sensor=false&key={YOUR_KEY_HERE}

gave me the response of

           "lat" : 12.9171412,
           "lng" : 80.1940972

I hit the same geocode API now by passing the lat and lng in it.

https://maps.googleapis.com/maps/api/geocode/json?latlng=12.9171412,80.1940972&sensor=true&key={YOUR_KEY_HERE}

I got the response of all the area names associated with it from the key "formatted_address".

  1. No.20, Adhi sami Nagar Main Road, Pallikarani, Medavakkam, Chennai, Tamil Nadu 600100, India
  2. 502, Pallikaranai, Chennai, Tamil Nadu 600100, India
  3. 209, Velachery Main Rd, Medavakkam, Chennai, Tamil Nadu 600100, India
  4. 209-879, Velachery Main Rd, Medavakkam, Chennai, Tamil Nadu 600100, India
  5. Medavakkam, Chennai, Tamil Nadu, India
  6. Chennai, Tamil Nadu 600100, India
  7. Chennai, Tamil Nadu, India
  8. Kanchipuram, Tamil Nadu, India
  9. Tamil Nadu, India
  10. India
  11. W58V+VJ Chennai, Tamil Nadu, India

P.S Kind of works for me but still looking for a single API in google geocoding API's itself to solve the problem

Sandeep Kumar
  • 106
  • 1
  • 8