# Hemnet Location Autocomplete API

Resolve a Swedish place name to the Hemnet location ids that `/api/hemnet/search` accepts. Returns the location id, its full name, its parent region and its type — Stockholm returns municipality 18031, Malmö returns 17989.

- **Documentation:** [https://scrappa.co/docs/hemnet-api/hemnet_locations](https://scrappa.co/docs/hemnet-api/hemnet_locations)
- **API group:** Hemnet API
- **Endpoint:** `GET https://scrappa.co/api/hemnet/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, e.g. Malmo |
| `limit` | integer | No | Maximum suggestions (default 10) |
| `types` | string | No | Comma-separated location types, e.g. MUNICIPALITY,CITY |

## Example request

```bash
#!/bin/bash

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

## Example response

```json
{
    "success": true,
    "data": {
        "count": 1,
        "locations": [
            {
                "id": "17989",
                "full_name": "Malm\u00f6 kommun",
                "type": "MUNICIPALITY"
            }
        ]
    }
}
```

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