Platform
Get started

Casafari is the AI agent-native real estate data intelligence platform. The most complete property index in Europe: a deduplicated, cleaned property graph of residential and commercial property, for sale and for rent, in 16 countries.The most complete property index in Europe: a deduplicated, cleaned property graph.

How the graph is built

Existing Casafari API · API v1 · References

Get locations typeahead suggestions scoped by country code

POSThttps://api.casafari.com/v1/references/locations/typeahead
Static token4 parametersAPI v1

Send 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[]required
Country codes to scope the search. Supported: ES, PT.
ES PT
namestringrequired
The location name to search for.
2–100 characters
sizeinteger
The maximum number of suggestions to return. Default 30, maximum 100.
1–100default 30
langstring
Language to use for the location name in the response. One of: en, pt, es, de.
en pt es de
default "en"

Example request

Placeholders only: replace the token and the values with your own.

curl
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[]required
The typeahead suggestions.
5 properties
location_idintegerrequired
The location id.
namestringrequired
The location name.
matched_namestringrequired
The matched name of the location name.
at most 256 characters
administrative_levelstringrequired
The administrative level.
breadcrumbsobject[]required
Location breadcrumbs sorted from top to bottom.
2 properties
location_idintegerrequired
Location ID.
namestringrequired
The name of location.
Example from the API description
JSON
{
  "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)
detailstring
Description of the error encountered.

403 Forbidden

Type: object.

Show the response shape (1 fields)
detailstring
Description of the error encountered.

Tip: add .md to any URL to read it as Markdown.