# Get location by passed coordinates (v1)

> **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. Every property is one record with its full price and market history. [How the property graph is built](/docs/property-graph).

`GET https://api.casafari.com/api/v1/references/locations/by-coordinates`

[References](/docs/references) · [REST API](/docs/rest/references). Send `Authorization: Bearer $CASAFARI_TOKEN`; see [how to get a token](/docs/rest#get-a-token).

Over MCP: no tool does this. See [MCP and REST compared](/docs/parity#references).

## Description

Returns a location for the given coordinates with user restrictions.

## Query parameters

- `latitude` (number, required): The latitude coordinate. -90–90.
- `longitude` (number, required): The longitude coordinate. -180–180.
- `lang` (string, optional): 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.

```bash
curl "https://api.casafari.com/api/v1/references/locations/by-coordinates?latitude=<latitude>&longitude=<longitude>" \
  -H "Authorization: Bearer $CASAFARI_TOKEN"
```

## Responses

### 200 OK

Type: `object`.

- `location_id` (integer, required): ID of the location.
- `name` (string, required): Name of the location.
- `parent_id` (integer, required): ID of the parent level location.
- `administrative_level` (string, required): Location administrative level.
- `locations_structure` (object[], required): Information about all the parent locations, starting from the top-most level - country.
  - `location_id` (integer, required): Location ID, as returned by the POST /api/v1/references/locations endpoint.
  - `name` (string, required): Location name.
  - `administrative_level` (string, required): Location administrative level.
  - `zip_codes` (string[], optional): The location zip codes. default [].
  - `level` (integer, required): Location level as number.

Example from the API description (long arrays shortened):

```json
{
  "location_id": 1615,
  "name": "São Gonçalo de Lagos",
  "parent_id": 1611,
  "administrative_level": "Freguesia",
  "locations_structure": [
    {
      "location_id": 499,
      "name": "Portugal",
      "administrative_level": "País",
      "zip_codes": [],
      "level": 1
    },
    {
      "location_id": 1597,
      "name": "Faro",
      "administrative_level": "Distrito",
      "zip_codes": [],
      "level": 2
    }
  ]
}
```

### 401 Unauthorized

Type: `object`.

- `detail` (string, optional): Description of the error encountered.

### 403 Forbidden

Type: `object`.

- `detail` (string, optional): Description of the error encountered.

## Questions about this

- [How do I turn a place name into a location id?](/docs/faq/location-ids)
