# Hybel Location Autocomplete API Documentation

Scrappa's `GET /api/hybel/location-autocomplete` returns the Norwegian places the Hybel search accepts in `place`, matched by the start or any part of a name. Norwegian letters match their plain form, so `alesund` finds Ålesund.

## Districts

Add `include_districts=true` with a `q` that is exactly one place to get the district names of that place in `districts`. These are the values the search accepts in `district`. This costs one extra lookup and is cached for a day.

## Source

Places come from Hybel's public place list, cached for a day, so a plain autocomplete call makes no lookup.

- **Documentation:** [https://scrappa.co/docs/hybel-api/hybel_location_autocomplete](https://scrappa.co/docs/hybel-api/hybel_location_autocomplete)
- **API group:** Hybel API
- **Endpoint:** `GET https://scrappa.co/api/hybel/location-autocomplete`

## 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 |
| --- | --- | --- | --- |
| `q` | string | Yes | Start of a place name, at least 2 characters. |
| `include_districts` | boolean | No | true to add district names when q is exactly one place. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/hybel/location-autocomplete?q=ber"
```

## Example response

```json
{
    "success": true,
    "query": "ber",
    "total": 1,
    "locations": [
        {
            "name": "Bergen",
            "slug": "Bergen",
            "type": "place"
        }
    ],
    "meta": {
        "endpoint_family": "location_autocomplete",
        "billable": true,
        "source": "place_catalog",
        "attempts": 0
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown or unusable (`invalid_filter`). Unknown parameters and unknown list values are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | Hybel could not be reached, refused the request, answered with a page this API could not read, or its place list is not available (`upstream_unavailable`, `upstream_blocked`, `parser_drift`, `place_catalog_unavailable`). Retryable and never billed. Clients are never rate limited. |

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