Geocoder¶
API path: /geocoder
.
Geocoder types¶
- google.
- yandex.
- progorod.
- osm.
- locationiq.
API actions¶
search_address¶
Performs a forward geocoding. Returns a list of locations matching the given address. Items in the list sorted by relevance.
parameters¶
name | description | type | format |
---|---|---|---|
q | Address (or place) or coordinates to geocode. | string/location | "750 Avenue E,San Francisco,CA 94130,USA./60.0, 61.0" |
lang | Language in which results should be. | string (enum) | "en" |
geocoder | Optional. Geocoder type that will be preferably used for searching. | string (enum) | "google" |
bounds | Optional. JSON object. The bounding box, specified by coordinates of northwest and southeast corners. Geocoder will preferably return results from within these bounds. That is the parameter influences the priority of results, so if more relevant results exist outside of bounds, they may be included. | bounds_object | {"nw":{"lat":60.0,"lng":61.0},"se":{"lat":55.0,"lng":60.0}} |
lang | Optional. ISO 639 language code. | locale | "en_US" |
with_details | Optional. If true then the response will contain details. | boolean | true |
examples¶
curl -X POST 'https://api.navixy.com/v2/fsm/geocoder/search_address' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "q": "750 Avenue E,San Francisco,CA 94130,USA", "lang": "en", "geocoder": "google"}'
response¶
{
"success": true,
"locations": [{
"lat": 56.26697,
"lng": 19.55436,
"address": "750 Avenue E,San Francisco",
"details": {
"country": "USA",
"province": "CA",
"locality": "San Francisco",
"street": "Avenue E",
"house": "750",
"postcode": "94130",
"bounds": {
"nw":{
"lat": 62.23621,
"lng": 58.56997
},
"se":{
"lat": 31.98753,
"lng": 42.23694
}
}
}
}]
}
lat
- double. Latitude.lng
- double. Longitude.address
- string. Address.details
- details object.country
- optional string.province
- optional string.locality
- optional string.street
- optional string.house
- optional string.postcode
- optional string.bounds
- optional object, the bounding box which can fully contain the returned result.nw
- North West corner.se
- South East corner.
search_location¶
Search address by location using geocoder.
parameters¶
name | description | type | format |
---|---|---|---|
location | Location coordinates (see: data types description section section). | location | {"lat": , "lng": } |
geocoder | Optional. Geocoder type that will be preferably used for searching. | string (enum) | "google" |
lang | Optional. ISO 639 language code. | locale | "en_US" |
with_details | Optional. If true then the response will contain details. | boolean | true |
goal | Helps to choose the target geocoder. Now supported ui , ui_user_action . Use ui_user_action for requests initiated by user, otherwise ui . | string (enum) | "ui" |
examples¶
curl -X POST 'https://api.navixy.com/v2/fsm/geocoder/search_location' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "location": "{"lat": 56.827001, "lng": 60.594296}}'
response¶
{
"success": true,
"value": "750 Avenue E,San Francisco,CA 94130,USA",
"details": {
"country": "USA",
"province": "CA",
"locality": "San Francisco",
"street": "Avenue E",
"house": "750",
"postcode": "94130",
"bounds": {
"nw":{
"lat": 62.23621,
"lng": 58.56997
},
"se":{
"lat": 31.98753,
"lng": 42.23694
}
}
}
}
value
- string. Address.details
- optional details object.country
- optional string.province
- optional string.locality
- optional string.street
- optional string.house
- optional string.postcode
- optional string.bounds
- optional object, the bounding box which can fully contain the returned result.nw
- North West corner.se
- South East corner.
Last update: October 1, 2020