# DDproperty Autocomplete API Documentation

<p><strong>DDproperty Autocomplete API</strong> turns a place or project name into codes for the search route. Each row has an id, a type (<code>region</code>, <code>district</code>, <code>area</code>, <code>property</code>, <code>station</code> or <code>subneighbourhood</code>), the name, a short description and a ready <code>search_params</code> object that you can pass into the search route. Stations and sub-neighbourhoods map to <code>keyword</code>. English and Thai queries work. A valid empty result is a successful, billable answer.</p>

- **Documentation:** [https://scrappa.co/docs/ddproperty-api/ddproperty_autocomplete](https://scrappa.co/docs/ddproperty-api/ddproperty_autocomplete)
- **API group:** DDproperty API
- **Endpoint:** `GET https://scrappa.co/api/ddproperty/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 | Search text, 2 to 100 characters. English or Thai. |
| `locale` | string | No | en (default) or th. The language of the names. |
| `limit` | integer | No | Number of results, 1 to 20 (default 10). |

## Example response

```json
{
    "data": {
        "query": "thonglor",
        "results": [
            {
                "id": "55",
                "name": "Thonglor Tower",
                "type": "property",
                "type_label": "Condo",
                "description": "Soi Thonglor, Sukhumvit 55 Road 10110, Khlongtoei Nua, Bangkok",
                "district_code": "TH1039",
                "search_params": {
                    "property_id": "55"
                }
            },
            {
                "id": "TH10",
                "name": "Bangkok",
                "type": "region",
                "type_label": "Province",
                "description": null,
                "district_code": null,
                "search_params": {
                    "region_code": "TH10"
                }
            },
            {
                "id": "TH1020",
                "name": "Bangkok Noi",
                "type": "district",
                "type_label": "District",
                "description": "Bangkok",
                "district_code": "TH1020",
                "search_params": {
                    "district_code": "TH1020"
                }
            },
            {
                "id": "TH102601",
                "name": "Din Daeng",
                "type": "area",
                "type_label": "Area",
                "description": "Din Daeng, Bangkok",
                "district_code": null,
                "search_params": {
                    "area_code": "TH102601"
                }
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | The query is missing or shorter than 2 characters, or locale is not en or th. This response is not billable. |
| 503 | Upstream Unavailable | DDproperty could not be reached or returned data that does not match the request. This response is not billable and is retryable. |

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