57

Are there any web services (paid or free) out there besides the Google Maps API which allow you to reverse geocode?

My particular application will have access to a latitude and longitude and I need to be able to get the US Zip Code or State.

The reason I can't use Google is that the Terms of Service seems to indicate that if you use Google Maps API, you need to use the data to display a Google map.

I am using C# .Net framework in case that's relevant.

jessegavin
  • 74,067
  • 28
  • 136
  • 164

7 Answers7

43

I use http://nominatim.openstreetmap.org for reverse lookups, it's very easy to use:

http://nominatim.openstreetmap.org/reverse?format=json&lat=54.9824031826&lon=9.2833114795&zoom=18&addressdetails=1

WoodyDRN
  • 1,221
  • 20
  • 26
  • If you're hitting their rate limits use a commercial nominatim service such as [locationiq.org](https://locationiq.org). – kouton Feb 18 '20 at 07:03
11

Geonames can give you either a placename:

http://ws.geonames.org/findNearbyPlaceName?lat=40.65&lng=-73.78

or a zip code:

http://ws.geonames.org/findNearbyPostalCodes?lat=40.65&lng=-73.78

It's free as long as you credit them and you need fewer than 15000 lookups per day. You can pay if you need more.

stevemegson
  • 11,843
  • 2
  • 38
  • 43
9

I am not a fan of MS. But check this out: http://msdn.microsoft.com/en-us/library/ff859477.aspx

RESTful Location Service API does not seem to post any restriction.

You can user Find Location By Point API: http://msdn.microsoft.com/en-us/library/ff701710.aspx

I tried out the sample for geoNames, the result is not good enough for me as I need county information, and the response time is slow.

xueru
  • 767
  • 2
  • 11
  • 21
  • +1 Wow. Thank you. I am definitely going to look into this. – jessegavin Sep 13 '10 at 15:17
  • 2
    Looking into it a bit more. If the data is used for a commercial application which requires a username / password, then you have to pay for it. http://www.microsoft.com/maps/product/licensing_for_enterprise.aspx – jessegavin Sep 13 '10 at 15:28
  • Interesting! I wonder what they meant by stating 'Not Billable' in http://msdn.microsoft.com/en-us/library/ff859477.aspx for REST Location APIs. – xueru Sep 13 '10 at 17:42
  • in the link I provided above stated what Billable means: Billable versus non-billable transactions A billable transaction is a transaction that would be charged under a commercial (enterprise) license agreement. Non-billable transactions are not charged under a commercial license agreement. However, non-billable transactions are still recorded to provide you with information about how your application is used. – xueru Sep 27 '10 at 19:44
  • check this one out: http://developers.cloudmade.com/projects/show/geocoding-http-api , http://cloudmade.com/select/mobile – xueru Sep 27 '10 at 20:23
8

openstreetmap:

$.getJSON('https://nominatim.openstreetmap.org/reverse', {
    lat: position.coords.latitude,
    lon: position.coords.longitude,
    format: 'json',
}, function (result) {
    console.log(result);
}); 

geonames:

$.getJSON('https://secure.geonames.org/countryCode', {
    lat: position.coords.latitude,
    lng: position.coords.longitude,
    type: 'JSON',
    username: 'demo'
}, function (result) {
    console.log(result);
});
rahulroy9202
  • 2,730
  • 3
  • 32
  • 45
6

ArcGIS provides a free (and paid) API:

https://developers.arcgis.com/rest/geocode/api-reference/geocoding-reverse-geocode.htm

It provides an address for a given location (lat/lon). It doesn't even require an API key, but they suggest you get a free one to avoid rate limits.

Here is an example API call, with a JSON response:

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=4.366281%2C50.851994&langCode=fr&outSR=&forStorage=false&f=pjson

moollaza
  • 480
  • 7
  • 8
4

Nominatim Search Service from MapQuest Open API is free and has no request limit (soft limit of 1/sec).

http://open.mapquestapi.com/nominatim/v1/reverse.php?format=json&lat=44.0776182&lon=-92.5296981

TOS can be found here

rynop
  • 50,086
  • 26
  • 101
  • 112
  • They'ved added a 15k per month limit now. – kouton Oct 04 '15 at 06:35
  • @kouton I think if you want to rely such an API, then better to support a few alternatives instead of just a single one, so if one service goes down that won't affect your service. If this gives better results than the others, then it is fine for me to count the usage and use something else in the rest of the month after I reached the limit. I am just not sure if there is a real difference in the quality of these services. Is there a way to compare them? – inf3rno Feb 17 '20 at 06:14
  • No easy way I'm afraid. We've since switched to using [locationiq.org](https://locationiq.org) – kouton Feb 18 '20 at 07:05
1

Take a look at Geocoda - free for up to 1K forward or reverse geocoding calls per month, reasonably priced for more.

Update Feb. 2019 - Geocoda is now closed.

brokenbeatnik
  • 720
  • 6
  • 15