# Rentals.ca Autocomplete API Documentation

<p><strong>Rentals.ca Autocomplete API</strong> resolves text to cities, neighbourhoods and buildings. City results carry a ready <code>location</code> value: pass it into the search route unchanged. Neighbourhood and building results have <code>location</code> set to <code>null</code> because the search does not work by neighbourhood or single building. Their <code>path</code> works with the listing route (buildings). A query with no match returns an empty list. Failed requests are not billed.</p>

- **Documentation:** [https://scrappa.co/docs/rentals-ca-api/rentals_ca_autocomplete](https://scrappa.co/docs/rentals-ca-api/rentals_ca_autocomplete)
- **API group:** Rentals.ca API
- **Endpoint:** `GET https://scrappa.co/api/rentals-ca/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: toron. |
| `limit` | integer | No | Number of results, 1 to 25 (default 10). |

## Example response

```json
{
    "data": {
        "query": "annex",
        "results": [
            {
                "url": "https://rentals.ca/toronto/annex",
                "city": "Toronto",
                "name": "Annex",
                "path": "toronto/annex",
                "type": "neighbourhood",
                "region": "ON",
                "location": null
            },
            {
                "url": "https://rentals.ca/sainte-anne-de-bellevue",
                "name": "Sainte-Anne-de-Bellevue",
                "path": "sainte-anne-de-bellevue",
                "type": "city",
                "region": "QC",
                "location": "sainte-anne-de-bellevue, qc, ca"
            },
            {
                "url": "https://rentals.ca/ste-anne",
                "name": "Ste Anne",
                "path": "ste-anne",
                "type": "city",
                "region": "MB",
                "location": "ste anne, mb, ca"
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter, a range or a value is invalid. This response is not billable. |
| 503 | Upstream Unavailable | Rentals.ca 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)
