Reverse Geocoding
As discussed in the Quickstart, there are plenty of ways to access Naurt data. These examples will guide you through each way you can reverse geocode with Naurt. Before continuing, make sure you have your free API key from the Naurt Dashboard.
Reverse Geocode
Section titled “Reverse Geocode”A reverse geocode searches for nearby addresses. It will find the closest address to the specified location. The best use case for this is when users are exploring areas. For example, clicking on a map to reveal the closest addresses.
-
Configure a
POSTrequest to the final-destination endpoint with the following headers.Terminal window https://api.naurt.net/final-destination/v2Authorization: <API-KEY-HERE>Content-Type: application/json -
Configure your JSON payload with a
location{"queries": [{"location": {"latitude": 51.152342,"longitude": -0.214234}}]}{"request_id": "85cee55b-f9cc-4b6c-9254-091588a22161","responses": [{"additional_matches": [],"best_match": {"address": "Gatwick Aviation Museum, Lowfield Heath Road, Charlwood, Horley, RH6 0BT, United Kingdom","distance": 124.32,"geojson": {"features": [{"geometry": {"coordinates": [-0.215979, 51.15257],"type": "Point"},"properties": { "naurt_type": "basic_geocode" },"type": "Feature"},{"geometry": {"coordinates": [[-0.216050315, 51.152570808]],"type": "MultiPoint"},"properties": {"accuracy": { "quality": "high" },"naurt_type": "naurt_door"},"type": "Feature"},{"geometry": {"coordinates": [[[-0.21573266465373608, 51.15236090841029],[-0.21563349450888, 51.15242003934162],[-0.2160976384129509, 51.1527263288431],[-0.21619682997769277, 51.15266718988707],[-0.21573266465373608, 51.15236090841029]]],"type": "Polygon"},"properties": {"contributors": ["© OpenStreetMap contributors"],"naurt_type": "naurt_building"},"type": "Feature"},{"geometry": {"coordinates": [[[-0.21781341962306508, 51.15254754332662],[-0.2177770330203757, 51.15254714373012],[-0.21777465547299327, 51.15263232197128],[-0.21781104207568264, 51.152632721567045],[-0.21781341962306508, 51.15254754332662]]],"type": "Polygon"},"properties": {"accuracy": { "quality": "high" },"minimum_parking_to_door_distance": 122.998278403148,"naurt_type": "naurt_parking"},"type": "Feature"}],"type": "FeatureCollection"},"id": "8bd197aa-7328-3e10-9ea7-7ec139e9fa48"},"status": "ok"}],"version": "v2.6.9-hf.1"}
In more rural areas, there might not be a very nearby address. If you want to
limit how far away an address may appear, use the optional distance_filter.
{ "queries": [ { "location": { "latitude": 50.542, "longitude": 0.234, "distance_filter": 10000.0 } } ]}You can also use additional_matches to show up to the five closest addresses.
{ "queries": [ { "location": { "latitude": 50.542, "longitude": 0.234, "distance_filter": 10000.0 }, "additional_matches": true } ]}When reverse geocoding, please refer to the language reference to see which language is the default for each region.