Skip to content

GET /reverse API

  • Geocoding

Reverse geocode a latitude/longitude pair.

Returns nearby features ordered by relevance for the supplied point. Optional filters can restrict by layer, source, radius, or country.
Parameters
NameInTypeRequiredDescription
point.latquerynumberYesLatitude of the point to reverse geocode.
point.lonquerynumberYesLongitude of the point to reverse geocode.
sizequeryintegerNoNumber of results to return. Values above 40 are coerced to 40.
boundary.circle.radiusquerynumberNoRadius in kilometers for circular boundary filtering. Defaults to 50 for search and autocomplete, and 1 for reverse. Reverse queries cap the value at 5 km.
boundary.countryquerystringNoRestrict results to ISO-3166 alpha-2 or alpha-3 country codes. Provide a comma separated list for multiple countries.
boundary.gidquerystringNoPelias global identifier used to restrict results to a parent geography.
sourcesqueryarrayNoComma separated list of data sources to include.
layersqueryarrayNoComma separated list of record layers to include in the response.
  • point.latqueryRequired
    Typenumber

    Latitude of the point to reverse geocode.

  • point.lonqueryRequired
    Typenumber

    Longitude of the point to reverse geocode.

  • sizequeryOptional
    Typeinteger

    Number of results to return. Values above 40 are coerced to 40.

  • boundary.circle.radiusqueryOptional
    Typenumber

    Radius in kilometers for circular boundary filtering. Defaults to 50 for search and autocomplete, and 1 for reverse. Reverse queries cap the value at 5 km.

  • boundary.countryqueryOptional
    Typestring

    Restrict results to ISO-3166 alpha-2 or alpha-3 country codes. Provide a comma separated list for multiple countries.

  • boundary.gidqueryOptional
    Typestring

    Pelias global identifier used to restrict results to a parent geography.

  • sourcesqueryOptional
    Typearray

    Comma separated list of data sources to include.

  • layersqueryOptional
    Typearray

    Comma separated list of record layers to include in the response.

Sample responses
  • 200 Success — Successful reverse geocoding response.

    application/jsonGeoJSONFeatureCollection

    {
    "type": "FeatureCollection",
    "geocoding": {
    "version": "1.0.0",
    "timestamp": "2024-03-18T12:35:10Z",
    "engine": {
    "name": "pelias",
    "author": "geobridge",
    "version": "2.14.0"
    },
    "query": {
    "point.lat": 48.858268,
    "point.lon": 2.294471,
    "size": 3
    }
    },
    "features": [
    {
    "type": "Feature",
    "geometry": {
    "type": "Point",
    "coordinates": [
    2.294481,
    48.85837
    ]
    },
    "properties": {
    "id": "5013364",
    "gid": "openstreetmap:venue:way/5013364",
    "layer": "venue",
    "source": "openstreetmap",
    "source_id": "way/5013364",
    "name": "Tour Eiffel",
    "label": "Tour Eiffel, Paris 7e Arrondissement, Île-de-France, France",
    "confidence": 0.99,
    "accuracy": "point",
    "distance": 0,
    "continent": "Europe",
    "country": "France",
    "country_a": "FRA",
    "region": "Île-de-France",
    "county": "Paris",
    "locality": "Paris",
    "neighbourhood": "Gros-Caillou",
    "postalcode": "75007"
    }
    }
    ]
    }

    Nearby features around the supplied coordinates.

  • 400 Client error — Invalid input parameters supplied.

    application/jsonGeoJSONFeatureCollection

    {
    "type": "FeatureCollection",
    "geocoding": {
    "version": "1.0.0",
    "timestamp": "2024-03-18T12:35:10Z",
    "query": {
    "point.lat": 132,
    "point.lon": 2.294471
    },
    "errors": [
    {
    "code": "INVALID_COORDINATES",
    "message": "point.lat must be a value between -90 and 90."
    }
    ]
    },
    "features": []
    }

    Latitude outside the permitted range.

  • 408 Client error — Upstream search engine timeout.

    application/jsonGeoJSONFeatureCollection

    {
    "type": "FeatureCollection",
    "geocoding": {
    "version": "1.0.0",
    "query": {
    "point.lat": 48.858268,
    "point.lon": 2.294471
    },
    "errors": [
    {
    "code": "TIMEOUT",
    "message": "Reverse lookup exceeded the 1500 ms timeout window."
    }
    ],
    "warnings": [
    {
    "code": "RETRY_REQUEST",
    "message": "Retry with a smaller radius or after a short delay."
    }
    ]
    },
    "features": []
    }

    Timeout from the reverse geocoding engine.

  • 500 Server error — Unexpected server error.

    application/jsonGeoJSONFeatureCollection

    {
    "type": "FeatureCollection",
    "geocoding": {
    "version": "1.0.0",
    "query": {
    "point.lat": 48.858268,
    "point.lon": 2.294471
    },
    "errors": [
    {
    "code": "INTERNAL_SERVER_ERROR",
    "message": "Unexpected exception calling the reverse index."
    }
    ]
    },
    "features": []
    }

    Example of an unexpected backend failure.

Code samples

200 OK

Terminal window
# 200 OK — Looks up addresses near the Eiffel Tower using a narrow radius.
curl -s -G 'https://api-na.geobridge.io/v1/reverse' \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
--data-urlencode 'point.lat=48.858268' \
--data-urlencode 'point.lon=2.294471' \
--data-urlencode 'size=3' \
--data-urlencode 'layers=address'

400 Bad Request

Terminal window
# 400 Bad Request — Uses an out-of-range latitude to illustrate validation failures.
curl -s -G 'https://api-na.geobridge.io/v1/reverse' \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
--data-urlencode 'point.lat=123.456' \
--data-urlencode 'point.lon=2.294471'

408 Request Timeout

Terminal window
# 408 Request Timeout — Handle timeouts when reverse geocoding under load.
curl -s -G 'https://api-na.geobridge.io/v1/reverse' \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
--data-urlencode 'point.lat=48.858268' \
--data-urlencode 'point.lon=2.294471'

500 Internal Server Error

Terminal window
# 500 Internal Server Error — Demonstrates graceful degradation if reverse geocoding fails server-side.
curl -s -G 'https://api-na.geobridge.io/v1/reverse' \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
--data-urlencode 'point.lat=48.858268' \
--data-urlencode 'point.lon=2.294471'
Try it live

Save your API key once and reuse it across endpoints. Configure the request below and send it directly from the docs.

Stored locally in your browser. Removing it clears access for this device.

Query parameters

Latitude of the point to reverse geocode.

Longitude of the point to reverse geocode.

Number of results to return. Values above 40 are coerced to 40.

Radius in kilometers for circular boundary filtering. Defaults to 50 for search and autocomplete, and 1 for reverse. Reverse queries cap the value at 5 km.

Restrict results to ISO-3166 alpha-2 or alpha-3 country codes. Provide a comma separated list for multiple countries.

Pelias global identifier used to restrict results to a parent geography.

Comma separated list of data sources to include.

Comma separated list of record layers to include in the response.

Configure the request and select “Send request” to preview the response.