How to convert post code to city name, is there an API available?
A ZIP code API, also known as a ZIP code lookup, makes it possible to programmatically look up information using a ZIP code as a unique identifier. In North America, all major shipping carriers including USPS, Canada Post, FedEx, DHL, and UPS maintain various APIs with corresponding documentation.
When looking at postal codes around the world, there are cases where two different cities are served by the same postal code. For example, the zip code 94608 in California is used for both Emeryville and parts of Oakland. One postal code, two cities.
Two years later, IMO the Google Maps Geocoding API is the best way to go.
Just pass in the postal code as the address parameter:
http://maps.googleapis.com/maps/api/geocode/json?address=94043&sensor=false
You need a service that does geocoding.
Yahoo's Geocoder API is getting much better results globally.
110021
is the postal code for New Delhi among several other places in the world.
This seems to get them all.
Google Maps API is another such service but I'm not happy with the geocoded results as I don't get all results back for 110021
.
geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'address': '110021'}, function(results, status) {
console.log(results);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With