Docs/APIs/Reverse Geocode

Reverse Geocode

Get location from coordinates worldwide

OperationalCredits 5 per callp50 846msGeographyStar

Overview

Lookup runs against our own stored data, never a third party. First the point given by `lat` and `lon` is placed in a country using country boundary polygons. In the US, Canada and Australia the nearest entry in a postal location dataset is found for that country, and its `city`, `state`, `state_abbr` and `zipcode` are returned.

Everywhere else the point is matched to the settlement it sits in from the GeoNames cities500 gazetteer: among places whose built-up area, estimated from population, reaches the point, the most local administrative seat wins (Minato for a point by Tokyo Tower, Paris for the Eiffel Tower); failing that, the nearest place within 150 km. `zipcode` is then the nearest GeoNames postal code centroid in the same country within 25 km, `state` the first-level region and `county` the second-level division. Open ocean returns a 404.

Results are only as fine-grained as the data: the answer is the closest postal-code location or settlement, not the containing boundary, so points near a town or postal code line can resolve to the neighbouring one. `latitudeClosest` and `longitudeClosest` are the matched location's coordinates, returned as strings, and `distance` is how far it lies from your point in kilometers. `latitude` and `longitude` echo the input and `countryCode` is the two-letter code.

`nearestCities` holds up to 20 unique city names from a worldwide city list, ordered by distance from your point, closest first. `distance`, the closest coordinates, `estimatedCity` and `nearestCities` are null on the Free plan.

Data outside the US, Canada and Australia: [GeoNames](https://www.geonames.org/), CC BY 4.0. UK postcodes contain Royal Mail data © Royal Mail copyright and database right.

Live Test Reverse Geocode API →

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

GEThttps://api.apiverve.com/v1/reversegeocode
curl "https://api.apiverve.com/v1/reversegeocode?lat=40.714224&lon=-73.961452&geocodes=true" \
  -H "x-api-key: your_api_key_here"

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.

Parameters

Sent in the query string. Premium parameters are accepted on every plan but only take effect on plans that include them.

ParameterTypeDescription
latRequirednumberThe latitude of the coordinates
range -90–90
lonRequirednumberThe longitude of the coordinates
range -180–180
geocodesOptionalPremiumbooleanAdd a geocodes object with the point's geohash, plus code (Open Location Code) and degrees-minutes-seconds notation

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "status": "ok",
  "error": null,
  "data": {
    "zipcode": "11211",
    "state_abbr": "NY",
    "city": "Brooklyn",
    "state": "New York",
    "distance": 0.6501757300758664,
    "latitudeClosest": "40.712090",
    "longitudeClosest": "-73.95427",
    "countryCode": "US",
    "latitude": 40.714224,
    "longitude": -73.961452,
    "estimatedCity": true,
    "nearestCities": [
      "Brooklyn",
      "Brooklyn Park",
      "East Brooklyn",
      "Brooklyn Center",
      "Brooklyn Heights"
    ],
    "timezone": "America/New_York",
    "county": "Kings County",
    "countyFips": "36047",
    "geocodes": {
      "geohash": "dr5rsgyct",
      "plusCode": "87G8P27Q+MC",
      "dms": {
        "latitude": "40°42'51.2\"N",
        "longitude": "73°57'41.2\"W"
      }
    }
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
zipcodestring"11211"ZIP or postal code for the location. Australian postcodes are returned as numbers, so ones starting with 0 (Darwin, 0800) lose the leading zero. Outside the US, Canada and Australia it is the nearest postal code centroid within 25 km, or null where GeoNames has no postal codes for the country
state_abbrstring"NY"Two-letter state abbreviation code. Outside the US, Canada and Australia, the region's letter code where one exists (ENG, ZH); null where the country's region codes are numeric
citystring"Brooklyn"Primary city name at coordinates. Outside the US, Canada and Australia, the city, town or village the point sits in
statestring"New York"Full state name, or the first-level region (prefecture, region, province) outside the US, Canada and Australia
distancePremiumnumber0.6501757300758664Distance from your point to the closest mapped coordinates, in kilometers
latitudeClosestPremiumstring"40.712090"Latitude of closest mapped coordinate
longitudeClosestPremiumstring"-73.95427"Longitude of closest mapped coordinate
countryCodestring"US"ISO country code for location
latitudenumber40.714224Input latitude coordinate
longitudenumber-73.961452Input longitude coordinate
estimatedCityPremiumbooleantrueWhether city is estimated or exact match
nearestCitiesPremiumarray[Brooklyn, ...]List of nearby cities ordered by proximity
timezonestring"America/New_York"IANA time zone at the requested coordinates (e.g., America/New_York)
countystring"Kings County"Primary county of the matched ZIP code in the US; outside the US, Canada and Australia, the second-level division of the matched place (a French department, a Tokyo ward); null in Canada and Australia
US: the county holding most of the matched ZIP code's land, from the Census 2020 ZCTA-to-county file; a point in a ZIP that crosses a county line can sit in a neighbouring county. Elsewhere: the GeoNames admin2 name of the matched place.
countyFipsPremiumstring"36047"Five-digit FIPS code of that county (US only)
geocodesPremiumobject{...}Encodings of the requested point (only when geocodes=true)
geohashPremiumstring"dr5rsgyct"9-character geohash (about 5 m precision)
plusCodePremiumstring"87G8P27Q+MC"10-digit global plus code (Open Location Code, about 14 m precision), e.g., 87G8P27Q+MC
dmsPremiumobject{...}Latitude and longitude in degrees, minutes and seconds
latitudePremiumstring"40°42'51.2"N"Latitude in DMS notation, e.g., 40°42'51.2"N
longitudePremiumstring"73°57'41.2"W"Longitude in DMS notation, e.g., 73°57'41.2"W

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Use cases

Fleet Telematics Tracking
Logistics systems match vehicle GPS pings against city and state boundaries to generate human-readable trip summaries for dispatchers.
Mobile Photo Geotagging
Camera apps read coordinate metadata from uploaded photos to display the city and state where each picture was taken.
Delivery Address Autofill
When a customer shares device coordinates at checkout, ecommerce apps automatically populate the city, state, and ZIP code fields.
Field Service Dispatch
To assign incoming repair tickets, maintenance platforms convert technician coordinates into local municipality names and postal codes.
International Address Forms
Courier and travel apps turn a customer's shared location in Paris, Tokyo or Berlin into the city, region and postal code fields of a local address form.

Other ways to use Reverse Geocode

Set up Reverse Geocode on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKit →Reference →
Google Sheets or ExcelA =VERVE() formula fills a column — no script, no export, recalculates in place.VerveSheets →Reference →
Ground an agent on itA cited, machine-checkable fact your model can't produce on its own.VerveContext →Reference →

More in Geography:

Was this page helpful?