# Logic-Immo Autocomplete API Documentation

<p><strong>Logic-Immo Autocomplete API</strong> turns a city name into place ids. Every candidate is returned with its <code>id</code> (the <code>place_id</code> for search), label, level, postal codes, coordinates and parents. The API never picks one for you: <code>Gironde</code> returns towns that end in <em>-sur-Gironde</em>, and a postal code returns the matching city first. Cities and towns are covered. Departments, regions, streets and neighborhoods return an empty list, which is a valid, billed answer.</p>

- **Documentation:** [https://scrappa.co/docs/logic-immo-api/logic_immo_autocomplete](https://scrappa.co/docs/logic-immo-api/logic_immo_autocomplete)
- **API group:** Logic-Immo API
- **Endpoint:** `GET https://scrappa.co/api/logic-immo/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 | City name or postal code, 2 to 100 characters. Example: lyon. |
| `limit` | integer | No | Number of candidates, 1 to 20, default 10. |

## Example response

```json
{
    "data": {
        "count": 6,
        "query": "lyon",
        "results": [
            {
                "id": "AD08FR28808",
                "label": "Lyon (69)",
                "labels": [
                    "Lyon (69)"
                ],
                "parents": [],
                "type_key": "AD08",
                "coordinates": {
                    "latitude": 45.7549164389887,
                    "longitude": 4.836341894211525
                },
                "postal_codes": [
                    "69000",
                    "69001"
                ]
            },
            {
                "id": "AD08FR10263",
                "label": "Lyons-la-For\u00eat (27480)",
                "labels": [
                    "Lyons-la-For\u00eat (27480)"
                ],
                "parents": [],
                "type_key": "AD08",
                "coordinates": {
                    "latitude": 49.3940045119265,
                    "longitude": 1.47312861430222
                },
                "postal_codes": [
                    "27480"
                ]
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | The text is missing, shorter than 2 characters, or the limit is out of range. This response is not billable. |
| 503 | Upstream Unavailable | Logic-Immo could not be reached, or returned data that does not match the expected shape. Retry shortly. This response is not billable. |

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