Place Geocode (Reverse Geocoding)
Get detailed place information from latitude and longitude coordinates. Returns place name, address, country, city, and more.
Endpoint
Get place details from latitude and longitude coordinates (reverse geocoding)
POSThttps://api.xtartapp.com/place/geocode
Additional Endpoints
*Authentication
You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.
Request body
Name | Type | Required | Max | Description |
---|---|---|---|---|
lat | number | Yes | - | Latitude coordinate of the place. |
lng | number | Yes | - | Longitude coordinate of the place. |
language | string | No | - | Optional preferred language for the result, example: 'en', 'fr', 'es' |
Response
Name | Type | Description |
---|---|---|
data | object | Place details object |
data.placeId | string | Unique identifier for the place (OSM ID) |
data.shortName | string | Short name of the place (main label) |
data.name | string | Full formatted name/address of the place |
data.lat | number | Latitude coordinate of the place |
data.lng | number | Longitude coordinate of the place |
data.country | string | Country where the place is located |
data.countryCode | string | Country code (ISO 2-letter) |
data.city | string | City name if available |
data.state | string | State/region name if available |
data.tags | string[] | Array of tags/categories describing the place |
metadata | object | Metadata about the request |
metadata.cost | number | Cost of the request |
Errors
{
"error": "string",
"code": "string"
}
HTTP Status | Error Code | Message |
---|---|---|
400 | INVALID_PAYLOAD | The lat parameter is required |
400 | INVALID_PAYLOAD | The lng parameter is required |
400 | INVALID_PAYLOAD | The lat parameter must be a number |
400 | INVALID_PAYLOAD | The lng parameter must be a number |
400 | INVALID_PAYLOAD | The language parameter must be a string |
400 | REQUEST_ERROR | The request failed |
400 | INSUFFICIENT_BALANCE | The user has insufficient balance |
401 | UNAUTHORIZED | The token is invalid. |
429 | TOO_MANY_REQUESTS | The request limit has been reached. |