Find location by zip code [closed]
Asked Answered
A

4

6

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.

Allium answered 19/3, 2012 at 6:52 Comment(4)
see this question... https://mcmap.net/q/1777012/-how-to-use-google-mapsLacunar
send the pincode to google map geocoder web service it will give address and also give lat and long valueGum
Can you give me the link of the google api which takes in pincode as the request and gives me lat, lng as the response.Allium
You can use thezipcodes.com as well.Cortneycorty
P
5

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

Pleasance answered 19/3, 2012 at 8:17 Comment(3)
I 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.Allium
Indian pincodes link is incorrect. Can you please put in a detailed answer in addition to a valid link please.Contrive
@Contrive 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.Pleasance
B
2

GeoNames provides several geolocation related web services including lat/long information for zip codes.

Broomfield answered 19/3, 2012 at 14:2 Comment(1)
Thanks, 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.Allium
H
0

There are some public webservices on the internet - here's one that returns place names (and other information) for zip codes:

  • USZip (Select GetInfoByZIP)
Hau answered 19/3, 2012 at 7:0 Comment(0)
D
0

If you're in the UK then the only way to effectively do this using Google Maps API is to write it in javascript due to the limitation Google place on the number of API calls per day from a single IP address.

If yous solution is going to be under moderate usage load then you may want to look at a solution that utilises the UK Royal Mail PAF file. One such service that I've integrated with for my work is Postcode Anywhere (www.postcodeanywhere.com). They have a great API available in various formats... it was the easiest integration I've done lately.

Distinguishing answered 19/3, 2012 at 7:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.