4

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?

adarsh
  • 6,738
  • 4
  • 30
  • 52
  • What exact area name would you like as an answer to your sample query? – Joachim Isaksson Dec 26 '12 at 09:01
  • there is a unique region name associated with each postal code...i mean one-to-one mapping is there between name and postal code e.g 382340 is postal code for "kubernagar" area... so i want name "kubernagar" if i supply 382340 – nirmesh khandelwal Dec 26 '12 at 11:04

1 Answers1

7

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.

adarsh
  • 6,738
  • 4
  • 30
  • 52