# Bien'ici Locations

Location typeahead across cities, delegated cities, departments, postal codes, and regions. Each result carries the zone ids, INSEE code, and postal codes a scoped search consumes. This is a separately billed call: search never resolves free text for you.

- **Documentation:** [https://scrappa.co/docs/bienici-api/bienici_locations](https://scrappa.co/docs/bienici-api/bienici_locations)
- **API group:** Bien'ici API
- **Endpoint:** `GET https://scrappa.co/api/bienici/locations`

## 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 | Place name to resolve, for example Lyon. |
| `type` | string | No | Comma-separated place types to match. Defaults to city,delegated-city,department,postalCode,region. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/bienici/locations?query=Lyon"
```

## Example response

```json
{
    "success": true,
    "data": {
        "results": [
            {
                "name": "Lyon",
                "type": "city",
                "insee_code": "69123",
                "zoneIds": [
                    "-120965"
                ],
                "postalCodes": [
                    "69000"
                ]
            }
        ],
        "resultCount": 1
    },
    "meta": {
        "endpoint_family": "locations"
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The requested house was not found. This response is not billable. |
| 422 | Validation Error | A public parameter is invalid. This response is not billable. |
| 503 | Service Unavailable | The service could not obtain a complete result. 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)
