# Imobiliare.ro Location Autocomplete API Documentation

Suggest locations for a search text, like the search box on Imobiliare.ro. Hits can be counties, cities, sectors, zones and streets. Each hit returns the location id for the location filter of the search endpoint, the type, the label, the parent locations and the number of listings.

- **Documentation:** [https://scrappa.co/docs/imobiliare-ro-api/imobiliare_ro_autocomplete](https://scrappa.co/docs/imobiliare-ro-api/imobiliare_ro_autocomplete)
- **API group:** Imobiliare.ro API
- **Endpoint:** `GET https://scrappa.co/api/imobiliare-ro/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 | Text to complete, 2 to 100 characters, e.g. cluj. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/imobiliare-ro/autocomplete?q=cluj"
```

## Example response

```json
{
    "success": true,
    "data": {
        "hits": [
            {
                "location_id": 11115,
                "type": "county",
                "label": "Jude\u021bul Cluj",
                "depth": 1,
                "id_tree": "11115",
                "has_children": true,
                "listings_count": 24996
            },
            {
                "location_id": 11335,
                "type": "city",
                "label": "Cluj-Napoca",
                "subtext": "Jude\u021bul Cluj",
                "depth": 2,
                "id_tree": "11115_11335",
                "parent_id": 11115,
                "has_children": true,
                "listings_count": 15176,
                "parents": [
                    {
                        "location_id": 11115,
                        "label": "Jude\u021bul Cluj",
                        "depth": 1
                    }
                ]
            }
        ]
    },
    "meta": {
        "endpoint_family": "autocomplete",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
|  | Error | The listing or profile does not exist. Not billed. |
|  | Error | Imobiliare.ro could not be reached right now. Not billed. |
|  | Error | Imobiliare.ro refused the request. Not billed. |
|  | Error | Imobiliare.ro returned an unexpected payload or a filter was not applied. Not billed. |

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