How to convert postal code to city name, is there an API available?

















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);
});









answered May 17 ’10 at 3:35






AnuragAnurag


128k3333 gold badges207207 silver badges253253 bronze badges


























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








answered Aug 3 ’12 at 17:01






lreicholdlreichold


61588 silver badges2424 bronze badges

























http://zipasaur.us/ is incredible and free. I just discovered it after quite some searching.

It can do reverse lookups like you ask and more. It’s free and has a JSON API. Awesome!

[edit] It’s down now and has been for quite some time. It was nice while it lasted though 🙁









answered Jul 3 ’13 at 11:19





























The US Post Office sells a subscription to map 5 digit zip codes to City/State values. As @Timothy says, the mapping is one to many. However, the post office db does mark which city/state is the “primary” for a given zip code.

Don’t know about other countries. Check with your country’s postal authority.

See http://www.usps.com/ncsc/addressinfo/citystate.htm








answered May 17 ’10 at 3:38






Larry KLarry K


39.8k1111 gold badges7878 silver badges112112 bronze badges
























RedLine offers a free zipcode API service (up to 250 requests per hour). There are 4 different varieties covering distances between two zipcodes, zipcodes within a radius of a zipcode, City, state and Lat/long of a zipcode and the zipcode of a city. http://zipcodedistanceapi.redline13.com/








answered Jul 11 ’13 at 14:33






Bob BickelBob Bickel


34922 silver badges33 bronze badges
























Just to put in my .02, using the Google Maps API mentioned above, you can look up global information. I am currently working on a project and am pretty much implementing it as my solution for this issue. Ok, off my tiny soap box.








answered Dec 29 ’13 at 7:21






numberwhunnumberwhun


94999 silver badges55 bronze badges



















Not the answer you’re looking for? Browse other questions tagged api postal-code or ask your own question.



Source

Leave a comment

Your email address will not be published. Required fields are marked *