Find location by zip code
Solution 1
Google's webservice and the Javascript geocoder both geocode zipcodes on their own without an explicit placename. There is a rate limit and a daily limit with both. Google's Terms of Service don't permit permanent storage of geocoded data — which you don't intend to do — but they do mandate displaying the geocoded point(s) on a Google map (which you may not be intending to do).
Five-digit zipcodes default to the USPS codes, I believe. For other countries' five-digit codes you need to specify the country.
Edit:
Documentation for Javascript API: https://developers.google.com/maps/documentation/javascript/geocoding
Example for Javascript API: https://google-developers.appspot.com/maps/documentation/javascript/examples/geocoding-simple (try entering 90210)
Documentation for webservice: https://developers.google.com/maps/documentation/geocoding/
Example request: http://maps.googleapis.com/maps/api/geocode/xml?address=90210&sensor=false
You may find that certain countries' postal codes don't work. But to make the blanket statement they are not providing location search based on zipcode is not correct. If you are having difficulty with a particular country's postal codes — like India's PIN code perhaps — it's best to be specific.
Edit #2:
If you are interested in Indian pincodes then a top-ranking Google result was this thread: https://groups.google.com/group/datameet/browse_thread/thread/db5b8a3f4033ae36
Solution 2
GeoNames provides several geolocation related web services including lat/long information for zip codes.
AurA
A full stack web developer. Have knowledge of the following technologies Server side technologies Java (Spring, Hibernate, JSF) NodeJS Client side Javascript/JQuery/HTML5/CSS3 AngularJS BackboneJS SOreadytohelp
Updated on June 05, 2022Comments
-
AurA almost 2 years
I am looking for a google API or any other API that returns me location ( in the form of latitude/longitude or place name )
Using Geocoder I can find lat,long as long as I know the name of place.
It can we a web service or some query to some online database. I don't want to populate the US Zip codes to a local database.
-
AurA about 12 yearsI have already checked Google API, they are not providing location search based on zipcode.. in case I have missed that please provide me the url.
-
AurA about 12 yearsThanks, this is somewhat what I was looking for, one more question is do Google has an API similar to GeoNames. I mean a webservice that does similar thing like GeoNames.
-
Siddharth almost 11 yearsIndian pincodes link is incorrect. Can you please put in a detailed answer in addition to a valid link please.
-
Andrew Leach almost 11 years@Siddharth There's nothing more to add to the documentation, and the last link does work. Using Google's example at google-developers.appspot.com/maps/documentation/javascript/…,
506102, India
is located in Mumbai. So at least some pincodes do work with Google's geocoer.