Reverse geocode a point
GET/reverse
const url = 'http://127.0.0.1:8080/reverse?lon=-79.3832&lat=43.6532';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://127.0.0.1:8080/reverse?lon=-79.3832&lat=43.6532'Returns the nearest address or street to a point, followed by the areas
that contain the point, most precise first. Only the first result carries
distance_m.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Longitude in degrees.
Example
-79.3832Latitude in degrees.
Example
43.6532Responses
Section titled “Responses”Results at the point, most precise first. features is empty when nothing is near.
A GeoJSON FeatureCollection answering /reverse.
object
One reverse geocoding result: the address or street at the point, or an area containing it.
object
GeoJSON Point. coordinates is [lon, lat].
object
Properties of a reverse geocoding result.
object
How precisely the coordinates locate the result, most precise first.
rooftop: the address or POI itself.interpolated: a house number placed between known neighbours.street: a point on the street.centroid: the centre of a mapped area.approximate: a point standing for something larger, such as a town or postcode.
Address parts stated by the source record.
object
Areas below the locality, outermost first (OSM addr:suburb,
addr:quarter, addr:neighbourhood).
Named place the house number belongs to where there is no street
(OSM addr:place).
POI category, such as amenity:cafe. Present only on POIs.
Administrative areas containing the result.
object
object
Stable ID from the source data, as in a result’s id.
object
Stable ID from the source data, as in a result’s id.
object
Stable ID from the source data, as in a result’s id.
object
Stable ID from the source data, as in a result’s id.
Named area outside the administrative levels, usually an island.
object
Stable ID from the source data, as in a result’s id.
object
Stable ID from the source data, as in a result’s id.
object
Stable ID from the source data, as in a result’s id.
object
Stable ID from the source data, as in a result’s id.
object
Stable ID from the source data, as in a result’s id.
Stable ID from the source data, such as osm:node:123.
One-line display label: name followed by its location.
Kind of result: an address, a street, a POI, or an area such as a locality or region.
House number and street for an address (12 King Street West), or
the name of a street, area or POI.
Row of the record in this Pack. Changes between Pack builds.
Source data the result comes from.
object
Source object type: an OSM node, way or relation, or a row of an
address dataset such as OpenAddresses.
Distance from the queried point in meters. Present only on the address or street result, not on areas.
The queried point, API version and data attribution.
object
Attribution required by the data licence.
Queried point.
object
API version. Changes only when a field is removed or changes meaning. New optional fields keep the version.
Example
{ "features": [ { "geometry": { "type": "Point" }, "properties": { "accuracy": "rooftop", "layer": "address", "source": { "object_type": "node" } }, "type": "Feature" } ], "geocoding": { "attribution": "© OpenStreetMap contributors, ODbL", "version": "1" }, "type": "FeatureCollection"}Headers
Section titled “Headers”ID the request is logged under: the request’s own X-Request-Id when it sent one. Include it in bug reports.
lon or lat is missing or out of range.
Error response, an RFC 9457 problem document.
object
Human-readable explanation. Absent on 500 errors.
Stable error code. Branch on this.
Rejected parameters. Present only when the error is about parameters.
A rejected parameter.
object
Parameter name.
Why it was rejected.
ID the request is logged under. Include it in bug reports.
Name of the HTTP status. Do not branch on it.
URI identifying the problem type. Currently always about:blank.
Example
{ "detail": "q must not be empty", "error_code": "invalid_query", "invalid_params": [ { "name": "limit", "reason": "must be at most 50" } ], "request_id": "01JA7Q2K3M4N5P6Q7R8S9T0V1W", "status": 400, "title": "Bad Request", "type": "about:blank"}Headers
Section titled “Headers”ID the request is logged under: the request’s own X-Request-Id when it sent one. Include it in bug reports.
Method not allowed. The route accepts GET only.
Error response, an RFC 9457 problem document.
object
Human-readable explanation. Absent on 500 errors.
Stable error code. Branch on this.
Rejected parameters. Present only when the error is about parameters.
A rejected parameter.
object
Parameter name.
Why it was rejected.
ID the request is logged under. Include it in bug reports.
Name of the HTTP status. Do not branch on it.
URI identifying the problem type. Currently always about:blank.
Example
{ "detail": "q must not be empty", "error_code": "invalid_query", "invalid_params": [ { "name": "limit", "reason": "must be at most 50" } ], "request_id": "01JA7Q2K3M4N5P6Q7R8S9T0V1W", "status": 400, "title": "Bad Request", "type": "about:blank"}Headers
Section titled “Headers”Example
GETMethods the route accepts.
ID the request is logged under: the request’s own X-Request-Id when it sent one. Include it in bug reports.
Internal server error.
Error response, an RFC 9457 problem document.
object
Human-readable explanation. Absent on 500 errors.
Stable error code. Branch on this.
Rejected parameters. Present only when the error is about parameters.
A rejected parameter.
object
Parameter name.
Why it was rejected.
ID the request is logged under. Include it in bug reports.
Name of the HTTP status. Do not branch on it.
URI identifying the problem type. Currently always about:blank.
Example
{ "detail": "q must not be empty", "error_code": "invalid_query", "invalid_params": [ { "name": "limit", "reason": "must be at most 50" } ], "request_id": "01JA7Q2K3M4N5P6Q7R8S9T0V1W", "status": 400, "title": "Bad Request", "type": "about:blank"}Headers
Section titled “Headers”ID the request is logged under: the request’s own X-Request-Id when it sent one. Include it in bug reports.

