# Halo Oglasi Autocomplete API Documentation

<p><strong>Halo Oglasi Autocomplete API</strong> resolves a place name to the location ids the search route needs. Each result has the <code>id</code>, the readable <code>label</code>, the full <code>path</code> such as <code>Beograd / Opština Zemun</code>, an ASCII spelling and the place <code>type</code>: <code>city</code>, <code>municipality</code> or <code>micro_location</code>. Pass the ids to the search route as <code>location_ids</code>.</p><p>Failed requests are not billed.</p>

- **Documentation:** [https://scrappa.co/docs/halooglasi-api/halooglasi_autocomplete](https://scrappa.co/docs/halooglasi-api/halooglasi_autocomplete)
- **API group:** Halo Oglasi API
- **Endpoint:** `GET https://scrappa.co/api/halooglasi/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, 2 to 100 characters. |
| `limit` | integer | No | Number of results, 1 to 50 (default 10). |

## Example response

```json
{
    "data": {
        "query": "novi sad",
        "results": [
            {
                "id": 35194,
                "city": "Novi Sad",
                "path": "Novi Sad",
                "type": "city",
                "ascii": "novi sad",
                "label": "Novi Sad"
            },
            {
                "id": 40758,
                "city": "Novi Sad",
                "path": "Novi Sad / Op\u0161tina Novi Sad",
                "type": "municipality",
                "ascii": "opstina novi sad",
                "label": "Op\u0161tina Novi Sad"
            },
            {
                "id": 538007,
                "city": "Beograd",
                "path": "Beograd / Op\u0161tina Zemun / Autoput za Novi Sad",
                "type": "micro_location",
                "ascii": "autoput za novi sad",
                "label": "Autoput za Novi Sad"
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter, a range or a combination is invalid. This response is not billable. |
| 503 | Upstream Unavailable | Halo Oglasi could not be reached or returned data 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)
