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

POSThttps://api.casafari.com/v1/references/locations
Static token6 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.

Description

Returns a list of all possible locations with user restrictions.

Request body

Content type application/json. Optional. Type: object.

namestring
Location name to search.
coordinatesobject[]
Limit search to locations within a closed polygon. First and last points must match.
at least 4 items
2 properties
latitudenumberrequired
Latitude.
-90–90
longitudenumberrequired
Longitude.
-180–180
zip_codesstring[]
List of zip codes to filter by.
at most 15 items
langstring
Language to use for the location names in the response. (When the provided language is not supported, the results will be returned in English.)

Example request

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

curl
curl -X POST "https://api.casafari.com/v1/references/locations" \
  -H "Authorization: Token $CASAFARI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "ferreiras",
  "coordinates": [
    {
      "longitude": -8.183479,
      "latitude": 37.1404
    },
    {
      "longitude": -8.18482,
      "latitude": 37.13909
    },
    {
      "longitude": -8.1854,
      "latitude": 37.13805
    },
    {
      "longitude": -8.21646,
      "latitude": 37.11383
    },
    {
      "longitude": -8.183479,
      "latitude": 37.1404
    }
  ],
  "lang": "pt"
}'

Responses

200

Type: object.

Show the response shape (11 fields)
locationsobject[]required
List of location objects.
5 properties
location_idintegerrequired
ID of the location.
namestringrequired
Name of the location.
parent_idintegerrequired
ID of the parent level location.
administrative_levelstringrequired
Location administrative level.
locations_structureobject[]required
Information about all the parent locations, starting from the top-most level - country.
5 properties
location_idintegerrequired
Location ID, as returned by the POST /v1/references/locations endpoint.
namestringrequired
Location name.
administrative_levelstringrequired
Location administrative level.
zip_codesstring[]
The location zip codes.
default []
levelintegerrequired
Location level as number.
Example from the API description (long arrays shortened)
JSON
{
  "locations": [
    {
      "location_id": 1603,
      "name": "Ferreiras",
      "parent_id": 1602,
      "administrative_level": "Freguesia",
      "locations_structure": [
        {
          "location_id": 499,
          "name": "Portugal",
          "administrative_level": "País",
          "zip_codes": [
            "1200-224"
          ],
          "level": 1
        },
        {
          "location_id": 1597,
          "name": "Faro",
          "administrative_level": "Distrito",
          "zip_codes": [],
          "level": 2
        }
      ]
    }
  ]
}

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.