# BoligPortal Address Autocomplete API Documentation

Scrappa's `GET /api/boligportal/address-autocomplete` returns Danish address suggestions as BoligPortal offers them when a landlord types an address.

## Suggestion types

`type` is `adresse` (a full address), `adgangsadresse` (a building entrance) or `vejnavn` (a street). Pass a suggestion `id` as `container` to expand it.

## City search

BoligPortal has no city autocomplete. The `location` filter of search takes the city name directly, and an unknown city returns suggestions.

- **Documentation:** [https://scrappa.co/docs/boligportal-api/boligportal_address_autocomplete](https://scrappa.co/docs/boligportal-api/boligportal_address_autocomplete)
- **API group:** BoligPortal API
- **Endpoint:** `GET https://scrappa.co/api/boligportal/address-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 an address or street, at least 2 characters. |
| `container` | string | No | Suggestion id to expand into its addresses. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/boligportal/address-autocomplete?q=Vestergade+1"
```

## Example response

```json
{
    "success": true,
    "returned": 1,
    "suggestions": [
        {
            "id": "0a3f5083-17a9-32b8-e044-0003ba298018",
            "access_address_id": "0a3f5083-17a9-32b8-e044-0003ba298018",
            "type": "adgangsadresse",
            "address": "Vestergade 1B, 4690 Haslev"
        }
    ],
    "meta": {
        "endpoint_family": "address_autocomplete",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters are rejected, never ignored. Sale, bathroom and agency filters do not exist. Non-billable. |
| 503 | Upstream Unavailable | BoligPortal could not be reached after retries, blocked the request, returned another page than asked for, or returned a page this API could not read (`upstream_unavailable`, `upstream_blocked`, `offset_mismatch`, `parser_drift`, `transport_unavailable`, `no_exit_available`). 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)
