# 591 Location Suggest API Documentation

<p><strong>591 Location Suggest API</strong> suggests districts, streets and communities for homes for sale. Each result has a type, an id, a name, region and district ids, the address of a community and the number of homes for sale (<code>sale_count</code>). The suggestions are for the sale side only; for rentals use the keywords filter of rent search and the locations route. Unofficial: Scrappa is not affiliated with 591. Chinese text stays as 591 returns it; numeric fields are parsed next to it, and a value 591 does not give is null, never 0. Failed requests are not billable.</p>

- **Documentation:** [https://scrappa.co/docs/591-api/house591_location_suggest](https://scrappa.co/docs/591-api/house591_location_suggest)
- **API group:** 591 House API
- **Endpoint:** `GET https://scrappa.co/api/591/locations/suggest`

## 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 | Search text, 1 to 30 characters. Example: 大安. |
| `region_id` | integer | Yes | Only suggestions in this city or county. Required. Get ids from /api/591/locations. |

## Example response

```json
{
    "data": {
        "query": "\u5927\u5b89",
        "results": [
            {
                "id": 5,
                "name": "\u5927\u5b89\u5340",
                "type": "section",
                "region": "\u53f0\u5317\u5e02",
                "address": null,
                "section": "\u5927\u5b89\u5340",
                "region_id": 1,
                "sale_count": 3103,
                "section_id": 5,
                "nearby_area": null
            },
            {
                "id": 25614,
                "name": "\u5927\u5b89\u8def\u4e00\u6bb5",
                "type": "street",
                "region": "\u53f0\u5317\u5e02",
                "address": null,
                "section": "\u5927\u5b89\u5340",
                "region_id": 1,
                "sale_count": 78,
                "section_id": 5,
                "nearby_area": null
            },
            {
                "id": 25615,
                "name": "\u5927\u5b89\u8def\u4e8c\u6bb5",
                "type": "street",
                "region": "\u53f0\u5317\u5e02",
                "address": null,
                "section": "\u5927\u5b89\u5340",
                "region_id": 1,
                "sale_count": 45,
                "section_id": 5,
                "nearby_area": null
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "location_suggest"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter is missing or a value or combination is not allowed. This response is not billable. |
| 503 | Upstream Unavailable | 591 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)
