# Qasa Location Autocomplete API Documentation

Scrappa's `GET /api/qasa/location-autocomplete` finds the Qasa areas that `GET /api/qasa/search` accepts in `area`, from the start of a name.

## What you get

Up to ten areas with `name`, `parent` (the city of a district), `country_code`, `market` and `identifier`. Names match from the start, also of a later word, and ignore case and accents: `go` finds Göteborg.

## Coverage

The list holds the areas Qasa publishes for search: cities, municipalities, counties and Stockholm districts in Sweden, plus the main cities of Finland and Norway. It is refreshed daily.

- **Documentation:** [https://scrappa.co/docs/qasa-api/qasa_location_autocomplete](https://scrappa.co/docs/qasa-api/qasa_location_autocomplete)
- **API group:** Qasa API
- **Endpoint:** `GET https://scrappa.co/api/qasa/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 an area name, at least 2 characters. |
| `market` | string | No | sweden, finland or norway. Omit to search all three. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/qasa/location-autocomplete?q=g%C3%B6"
```

## Example response

```json
{
    "success": true,
    "query": "g\u00f6",
    "total": 1,
    "locations": [
        {
            "name": "G\u00f6teborg",
            "parent": null,
            "country_code": "SE",
            "market": "sweden",
            "identifier": "se/g\u00f6teborg"
        }
    ],
    "meta": {
        "endpoint_family": "location_autocomplete",
        "billable": true,
        "source": "cached_area_list"
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | Qasa could not be reached after retries, answered with an error, or its area list is not available (`upstream_unavailable`, `upstream_blocked`, `parser_drift`, `area_list_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)
