Existing Casafari API · API v1 · References
Get locations typeahead suggestions scoped by country code
https://api.casafari.com/v1/references/locations/typeaheadSend Authorization: Token $CASAFARI_TOKEN with your existing API token; see where to get it.
The same path under /api, signed in with a bearer token, is in the REST API reference: POST /api/v1/references/locations/typeahead.
Description
Returns location typeahead suggestions within the given country (ES or PT).
Request body
Content type application/json. Optional. Type: object.
country_codesstring[]requiredES PTnamestringrequiredsizeintegerlangstringen pt es deExample request
Placeholders only: replace the token and the values with your own.
curl -X POST "https://api.casafari.com/v1/references/locations/typeahead" \
-H "Authorization: Token $CASAFARI_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"country_codes": [
"PT"
],
"name": "lisboa",
"lang": "en",
"size": 30
}'Responses
200
Type: object.
Show the response shape (8 fields)
typeaheadobject[]required5 properties
location_idintegerrequirednamestringrequiredmatched_namestringrequiredadministrative_levelstringrequiredbreadcrumbsobject[]required2 properties
location_idintegerrequirednamestringrequiredExample from the API description
{
"typeahead": [
{
"location_id": 1296,
"name": "Lisboa",
"matched_name": "Lisboa",
"administrative_level": "Distrito",
"breadcrumbs": [
{
"location_id": 499,
"name": "Portugal"
},
{
"location_id": 1296,
"name": "Lisboa"
}
]
}
]
}401 Unauthorized
Type: object.
Show the response shape (1 fields)
detailstring403 Forbidden
Type: object.
Show the response shape (1 fields)
detailstring