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 forward geocode with Naurt. Before continuing, make sure you have your free API key from the Naurt Dashboard.
Forward Geocode
Section titled “Forward Geocode”-
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
JSONpayload with an address string.{"queries": [{"address_string": "32 Thames St, Windsor SL4 1PS"}]}{"request_id": "7d7be78e-1402-415f-bd76-4030ad19bfad","responses": [{"additional_matches": [],"best_match": {"address": "Theatre Royal, 32 Thames Street, Windsor, SL4 1PS, United Kingdom","geojson": {"features": [{"geometry": {"coordinates": [-0.607894, 51.48441700000001],"type": "Point"},"properties": {"naurt_type": "basic_geocode"},"type": "Feature"},{"geometry": {"coordinates": [[-0.607730566, 51.484306359]],"type": "MultiPoint"},"properties": {"accuracy": {"quality": "high"},"naurt_type": "naurt_door"},"type": "Feature"},{"geometry": {"coordinates": [[[-0.6081480199888122, 51.484251832439384],[-0.6081740210612274, 51.48423064494844],[-0.6081171832580435, 51.48416877579399],[-0.6076321710110988, 51.48434154340296],[-0.6077148950515365, 51.484431589906734],[-0.6078542282003951, 51.48438195173696],[-0.607763805899748, 51.48445563385991],[-0.6078900193130887, 51.48459301885964],[-0.6076717703860179, 51.48467077080818],[-0.6077596332076164, 51.484766410265024],[-0.6075029886359617, 51.48485784043572],[-0.6075584809443502, 51.48491824407875],[-0.6078787814194531, 51.48480413648076],[-0.6078353565108041, 51.48475686236509],[-0.6078553420749278, 51.484740575420375],[-0.6079156657383522, 51.48476928282517],[-0.6080668450377913, 51.484715424798026],[-0.6080587524094838, 51.48470661589923],[-0.6083234802747328, 51.48461230572235],[-0.6082691440561083, 51.48455316009256],[-0.6082085193541497, 51.484574757888225],[-0.6081645879433406, 51.4845269379839],[-0.6082494625261026, 51.4844967010354],[-0.6083327009886651, 51.484587307187496],[-0.6084802210967942, 51.484534752548],[-0.6083796412878528, 51.48442526996536],[-0.608307069052092, 51.48445112418966],[-0.6082849898907927, 51.484440616874934],[-0.6083608618303038, 51.48441358710801],[-0.6082621642483367, 51.48430615307373],[-0.6081480199888122, 51.484251832439384]]],"type": "Polygon"},"properties": {"contributors": ["© OpenStreetMap contributors"],"naurt_type": "naurt_building"},"type": "Feature"},{"geometry": {"coordinates": [[[-0.6077229764102252, 51.484238734703865],[-0.607698340716131, 51.48422205444979],[-0.6075983751538052, 51.48427930925655],[-0.6076230108478993, 51.48429598948971],[-0.6077229764102252, 51.484238734703865]]],"type": "Polygon"},"properties": {"accuracy": {"quality": "high"},"minimum_parking_to_door_distance": 7.537821135977796,"naurt_type": "naurt_parking"},"type": "Feature"}],"type": "FeatureCollection"},"id": "c25f8e54-7a2a-37b7-9aa3-677f83685aed","search_confidence": 1.0},"status": "ok"}],"version": "v2.6.9-hf.1"}
{ "queries": [ { "address_string": "32 Thames St, Windsor SL4 1PS", "country": "UK" } ]}You can also request some additional matches (up to 5 total) by using the
additional_matches field.
{ "queries": [ { "address_string": "32 Thames St, Windsor SL4 1PS", "country": "UK", "additional_matches": true
} ]}Structured Forward Geocode
Section titled “Structured Forward Geocode”A structured geocode allows you to search with already parsed and structured data. A structured geocode has a minimum set of fields required. At minimum you must include
street_nameANDpostalcodeANDhouse_nameORstreet_number
i.e. three fields minimum.
-
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
JSONpayload with anaddress_structured.{"queries": [{"address_structured": {"postalcode": "10013","street_name": "Broome Street","street_number": "489","city": "New York",}}]}{"request_id": "1749f2af-bd51-47a6-bd0c-0d5f07be4412","responses": [{"additional_matches": [],"best_match": {"address": "489 Broome St, New York, NY 10013, United States","geojson": {"features": [{"geometry": {"coordinates": [-74.00265, 40.72305],"type": "Point"},"properties": { "naurt_type": "basic_geocode" },"type": "Feature"},{"geometry": {"coordinates": [[-74.002641124, 40.723059168]],"type": "MultiPoint"},"properties": {"accuracy": { "quality": "high" },"naurt_type": "naurt_door"},"type": "Feature"},{"geometry": {"coordinates": [[[-74.00232824671696, 40.7229216919784],[-74.00296964289005, 40.72320437480329],[-74.00360140414838, 40.72238104624978],[-74.00339896348125, 40.72229182350918],[-74.00341761326008, 40.7222675184199],[-74.00297865775413, 40.7220740547682],[-74.00280964413335, 40.72229431995589],[-74.00280964413335, 40.72229431995589],[-74.00232824671696, 40.7229216919784]]],"type": "Polygon"},"properties": {"contributors": ["© OpenStreetMap contributors"],"naurt_type": "naurt_building"},"type": "Feature"},{"geometry": {"coordinates": [[[-74.00264337797739, 40.72315225092095],[-74.00266319348277, 40.72312911739789],[-74.0025492750267, 40.72307307093712],[-74.00252945952131, 40.723096204479646],[-74.00264337797739, 40.72315225092095]]],"type": "Polygon"},"properties": {"accuracy": { "quality": "high" },"minimum_parking_to_door_distance": 10.352091330644349,"naurt_type": "naurt_parking"},"type": "Feature"}],"type": "FeatureCollection"},"id": "8502fb51-5b43-3e5a-a251-8f7e3221d060","search_confidence": 1.0},"status": "ok"}],"version": "v2.6.9-hf.1"}
Forward Geocode with Location
Section titled “Forward Geocode with Location”If you know approximately where an address is, you can include a location to help narrow down the results. This can really improve speed and accuracy, but, if the provided location is very distant from the real location, you might not be able to find the right address.
A good use case for this is searching when the user is on a map, you could include the current view area, for example, for a “search in this area” feature.
-
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 an
address_stringandlocation{"queries": [{"address_string": "32 Thames St, Windsor SL4 1PS","location": {"latitude": 51.484,"longitude": -0.607}}]}{"request_id": "b4384f4f-ede8-409f-b761-11602f2c9255","responses": [{"additional_matches": [],"best_match": {"address": "Theatre Royal, 32 Thames Street, Windsor, SL4 1PS, United Kingdom","distance": 77.34,"geojson": {"features": [{"geometry": {"coordinates": [-0.607894, 51.48441700000001],"type": "Point"},"properties": { "naurt_type": "basic_geocode" },"type": "Feature"},{"geometry": {"coordinates": [[-0.607730566, 51.484306359]],"type": "MultiPoint"},"properties": {"accuracy": { "quality": "high" },"naurt_type": "naurt_door"},"type": "Feature"},{"geometry": {"coordinates": [[[-0.6081480199888122, 51.484251832439384],[-0.6081740210612274, 51.48423064494844],[-0.6081171832580435, 51.48416877579399],[-0.6076321710110988, 51.48434154340296],[-0.6077148950515365, 51.484431589906734],[-0.6078542282003951, 51.48438195173696],[-0.607763805899748, 51.48445563385991],[-0.6078900193130887, 51.48459301885964],[-0.6076717703860179, 51.48467077080818],[-0.6077596332076164, 51.484766410265024],[-0.6075029886359617, 51.48485784043572],[-0.6075584809443502, 51.48491824407875],[-0.6078787814194531, 51.48480413648076],[-0.6078353565108041, 51.48475686236509],[-0.6078553420749278, 51.484740575420375],[-0.6079156657383522, 51.48476928282517],[-0.6080668450377913, 51.484715424798026],[-0.6080587524094838, 51.48470661589923],[-0.6083234802747328, 51.48461230572235],[-0.6082691440561083, 51.48455316009256],[-0.6082085193541497, 51.484574757888225],[-0.6081645879433406, 51.4845269379839],[-0.6082494625261026, 51.4844967010354],[-0.6083327009886651, 51.484587307187496],[-0.6084802210967942, 51.484534752548],[-0.6083796412878528, 51.48442526996536],[-0.608307069052092, 51.48445112418966],[-0.6082849898907927, 51.484440616874934],[-0.6083608618303038, 51.48441358710801],[-0.6082621642483367, 51.48430615307373],[-0.6081480199888122, 51.484251832439384]]],"type": "Polygon"},"properties": {"contributors": ["© OpenStreetMap contributors"],"naurt_type": "naurt_building"},"type": "Feature"},{"geometry": {"coordinates": [[[-0.6077229764102252, 51.484238734703865],[-0.607698340716131, 51.48422205444979],[-0.6075983751538052, 51.48427930925655],[-0.6076230108478993, 51.48429598948971],[-0.6077229764102252, 51.484238734703865]]],"type": "Polygon"},"properties": {"accuracy": { "quality": "high" },"minimum_parking_to_door_distance": 7.537821135977796,"naurt_type": "naurt_parking"},"type": "Feature"}],"type": "FeatureCollection"},"id": "c25f8e54-7a2a-37b7-9aa3-677f83685aed","search_confidence": 1.0},"status": "ok"}],"version": "v2.6.9-hf.1"}
You can also specify the distance filter yourself, for example, to make it larger. Note that in the above example, the default distance is 5000m. In the below request, we extend it to 10000m:
{ "queries": [ { "address_string": "32 Thames St, Windsor SL4 1PS", "location": { "latitude": 51.484, "longitude": -0.607, "distance_filter": 10000.0 } } ]}{ "queries": [ { "address_string": "32 Thames St, Windsor SL4 1PS", "location": { "latitude": 51.484, "longitude": -0.607, "distance_filter": 10000.0 }, "additional_matches": true } ]}Structured Geocode with Location
Section titled “Structured Geocode with Location”Analogous to a forward geocode with a location, we can also supply a location to a structured geocode which allows for narrowing of the search. While this is significantly faster and more accurate if the supplied location is accurate, if the address you are searching for is outside the specified location it can not be found!
-
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 an
address_structuredandlocation.{"queries": [{"address_structured": {"postalcode": "10013","street_name": "Broome Street","street_number": "489","city": "New York",},"additional_matches": true,"location": {"latitude": 40.72,"longitude": -74.0}}]}{"request_id": "da7954ac-f984-4069-a438-8d4c1dd53215","responses": [{"additional_matches": [{"address": "489 Broome St, New York, NY 10013, United States","distance": 406.07,"geojson": {"features": [{"geometry": {"coordinates": [-74.00265, 40.72305],"type": "Point"},"properties": { "naurt_type": "basic_geocode" },"type": "Feature"},{"geometry": {"coordinates": [[-74.002641124, 40.723059168]],"type": "MultiPoint"},"properties": {"accuracy": { "quality": "high" },"naurt_type": "naurt_door"},"type": "Feature"},{"geometry": {"coordinates": [[[-74.00232824671696, 40.7229216919784],[-74.00296964289005, 40.72320437480329],[-74.00360140414838, 40.72238104624978],[-74.00339896348125, 40.72229182350918],[-74.00341761326008, 40.7222675184199],[-74.00297865775413, 40.7220740547682],[-74.00280964413335, 40.72229431995589],[-74.00280964413335, 40.72229431995589],[-74.00232824671696, 40.7229216919784]]],"type": "Polygon"},"properties": {"contributors": ["© OpenStreetMap contributors"],"naurt_type": "naurt_building"},"type": "Feature"},{"geometry": {"coordinates": [[[-74.00264337797739, 40.72315225092095],[-74.00266319348277, 40.72312911739789],[-74.0025492750267, 40.72307307093712],[-74.00252945952131, 40.723096204479646],[-74.00264337797739, 40.72315225092095]]],"type": "Polygon"},"properties": {"accuracy": { "quality": "high" },"minimum_parking_to_door_distance": 10.352091330644349,"naurt_type": "naurt_parking"},"type": "Feature"}],"type": "FeatureCollection"},"id": "8502fb51-5b43-3e5a-a251-8f7e3221d060","search_confidence": 1.0},{"address": "425 Broome St, New York, NY 10013, United States","distance": 166.65,"geojson": {"features": [{"geometry": {"coordinates": [-73.99895, 40.72127],"type": "Point"},"properties": { "naurt_type": "basic_geocode" },"type": "Feature"},{"geometry": {"coordinates": [[-73.998941853, 40.721281332]],"type": "MultiPoint"},"properties": {"accuracy": { "quality": "high" },"naurt_type": "naurt_door"},"type": "Feature"},{"geometry": {"coordinates": [[[-73.99841663585295, 40.72106646854272],[-73.9990496332709, 40.72132514368411],[-73.9992608463105, 40.7210282230912],[-73.99902685005384, 40.72093261234761],[-73.99900834427505, 40.72095862424848],[-73.99891898786542, 40.72092210850616],[-73.99890218074367, 40.72094573276251],[-73.99882113655819, 40.72091261382789],[-73.99880266011438, 40.720938584503045],[-73.99865095758824, 40.720876598865345],[-73.99868905484476, 40.72082304891762],[-73.99884283548771, 40.72088588372384],[-73.99888372025258, 40.720828415628205],[-73.99894937475295, 40.7208552455599],[-73.99908381820495, 40.720666245491515],[-73.99906303703698, 40.720657753174606],[-73.99911233296937, 40.72058845300626],[-73.99883681389699, 40.72047586068979],[-73.99841663585295, 40.72106646854272]]],"type": "Polygon"},"properties": {"contributors": ["© OpenStreetMap contributors"],"naurt_type": "naurt_building"},"type": "Feature"},{"geometry": {"coordinates": [[[-73.99894796588269, 40.72137719352759],[-73.99896589453785, 40.72135319153307],[-73.9988477025435, 40.72130248051562],[-73.99882977388835, 40.72132648252844],[-73.99894796588269, 40.72137719352759]]],"type": "Polygon"},"properties": {"accuracy": { "quality": "high" },"minimum_parking_to_door_distance": 10.67175676328779,"naurt_type": "naurt_parking"},"type": "Feature"}],"type": "FeatureCollection"},"id": "82fed47b-77e0-3643-a736-87db5a55d0ac","search_confidence": 0.81},{"address": "429 Broome St, New York, NY 10013, United States","distance": 166.94,"geojson": {"features": [{"geometry": {"coordinates": [-73.99922, 40.72138000000001],"type": "Point"},"properties": { "naurt_type": "basic_geocode" },"type": "Feature"},{"geometry": {"coordinates": [[-73.999212318, 40.721390151]],"type": "MultiPoint"},"properties": {"accuracy": { "quality": "high" },"naurt_type": "naurt_door"},"type": "Feature"},{"geometry": {"coordinates": [[[-73.9994585, 40.721163399999995],[-73.9993536, 40.7212902],[-73.9992555, 40.72140870000001],[-73.9991687, 40.721371799999986],[-73.9993745, 40.721123199999994],[-73.9994585, 40.721163399999995]]],"type": "Polygon"},"properties": {"contributors": ["© OpenStreetMap contributors"],"naurt_type": "naurt_building"},"type": "Feature"},{"geometry": {"coordinates": [[[-73.99921737653915, 40.7214873357907],[-73.99923541206336, 40.72146337986947],[-73.99911744675038, 40.72141236665837],[-73.99909941122615, 40.72143632259798],[-73.99921737653915, 40.7214873357907]]],"type": "Polygon"},"properties": {"accuracy": { "quality": "high" },"minimum_parking_to_door_distance": 10.814860924405819,"naurt_type": "naurt_parking"},"type": "Feature"}],"type": "FeatureCollection"},"id": "8467b957-aa4e-361f-9821-a87955bbb624","search_confidence": 0.81},{"address": "429 Broome St, FL 2, New York, NY 10013, United States","distance": 166.94,"geojson": {"features": [{"geometry": {"coordinates": [-73.99922, 40.72138000000001],"type": "Point"},"properties": { "naurt_type": "basic_geocode" },"type": "Feature"},{"geometry": {"coordinates": [[-73.999219187, 40.721393173]],"type": "MultiPoint"},"properties": {"accuracy": { "quality": "high" },"naurt_type": "naurt_door"},"type": "Feature"},{"geometry": {"coordinates": [[[-73.9994585, 40.721163399999995],[-73.9993536, 40.7212902],[-73.9992555, 40.72140870000001],[-73.9991687, 40.721371799999986],[-73.9993745, 40.721123199999994],[-73.9994585, 40.721163399999995]]],"type": "Polygon"},"properties": {"contributors": ["© OpenStreetMap contributors"],"naurt_type": "naurt_building"},"type": "Feature"},{"geometry": {"coordinates": [[[-73.9992242643674, 40.72149031437792],[-73.9992422998916, 40.72146635845769],[-73.99912433457862, 40.72141534524886],[-73.99910629905442, 40.72143930118742],[-73.9992242643674, 40.72149031437792]]],"type": "Polygon"},"properties": {"accuracy": { "quality": "high" },"minimum_parking_to_door_distance": 10.810100085541121,"naurt_type": "naurt_parking"},"type": "Feature"}],"type": "FeatureCollection"},"id": "d51b6ce3-5c2d-3cbe-9c11-01d2128e5e0b","search_confidence": 0.81}],"best_match": {"address": "489 Broome St, UNIT 493, New York, NY 10013, United States","distance": 399.75,"geojson": {"features": [{"geometry": {"coordinates": [-74.00273, 40.722939999999994],"type": "Point"},"properties": { "naurt_type": "basic_geocode" },"type": "Feature"},{"geometry": {"coordinates": [[-74.00263125, 40.723055293]],"type": "MultiPoint"},"properties": {"accuracy": { "quality": "high" },"naurt_type": "naurt_door"},"type": "Feature"},{"geometry": {"coordinates": [[[-74.00232824671696, 40.7229216919784],[-74.00296964289005, 40.72320437480329],[-74.00360140414838, 40.72238104624978],[-74.00339896348125, 40.72229182350918],[-74.00341761326008, 40.7222675184199],[-74.00297865775413, 40.7220740547682],[-74.00280964413335, 40.72229431995589],[-74.00280964413335, 40.72229431995589],[-74.00232824671696, 40.7229216919784]]],"type": "Polygon"},"properties": {"contributors": ["© OpenStreetMap contributors"],"naurt_type": "naurt_building"},"type": "Feature"},{"geometry": {"coordinates": [[[-74.00263337207797, 40.72314732814672],[-74.00265318758333, 40.72312419462199],[-74.00253926912725, 40.72306814815707],[-74.00251945362189, 40.7230912817013],[-74.00263337207797, 40.72314732814672]]],"type": "Polygon"},"properties": {"accuracy": { "quality": "high" },"minimum_parking_to_door_distance": 10.235403750728054,"naurt_type": "naurt_parking"},"type": "Feature"}],"type": "FeatureCollection"},"id": "b97a3492-7899-36b7-871d-8a849f0edf6c","search_confidence": 1.0},"status": "ok"}],"version": "v2.6.9-hf.1"}