# SS.lv Autocomplete API Documentation

<p><strong>SS.lv Autocomplete API</strong>: Matches regions, Riga and Riga region districts and premises or other sub-categories, and returns the slug to use in search. SS.lv has no autocomplete of its own, so the answer comes from a fixed list and makes no upstream lookup. This route is free.</p>

- **Documentation:** [https://scrappa.co/docs/ss-lv-api/ss_lv_autocomplete](https://scrappa.co/docs/ss-lv-api/ss_lv_autocomplete)
- **API group:** SS.lv API
- **Endpoint:** `GET https://scrappa.co/api/ss-lv/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 |
| --- | --- | --- | --- |
| `query` | string | Yes | Search text, 1 to 100 characters. Ignores case and Latvian diacritics. |
| `type` | string | No | Optional: region, district or sub_category. |
| `limit` | integer | No | Number of results, 1 to 50 (default 10). |

## Example response

```json
{
    "data": {
        "query": "riga",
        "results": [
            {
                "name": "R\u012bga",
                "slug": "riga",
                "type": "region",
                "region": "riga",
                "category": null,
                "district": null,
                "sub_category": null
            },
            {
                "name": "R\u012bgas rajons",
                "slug": "riga-region",
                "type": "region",
                "region": "riga-region",
                "category": null,
                "district": null,
                "sub_category": null
            },
            {
                "name": "Vecr\u012bga",
                "slug": "vecriga",
                "type": "district",
                "region": "riga",
                "category": null,
                "district": "vecriga",
                "sub_category": null
            }
        ]
    },
    "meta": {
        "billable": false,
        "endpoint_family": "autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing, unknown or not supported, or the location has no list. This response is not billable. |
| 503 | Upstream Unavailable | SS.lv could not be reached or returned a page that does not match the request. This response is not billable and is retryable. |

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