# Vuokraovi Location Autocomplete API Documentation

Scrappa's `GET /api/vuokraovi/location-autocomplete` finds the cities, districts, subdistricts, municipalities, post codes and streets that `GET /api/vuokraovi/search` accepts, from the start of a name.

## What you get

Each location has `code`, `type`, `name`, `full_name`, the parent region and municipality, `country_code`, `latitude`, `longitude` and `search_params`. Pass `search_params` to the search endpoint as they are.

## Notes

The same name can exist in several regions: `Kallio` is a district in four of them. Tell them apart with `code` and `parent_region_code`. Names may be Swedish, for example `Helsingfors`. One call returns up to 100 locations. Use `type` to narrow the result.

- **Documentation:** [https://scrappa.co/docs/vuokraovi-api/vuokraovi_location_autocomplete](https://scrappa.co/docs/vuokraovi-api/vuokraovi_location_autocomplete)
- **API group:** Vuokraovi API
- **Endpoint:** `GET https://scrappa.co/api/vuokraovi/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. |
| `type` | string | No | CITY, DISTRICT, SUBDISTRICT, MUNICIPALITY, POST_CODE or STREET. Omit for all types. |
| `page` | integer | No | Result page, 1-based. |

## Example request

```bash
#!/bin/bash

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

## Example response

```json
{
    "success": true,
    "query": "Tampere",
    "page": 1,
    "total": 1,
    "locations": [
        {
            "code": "FI_PIRKANMAA_TAMPERE",
            "type": "CITY",
            "name": "Tampere",
            "full_name": "Tampere",
            "parent_region_code": "FI_PIRKANMAA",
            "parent_region_name": "Pirkanmaa",
            "country_code": "FI",
            "latitude": 61.498336,
            "longitude": 23.769304,
            "search_params": {
                "location_code": "FI_PIRKANMAA_TAMPERE",
                "location_type": "CITY",
                "parent_region_code": "FI_PIRKANMAA"
            }
        }
    ],
    "meta": {
        "endpoint_family": "location_autocomplete",
        "billable": true,
        "attempts": 1
    }
}
```

## Errors

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