Reverse Geocoding API

Convert latitude/longitude coordinates into a readable address, from country level down to street level, with optional country enrichment.

Reverse Geocoding API

The Reverse Geocoding API accepts a latitude and longitude and returns the best-matching address for that point on Earth. Responses include a structured address object with each administrative level named separately, making it easy to extract exactly the component you need.

Endpoint

GET https://api.mapzena.com/v1/reverse

Parameters

ParameterTypeRequiredDescription
key string optional Optional in free mode. Required for metered usage above the free allowance.
lat float required Latitude in decimal degrees. Range: -90 to 90.
lon float required Longitude in decimal degrees. Range: -180 to 180.
zoom integer optional Controls the detail level of the result. 3=country, 8=state, 10=city, 14=suburb, 18=building. Default: 18.
lang string optional Preferred language for place names. BCP-47 code. Default: en.
enrich 0 or 1 optional Include full country_data enrichment. Counts as 1 extra request unit.

Example request

bash - curl
curl "https://api.mapzena.com/v1/reverse?lat=48.8566&lon=2.3522&enrich=1&key=YOUR_KEY"

Example response

json
{
  "status":       "ok",
  "lat":          48.8566,
  "lon":          2.3522,
  "display_name": "Palais du Louvre, Rue de Rivoli, 1st Arrondissement, Paris, รŽle-de-France, France",
  "address": {
    "building":      "Palais du Louvre",
    "road":          "Rue de Rivoli",
    "neighbourhood": "1st Arrondissement",
    "suburb":        "1st Arrondissement",
    "city":          "Paris",
    "county":        "Arrondissements de Paris",
    "state":         "รŽle-de-France",
    "postcode":      "75001",
    "country":       "France",
    "country_code":  "FR"
  },
  "country_data": {
    "name":          "France",
    "iso2":          "FR",
    "iso3":          "FRA",
    "capital":       "Paris",
    "population":    67750000,
    "gdp_bn_usd":    2780.1,
    "gdp_per_capita": 41030,
    "area_km2":      551695,
    "currency":      "EUR",
    "languages":     ["fr"],
    "calling_code":  "+33",
    "tld":           ".fr",
    "hdi":           0.903,
    "life_expect":   82.5,
    "neighbours":   ["ES", "IT", "CH", "DE", "LU", "BE"]
  }
}

Address fields

Not all fields are present for every location - availability depends on data density for that area. All available fields are always included; absent fields are omitted (never null).

FieldDescription
buildingNamed building or venue
house_numberHouse or unit number
roadStreet or road name
neighbourhoodNeighbourhood or quarter
suburbSuburb or borough
cityCity or town
townTown (smaller than city)
villageVillage
countyCounty or district
stateState, province, or region
state_codeISO 3166-2 state/province code
postcodePostal or ZIP code
countryCountry name
country_codeISO 3166-1 alpha-2 code

Error codes

HTTPCodeDescription
400missing_coordinateslat or lon parameter missing.
400invalid_coordinatesCoordinates out of valid range.
404not_foundNo address data available for this location.
429rate_limit_exceededQuota reached.

Code examples

PHP

php
<?php
$key = 'YOUR_KEY';
$lat = 48.8566;
$lon = 2.3522;
$url = "https://api.mapzena.com/v1/reverse?lat={$lat}&lon={$lon}&key={$key}";

$data = json_decode(file_get_contents($url), true);
echo $data['display_name'];

Python

python
import urllib.request, json

key = "YOUR_KEY"
url = f"https://api.mapzena.com/v1/reverse?lat=48.8566&lon=2.3522&key={key}"

with urllib.request.urlopen(url) as r:
    data = json.load(r)

print(data["display_name"])