Configuration
There are some optional configurations you can use to customise the response.
All configuration options can be specified under an options object in the
request body, as discussed in the introduction
POST https://api.naurt.net/final-destination/v2
Content-Type: application/json
Authorization: <API_KEY_HERE>
{
"queries": [RequestFormat],
"options": Option<Options>
}
Where the Options itself is
{
"structured_response": Optional<boolean>
}
Structured Response
Structured response will return the address in a parsed format as well as the
concatenated string. To make a request with this option, set structured_response
in the options object to true. For example, the request could be
{
"queries": [
{
"address_string": "99 Rue de Clignancourt, 75018 Paris"
}
],
"options": {
"structured_response": true
}
}
And the response would be (reply condensed for readability)
{
"request_id": "a193694f-490f-4990-9f94-61e9e1160362",
"responses": [
{
"additional_matches": [],
"best_match": {
"address": "99 Rue de Clignancourt, 75018 Paris 18e Arrondissement, France",
"geojson": {},
"id": "3eaab5ff-14c6-36c8-a61f-535598ee00e5",
"structured_response": {
"city": "Paris 18e Arrondissement",
"country": "France",
"postalcode": "75018",
"street_name": "Rue de Clignancourt",
"street_number": "99"
}
},
"status": "ok"
}
],
"version": "v2.1.0"
}
We can see the format of the structured response actually mirrors the format of the structured request, which is
{
"address_line": Option<String>,
"unit": Option<String>,
"house_name": Option<String>,
"street_number": Option<String>,
"street_name": Option<String>,
"city": Option<String>,
"county": Option<String>,
"state": Option<String>,
"country": Option<String>,
"postalcode": Option<String>
}
GeoJson Type
There are two styles in which Naurt can display geographic information. Naurt
will either use a GeoJson style (default) or a key-value style. You can read
more about this feature here. These can be set with the
geojson_type option. It has two values:
geo_json(default)key_value
These can set like so
{
"queries": [
{
"address_string": "99 Rue de Clignancourt, 75018 Paris"
}
],
"options": {
"geojson_type": "key_value"
}
}
Return original Request
It is possible to ask Naurt to return your original request back to you. You
can do this with the return_original option in the options. For example
{
"queries": [
{
"address_string": "Rua Joaquim Palhares, 585, Praca Da Bandeira - RJ, 20260-080, Brazil"
}
],
"options": {
"return_original": true,
}
}
will return (locations omitted for clarity)
{
"request_id": "48045248-4313-4963-b2aa-8968cf8faa90",
"responses": [
{
"additional_matches": [],
"best_match": {
"address": "Rua Joaquim Palhares, 585, apto. 202, Praca Da Bandeira - RJ, 20260-080, Brazil",
"geojson": {},
"id": "361426c9-632f-341d-96f6-de2d42b40b15"
},
"original_request": {
"additional_matches": false,
"address_string": "Rua Joaquim Palhares, 585, Praca Da Bandeira - RJ, 20260-080, Brazil"
},
"status": "ok"
}
],
"version": "v2.6.3"
}