# Bproperty Location Autocomplete API Documentation

Scrappa's `GET /api/bproperty/location-autocomplete` finds the areas of Bangladesh that the search accepts. It matches the area name and the city name, so `Dhaka` returns areas of Dhaka.

## What you get

Each result has `id`, `name`, `city_id`, `city`, `full_name` and `search_params`. Pass `search_params` to the search endpoint, for example `area=246ziqnc7ab5cq0`. Names that are not places, such as a whole advertisement typed as a name, are left out.

## Notes

`q` needs at least 2 characters. `limit` is 1 to 30 (default 10). An unknown name returns an empty list.

- **Documentation:** [https://scrappa.co/docs/bproperty-api/bproperty_location_autocomplete](https://scrappa.co/docs/bproperty-api/bproperty_location_autocomplete)
- **API group:** Bproperty API
- **Endpoint:** `GET https://scrappa.co/api/bproperty/location-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 an area or city name, at least 2 characters. |
| `limit` | integer | No | Results, 1 to 30. Default 10. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/bproperty/location-autocomplete?q=Dhan&limit=10"
```

## Example response

```json
{
    "success": true,
    "query": "Dhan",
    "total": 1,
    "locations": [
        {
            "id": "246ziqnc7ab5cq0",
            "name": "Dhanmondi",
            "city_id": "eyz5vhrduc9tsk0",
            "city": "Dhaka",
            "full_name": "Dhanmondi, Dhaka",
            "search_params": {
                "area": "246ziqnc7ab5cq0"
            }
        }
    ],
    "meta": {
        "endpoint_family": "location_autocomplete",
        "billable": true,
        "attempts": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters and unknown values are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | Bproperty could not be reached after one retry, answered with an error or changed its format (`upstream_unavailable`, `upstream_blocked`, `parser_drift`). 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)
