# BoligPortal Map Pins API Documentation

Scrappa's `GET /api/boligportal/map` returns the rental pins inside a bounding box: `id`, coordinates and the price label BoligPortal shows on the map.

## Bounding box

`min_lat`, `max_lat`, `min_lng` and `max_lng` are required. Use `id` with `listings` for the home details.

## Filters

All search filters except `order` and `page`. Pins carry no room or feature data, so they cannot be checked again: with a rooms filter `meta.count_exact` is false because BoligPortal rounds half rooms.

- **Documentation:** [https://scrappa.co/docs/boligportal-api/boligportal_map](https://scrappa.co/docs/boligportal-api/boligportal_map)
- **API group:** BoligPortal API
- **Endpoint:** `GET https://scrappa.co/api/boligportal/map`

## 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 |
| --- | --- | --- | --- |
| `location` | string | No | City such as København, Aarhus or Odense (not case sensitive). Unknown cities return 422 with suggestions. |
| `district` | string | No | District inside the city, for example valby or frederiksberg. |
| `area` | string | No | Neighbourhood inside the district. |
| `street` | string | No | Street name, for example Gammel Køge Landevej. |
| `type` | string | No | apartment, house, townhouse or room. Comma-separated. |
| `min_rooms` | number | No | Minimum number of rooms, halves allowed, for example 1.5. Applied exactly: the platform rounds, so results are checked again. |
| `max_rooms` | number | No | Maximum number of rooms, halves allowed. |
| `min_size` | integer | No | Minimum size in square metres. |
| `max_size` | integer | No | Maximum size in square metres. |
| `min_rent` | integer | No | Minimum monthly rent in DKK, without extra costs. |
| `max_rent` | integer | No | Maximum monthly rent in DKK, without extra costs. |
| `min_rental_period` | integer | No | Minimum rental period in months. |
| `available_before` | string | No | Latest move-in date, YYYY-MM-DD. |
| `min_lat` | number | Yes | South edge of a bounding box. Send all four box values or none. |
| `max_lat` | number | Yes | North edge of a bounding box. |
| `min_lng` | number | Yes | West edge of a bounding box. |
| `max_lng` | number | Yes | East edge of a bounding box. |
| `pet_friendly` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `furnished` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `balcony` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `parking` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `elevator` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `shareable` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `student_only` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `senior_friendly` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `social_housing` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `newbuild` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `electric_charging_station` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `dishwasher` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `washing_machine` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |
| `dryer` | boolean | No | true to require the feature. false or omitted applies no filter. Homes where the feature is unknown are left out. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/boligportal/map?min_lat=55.67&max_lat=55.69&min_lng=12.55&max_lng=12.6"
```

## Example response

```json
{
    "success": true,
    "returned": 1,
    "bbox": {
        "min_lat": 55.67,
        "max_lat": 55.69,
        "min_lng": 12.55,
        "max_lng": 12.6
    },
    "applied_filters": [],
    "pins": [
        {
            "id": 1936915,
            "type": "AD",
            "price_label": "5.500 kr",
            "lat": 55.671329,
            "lng": 12.562593
        }
    ],
    "meta": {
        "endpoint_family": "map",
        "count_exact": true,
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Unknown Location | The `location` is not a BoligPortal city (`unknown_location`). BoligPortal would answer an unknown city with zero results, so the request is rejected with up to five suggestions. Non-billable. |
| 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)
