# Ouest-France Immo Location Autocomplete API Documentation

Resolve free text into places: departments, cities, boroughs, neighbourhoods and localities. Results are ordered by number of listings. Each place returns its id (use it as place_id in /search), name, type, postal code, INSEE code, coordinates, population, listing count and parent places. A query without a match is a successful response with an empty list.

- **Documentation:** [https://scrappa.co/docs/ouestfrance-immo-api/ouestfrance_immo_autocomplete](https://scrappa.co/docs/ouestfrance-immo-api/ouestfrance_immo_autocomplete)
- **API group:** Ouest-France Immo API
- **Endpoint:** `GET https://scrappa.co/api/ouestfrance-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 |
| --- | --- | --- | --- |
| `query` | string | Yes | Free text, 2 to 80 characters. Example: nant. |
| `type` | string | No | Comma list of department, city, borough, neighbourhood, locality. Defaults to all. |
| `limit` | integer | No | Suggestions to return, 1 to 30. Defaults to 10. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/ouestfrance-immo/autocomplete?query=nant&limit=5"
```

## Example response

```json
{
    "success": true,
    "data": {
        "query": "nant",
        "items": [
            {
                "id": 18998,
                "name": "Nantes",
                "type": "Villes",
                "slug": "nantes-44-44000",
                "postal_code": "44000",
                "insee_code": "44109",
                "department": "44",
                "latitude": 47.216796875,
                "longitude": -1.5567270517349243,
                "population": 282047,
                "listing_count": 7593,
                "parents": [
                    {
                        "id": 544,
                        "name": "Loire-Atlantique",
                        "type": "Departements"
                    },
                    {
                        "id": 415,
                        "name": "Pays de la Loire",
                        "type": "Regions"
                    }
                ]
            }
        ],
        "total_results": 61
    },
    "meta": {
        "endpoint_family": "autocomplete",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A public parameter is missing or invalid. No upstream call is made and the response is not billable. |
| 502 | Unexpected Upstream Response | Ouest-France Immo answered with a body that is not the documented shape. The response is not billable. |
| 503 | Upstream Unavailable | Ouest-France Immo was temporarily unavailable or blocked the request. The response is not billable and the request never answers 429. |

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