# Housing.com Location Autocomplete API Documentation

<p><strong>Housing.com Location Autocomplete API</strong> Find places in one city by a search text. Each result has a name, a type (locality, sublocality, project, landmark and more) and a canonical path. A result with usable_in_search=true is a locality or a city: send its canonical as the canonical parameter of the search endpoint. Projects, landmarks and developers are listed for reference and cannot be searched as a place.</p>

- **Documentation:** [https://scrappa.co/docs/housing-com-api/housing_com_autocomplete](https://scrappa.co/docs/housing-com-api/housing_com_autocomplete)
- **API group:** Housing.com API
- **Endpoint:** `GET https://scrappa.co/api/housing-com/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. Example: powai. |
| `city` | string | Yes | City name or id from the cities endpoint, e.g. Mumbai. |
| `limit` | integer | No | Rows to return, 1 to 10. Default 5. |

## Example response

```json
{
    "data": {
        "city": "Mumbai",
        "query": "hiranandani",
        "results": [
            {
                "id": "88c9815b61cdc7711a33",
                "url": "https://housing.com/in/buy/thane/hiranandani-estate-gid/",
                "name": "Hiranandani Estate, Thane",
                "type": "locality",
                "canonical": "/in/buy/thane/hiranandani-estate-gid/",
                "unique_id": "buy-6912",
                "display_type": "Locality",
                "usable_in_search": true
            },
            {
                "id": "d01c3d3af7fef6df4f0c",
                "url": "https://housing.com/in/buy/mumbai/hiranandani-gardens-powai-gid/",
                "name": "Hiranandani Gardens, Powai, Mumbai",
                "type": "sublocality",
                "canonical": "/in/buy/mumbai/hiranandani-gardens-powai-gid/",
                "unique_id": "buy-7764",
                "display_type": "Locality",
                "usable_in_search": true
            },
            {
                "id": "9e8af4096997cf6eb6ba",
                "url": "https://housing.com/in/buy/thane/hiranandani-rodas-enclave-hiranandani-estate-gid/",
                "name": "Hiranandani Rodas Enclave, Hiranandani Estate, Thane",
                "type": "sublocality",
                "canonical": "/in/buy/thane/hiranandani-rodas-enclave-hiranandani-estate-gid/",
                "unique_id": "buy-25680",
                "display_type": "Locality",
                "usable_in_search": true
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter is missing or invalid. This response is not billable. |
| 404 | Not Found | The city is not in the Housing.com city list. This response is not billable. |
| 503 | Temporarily Unavailable | Housing.com did not answer or refused the request after several attempts. This response is not billable. Retry after a short pause. |

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