# tutti.ch Locations API Documentation

Search Swiss places, cantons and districts by name and get the locality id for the locality filter of the search endpoint. The type is city, canton, district or region. A search without matches is a successful, empty list.

- **Documentation:** [https://scrappa.co/docs/tutti-api/tutti_locations](https://scrappa.co/docs/tutti-api/tutti_locations)
- **API group:** tutti.ch API
- **Endpoint:** `GET https://scrappa.co/api/tutti/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 |
| --- | --- | --- | --- |
| `search` | string | Yes | Place name, 2 to 100 characters. Example: Zürich. |
| `language` | string | No | Label language: de (default), fr or it. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/tutti/locations?search=Z%C3%BCrich"
```

## Example response

```json
{
    "success": true,
    "data": {
        "locations": [
            {
                "id": "geo-city-zurich",
                "name": "Z\u00fcrich",
                "type": "city"
            },
            {
                "id": "geo-canton-zurich",
                "name": "Z\u00fcrich",
                "type": "canton"
            },
            {
                "id": "geo-cityregion-kreis-1",
                "name": "Z\u00fcrich Kreis 1",
                "type": "district"
            }
        ]
    },
    "meta": {
        "endpoint_family": "locations",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | The search is missing or shorter than 2 characters. This response is not billable. |
| 502 | Unexpected Upstream Response | tutti.ch answered with an error or an unexpected shape. This response is not billable; retry later. |
| 503 | Upstream Unavailable | tutti.ch is temporarily unreachable or blocked the request. This response is not billable; retry later. |

## 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)
