Place Autocomplete

Get place autocomplete suggestions based on search query. Alternative to Google Places Autocomplete API. This API return place with geolocation coordinates.

Endpoint

Get place autocomplete suggestions based on search query

POSThttps://api.xtartapp.com/place/autocomplete

*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
querystringYes-The search query string to find places. Must be less than 100 characters.
countriesstring[]No-Optional array of country codes to limit the search to specific countries, example: ['US', 'CA', 'CI']
languagestringNo-Optional preferred language for the results, example: 'en', 'fr', 'es'
limitnumberNo-Optional maximum number of results to return, example: 10

Response

NameTypeDescription
dataarrayArray of place suggestions
data[].placeIdstringUnique identifier for the place
data[].typestringThe type of location (e.g. node, way, etc)
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[].tagsstring[]Array of tags/categories describing the place
metadataobjectMetadata about the request
metadata.costnumberCost of the request
metadata.countnumberNumber of results returned

Errors

{
   "error": "string",
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADThe query parameter is required
400INVALID_PAYLOADThe query parameter must be a string
400INVALID_PAYLOADThe query parameter must be less than 100 characters
400INVALID_PAYLOADThe country parameter must be an array
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.