Search code examples
google-mapsgeocodepostal-code

i want specific area name provided pincode of that area


I need name of an area and city I pass the postal code as a parameter.

For example I tried

http://maps.google.com/maps/api/geocode/json?address=382340&components=country:in&sensor=false

for a postal code in India.

Although this is giving multiple results with irrelevant data. I could get coordinates using the geocode API. I do not need coordinates though, just the area name corresponding to the postal code. How can I achieve this?


Solution

  • Try this

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

    This returns the correct results, which could be further trimmed to get the relevant data.