# Immobilier Notaires Location Autocomplete API Documentation

Scrappa's `GET /api/notaires-immo/autocomplete` suggests places for the search filters.

## Kinds

- `locality` (default): a town or district with postal code. Send `id` as `locality` to search.
- `group`: a town with all its postal codes. Resolve it with `locality-group` first.
- `department`: a department. Send `id` as `department` to search.
- `reference`: the ad reference of a notary office. Send `id` as `reference` to search.

`use_as` tells where the id goes. Department suggestions need a department name, not a city name.

- **Documentation:** [https://scrappa.co/docs/notaires-immo-api/notaires_immo_autocomplete](https://scrappa.co/docs/notaires-immo-api/notaires_immo_autocomplete)
- **API group:** Immobilier Notaires API
- **Endpoint:** `GET https://scrappa.co/api/notaires-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 | Start of a place name, at least 2 characters. |
| `kind` | string | No | locality (default), group, department or reference. |
| `size` | integer | No | Number of suggestions, 1-50. Default 10. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/notaires-immo/autocomplete?q=lyon&kind=locality&size=3"
```

## Example response

```json
{
    "success": true,
    "query": "lyon",
    "kind": "locality",
    "suggestions": [
        {
            "kind": "locality",
            "id": "30407",
            "label": "LYON 3 (69003)",
            "label_en": "LYON 3 (69003)",
            "longitude": 4.849295,
            "latitude": 45.760198,
            "use_as": "locality"
        }
    ],
    "meta": {
        "endpoint_family": "location_autocomplete",
        "returned": 1,
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters are rejected with `unsupported_filter`, never ignored. There is no bathroom or new-build filter. Non-billable. |
| 503 | Upstream Unavailable | Immobilier Notaires could not be reached after retries, blocked the request, returned another page than asked for, or returned data this API could not read (`upstream_unavailable`, `upstream_blocked`, `page_mismatch`, `parser_drift`, `no_exit_available`). 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)
