# Nepremicnine.net Location Autocomplete API Documentation

Scrappa's `GET /api/nepremicnine/location-autocomplete` finds Slovenian administrative units by name. Case and diacritics do not matter: `crnomelj` finds Črnomelj.

Add `unit_id` to match the settlements of that unit as well. Names that start with the query come first. Results carry a `unit_id` and `region_id` for the search endpoint.

- **Documentation:** [https://scrappa.co/docs/nepremicnine-api/nepremicnine_location_autocomplete](https://scrappa.co/docs/nepremicnine-api/nepremicnine_location_autocomplete)
- **API group:** Nepremicnine.net API
- **Endpoint:** `GET https://scrappa.co/api/nepremicnine/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 |
| --- | --- | --- | --- |
| `query` | string | Yes | Part of a place name, at least 2 characters. |
| `unit_id` | integer | No | Also match the settlements of this administrative unit. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/nepremicnine/location-autocomplete?query=ljubljana"
```

## Example response

```json
{
    "success": true,
    "query": "ljubljana",
    "total": 1,
    "locations": [
        {
            "type": "administrative_unit",
            "id": 204,
            "name": "Lj. Center",
            "unit_id": 204,
            "region_id": 14,
            "region": "LJ-mesto"
        }
    ],
    "meta": {
        "endpoint_family": "location_autocomplete",
        "billable": true,
        "source": "cached_lists"
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Unknown Id | The `unit_id` is not an administrative unit (`unknown_unit`). Non-billable. |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | Nepremicnine.net could not be reached after retries or answered with an error (`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)
