# Otodom Locations API Documentation

Scrappa's `GET /api/otodom/locations` endpoint resolves a Polish place name into the geo paths that the Otodom search endpoint consumes.

## What the response contains

Each match carries `id`, `name`, `full_name` and `detailed_level`. The `id` is the complete geo path — no slug synthesis is required on your side.

## Choosing a match

The upstream operation is not prefix-scoped: a `zoliborz` query also returns villages in unrelated voivodeships. Use `detailed_level` to pick the granularity you want rather than taking the first result.

## Related Otodom endpoints

- `GET /api/otodom/search` — pass the `id` here as `geo_path`

- **Documentation:** [https://scrappa.co/docs/otodom-api/otodom_locations](https://scrappa.co/docs/otodom-api/otodom_locations)
- **API group:** Otodom API
- **Endpoint:** `GET https://scrappa.co/api/otodom/locations`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | Place name to resolve. Polish diacritics are supported. |
| `limit` | integer | No | Maximum matches to return, up to 50. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/otodom/locations?query=warszawa&limit=3"
```

## Example response

```json
{
    "success": true,
    "data": {
        "locations": [
            {
                "id": "mazowieckie/warszawa/warszawa/warszawa",
                "name": "Warszawa",
                "full_name": "Warszawa, mazowieckie",
                "detailed_level": "city"
            },
            {
                "id": "mazowieckie/warszawa/warszawa/warszawa/zoliborz",
                "name": "\u017boliborz",
                "full_name": "\u017boliborz, Warszawa, mazowieckie",
                "detailed_level": "district"
            }
        ],
        "query": "warszawa"
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
|  | Error | The query returned no usable location matches. |
|  | Error | Otodom could not be reached. This response is not billed. |

## Frequently asked questions

### Do I need to build the geo path myself?

No. The `id` of each match is the complete geo path.

### Why did I get matches from another region?

The upstream operation is not prefix-scoped. Filter on `detailed_level` and pick the match you want.

### Does this cost a credit?

Only successful responses are billed.

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
