Reverse geocoding

Coordinates in, the nearest address out, or the locality, region or country if that is all you want.

GEThttps://api.mygeocode.com/v1/reverse

Parameters

ParameterTypeDescription
latrequirednumber-90 to 90.
lonrequirednumber-180 to 180.
leveloptionalstringThe most specific level to return: address (default), street, postcode, city, region, country. Coarser levels are faster and never fall below the requested level.
radiusoptionalintegerSearch radius in metres for addresses and streets, 1 to 5000. Default 5000. Set it small to get null instead of a far-away address.
langoptionalstringISO 639-1 code for the language of the response. Default en. The whole address comes back in that language: places, regions and countries by their own names in it, the street with its type and direction translated and its name written in the language's script by how it sounds.
boundariesoptionalintegerSet to 1 to add a boundaries object with every Australian boundary the point falls in: suburb, local government area, ward, federal and state electoral division, statistical areas, Indigenous areas, postal area and, once the ABS publishes them for the current edition, remoteness and urban areas. Nothing is added outside Australia.
timezone, elevation, wikidata, country_info, codes, sun, regions, districts, census, demographics, road, siteoptionalflagExtra blocks, each added when its flag is 1, for example timezone=1&sun=1. All are off by default, so a plain lookup stays small and fast. See annotations.
annotationsoptionalinteger1 switches on every flag above at once. Default 0.
keyoptionalstringAPI key, if not sent as a header.

Example

$ curl -H "X-API-Key: YOUR_KEY" "https://api.mygeocode.com/v1/reverse?lat=41.8902&lon=12.4922&lang=it"
const url = new URL("https://api.mygeocode.com/v1/reverse");
url.searchParams.set("lat", 41.8902);
url.searchParams.set("lon", 12.4922);
url.searchParams.set("lang", "it");

const { result } = await (await fetch(url, { headers: { "X-API-Key": "YOUR_KEY" } })).json();
console.log(result ? result.formatted : "nothing nearby");
import requests

r = requests.get("https://api.mygeocode.com/v1/reverse",
                 params={"lat": 41.8902, "lon": 12.4922, "lang": "it"}, headers={"X-API-Key": "YOUR_KEY"}, timeout=10)
result = r.json()["result"]
print(result["formatted"] if result else "nothing nearby")
Response
{
  "status": "ok",
  "lat": 41.8902,
  "lon": 12.4922,
  "result": {
    "formatted": "Piazza del Colosseo 23, 00118 Roma, Italia",
    "lat": 41.891367,
    "lon": 12.491512,
    "distance_m": 142,
    "type": "address",
    "precision": "house",
    "confidence": 0.7,
    "place_id": "oHvVTPHTmCutza8QQ_Vz4W1M_PHkbXNzDA",
    "components": {
      "house_number": "23",
      "road": "Piazza del Colosseo",
      "city": "Roma",
      "state": "Lazio",
      "postcode": "00118",
      "country": "Italia",
      "country_code": "it"
    },
    "bounds": { "north": 41.891867, "south": 41.890869, "east": 12.492014, "west": 12.491015 },
    "codes": {
      "plus_code": "8FHJVFRR+GJ",
      "geohash": "sr2yk604ckf3",
      "mgrs": "33TTG9189240757",
      "maidenhead": "JN61fv83",
      "dms": {
        "lat": "41° 53' 28.9\" N",
        "lon": "12° 29' 29.4\" E"
      },
      "mapcode": "ITA HJ.PV",
      "mapcode_international": "TJLFM.J2LH"
    }
  }
}

Response fields

FieldTypeDescription
lat, lonnumberThe point you sent, echoed.
resultobject or nullnull when nothing is within radius at the requested level.
result.formattedstringThe address, or the locality name for coarser levels.
result.lat, result.lonnumberThe position of the returned feature, not your point.
result.distance_mintegerMetres from your point to result.lat, result.lon.
result.type, result.precision, result.confidence, result.place_id, result.components, result.bounds, result.parcel, result.place, result.formatted_placeAs in forward geocoding.
result.codesobjectThe point as a plus code, geohash, MGRS reference and other location codes. Present for houses, streets and points of interest; for other results only with codes=1. See annotations.
result.populationintegerFor a city, region or country from our worldwide gazetteer: its population.
result.timezone, elevation_m, wikidata, country_info, sun, regions, districts, census, demographics, road, intersection, siteobjectOnly when their flag is set, or with annotations=1. See annotations.
boundariesobjectOnly with boundaries=1 for a point in Australia: the boundaries listed under the parameter.

Notes

The same lookup in other providers' formats

If you already have code written against one of these providers, keep it: the drop-in host accepts the same path and parameters and answers in that provider's response shape, with this endpoint behind it. See how the drop-ins work.

ProviderHostPath
Google Maps Platformgapi.mygeocode.com/maps/api/geocode/json?latlng=lat,lng
Bing Maps REST Servicesbing.mygeocode.com/REST/v1/Locations/{lat},{lon}
HERE Geocoding and Searchhere.mygeocode.com/v1/revgeocode?at=lat,lng
Mapbox Geocodingmapbox.mygeocode.com/geocoding/v5/mapbox.places/{lon},{lat}.json
/search/geocode/v6/reverse?longitude=...&latitude=...
Geocode.Farmfarm.mygeocode.com/reverse/?lat=...&lon=...
/v3/json/reverse/?lat=...&lon=...
OpenStreetMap Nominatimosm.mygeocode.com/reverse?lat=...&lon=...&format=json
OpenCageopencage.mygeocode.com/geocode/v1/json?q=lat,lng
LocationIQlocationiq.mygeocode.com/v1/reverse?lat=...&lon=...&format=json
Geoapifygeoapify.mygeocode.com/v1/geocode/reverse?lat=...&lon=...
TomTom Searchtomtom.mygeocode.com/search/2/reverseGeocode/{lat},{lon}.json
MapQuest Geocodingmapquest.mygeocode.com/geocoding/v1/reverse?location=lat,lng
Geocodiogeocodio.mygeocode.com/v1.7/reverse?q=lat,lng
PositionStackpositionstack.mygeocode.com/v1/reverse?query=lat,lng

Bulk lookups

Post a JSON body to the same path with coords, an array of up to 100 [lat, lon] pairs, and the answer carries a results array with one entry per pair in the order sent. Each entry counts as one request, and a batch larger than what is left of the allowance is refused whole.

$ curl -X POST "https://api.mygeocode.com/v1/reverse" -H "Content-Type: application/json" -d '{"coords": [[52.5163, 13.3777], [47.3769, 8.5417]]}'

Errors

400 invalid_request when lat or lon is missing or out of range, level is not one of the listed values, radius is not 1 to 5000, or a bulk body has more than 100 pairs or an entry that is not a [lat, lon] pair.