Reverse geocoding

August 29, 2025 · View on GitHub

Reverse geocoding is used for finding places or addresses near a latitude, longitude pair—like clicking on a map to see what's there when the map doesn't show it otherwise. For example, picture a map showing building outlines but no labels, then clicking on a building and being shown the name of the business. That's reverse geocoding.

With reverse geocoding with Pelias, you can look up all sorts of information about points on a map, including:

  • addresses
  • points of interest (businesses, museums, parks, and so on)
  • neighborhoods
  • cities
  • states
  • postal areas
  • countries

To get started with reverse geocoding, you need a latitude, longitude pair in decimal degrees specified with the parameters point.lat and point.lon, respectively. For example, the Eiffel Tower in Paris, France, is located at 48.858268,2.294471. The reverse geocode query for this would be:

/v1/reverse?point.lat=48.858268&point.lon=2.294471

The output is the standard GeoJSON format.

Reverse geocoding parameters

Like other queries with Pelias, reverse geocoding has optional, additional parameters you can use to refine results.

ParameterTypeRequiredDefaultExample
point.latfloating point numberyesnone48.858268
point.lonfloating point numberyesnone2.294471
boundary.circle.radiusfloating point numberno15
sizeintegerno103
layerscomma-delimited string arraynonone (all layers)address,locality
sourcescomma-delimited string arraynonone (all sources)oa,gn
boundary.countrycomma separated list of ISO-3166 alpha-2 or alpha-3nononeFR,GBR
boundary.gidPelias gidnononewhosonfirst:locality:101748355

Note that boundary.circle.radius is limited to a radius of 5km to conserve disk I/O.

Size

A basic parameter for filtering is size, which is used to limit the number of results returned. In the earlier request that returned the Eiffel Tower (or 'Tour Eiffel', to be exact), notice that other results were returned including "Bureau de Gustave Eiffel" (a museum) and "Le Jules Verne" (a restaurant). To limit a reverse geocode to only the first result, pass the size parameter:

/v1/reverse?point.lat=48.858268&point.lon=2.294471&size=1

The default value for size is 10 and the maximum value is 40. Specifying a value greater than 40 will override to 40 and return a warning in the response metadata.

Filter by data source

By default, reverse geocoding returns results from any data source available to Pelias. To filter results by source, specify one or more valid source names in a comma-delimited list using the sources parameter. For example, the following request returns only results from OpenStreetMap:

sourcenameshort name
OpenStreetMapopenstreetmaposm
OpenAddressesopenaddressesoa
Who's on Firstwhosonfirstwof
GeoNamesgeonamesgn

/v1/reverse?point.lat=48.858268&point.lon=2.294471&sources=osm

Filter by layers (data type)

Without specifying further, reverse geocoding doesn't restrict results to a particular type (street, venue, neighbourhood, and so on). If your application is only concerned with, say, which city a latitude, longitude is closest to, then use the layers parameter. For example, the following request returns only results that are localities (cities and towns):

/v1/reverse?point.lat=48.858268&point.lon=2.294471&layers=locality

Here are all the supported layers and their meanings.

layerdescription
venuepoints of interest, businesses, things with walls
addressplaces with a street address
streetstreets,roads,highways
countryplaces that issue passports, nations, nation-states
macroregiona related group of regions. Mostly in Europe
regionstates and provinces
macrocountya related group of counties. Mostly in Europe.
countyofficial governmental area; usually bigger than a locality, almost always smaller than a region
localitytowns, hamlets, cities
localadminlocal administrative boundaries
borougha local administrative boundary, currently only used for New York City
neighbourhoodsocial communities, neighbourhoods
coarsealias for simultaneously using all administrative layers (everything except venue and address)

Filter by country

If you are performing a reverse geocode near a country boundary, and are only interested in results from one country and not the other, you can specify a country code. You can set the boundary.country parameter value to the alpha-2 or alpha-3 ISO-3166 country code. For example, the latitude,longitude pair 47.270521,9.530846 is on the boundary of Austria, Liechtenstein, and Switzerland. Without specifying a boundary.country, the first 10 results returned may come from all three countries. By including boundary.country=LIE, all 10 results will be from Liechtenstein. Here's the request in action:

/v1/reverse?point.lat=47.270521&point.lon=9.530846&boundary.country=LIE

Note that UK is not a valid ISO 3166-1 alpha-2 country code.

Distance and confidence scores for the results

Each result returned has a distance from the query point (in kilometers) and an associated confidence score. Confidence scores are calculated based on the distance from the result to the supplied point.lat and point.lon. Confidence scoring for reverse geocode results is likely to change with different data sources and layers.

Distance from point.lat/point.lonConfidence score
< 1m1.0
< 10m0.9
< 100m0.8
< 250m0.7
< 1km0.6
>= 1km0.5

Example requests

This section shows how the various parameters can be combined to form complex use cases.

All results near the Tower of London

/v1/reverse?point.lat=51.5081124&point.lon=-0.0759493

Only OpenStreetMap results near the Tower of London

/v1/reverse?point.lat=51.5081124&point.lon=-0.0759493&sources=osm

Only street addresses near the Tower of London

/v1/reverse?point.lat=51.5081124&point.lon=-0.0759493&layers=address

Only OpenStreetMap street addresses near the Tower of London

/v1/reverse?point.lat=51.5081124&point.lon=-0.0759493&layers=address&sources=osm

Only the first OpenStreetMap address near the Tower of London

/v1/reverse?point.lat=51.5081124&point.lon=-0.0759493&layers=address&sources=osm&size=1