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

*Authentication

You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.

Request body

NameTypeRequiredMaxDescription
latnumberYes-Latitude coordinate of the place.
lngnumberYes-Longitude coordinate of the place.
languagestringNo-Optional preferred language for the result, example: 'en', 'fr', 'es'

Response

NameTypeDescription
dataobjectPlace details object
data.placeIdstringUnique identifier for the place (OSM ID)
data.shortNamestringShort name of the place (main label)
data.namestringFull formatted name/address of the place
data.latnumberLatitude coordinate of the place
data.lngnumberLongitude coordinate of the place
data.countrystringCountry where the place is located
data.countryCodestringCountry code (ISO 2-letter)
data.citystringCity name if available
data.statestringState/region name if available
data.tagsstring[]Array of tags/categories describing the place
metadataobjectMetadata about the request
metadata.costnumberCost of the request

Errors

{
   "error": "string",
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADThe lat parameter is required
400INVALID_PAYLOADThe lng parameter is required
400INVALID_PAYLOADThe lat parameter must be a number
400INVALID_PAYLOADThe lng parameter must be a number
400INVALID_PAYLOADThe language parameter must be a string
400REQUEST_ERRORThe request failed
400INSUFFICIENT_BALANCEThe user has insufficient balance
401UNAUTHORIZEDThe token is invalid.
429TOO_MANY_REQUESTSThe request limit has been reached.