Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top