# Homely Location Autocomplete API Documentation

Scrappa's `GET /api/homely/location-autocomplete` finds Australian suburbs by the start of a name or by a postcode.

## What you get

Each location has `id`, `name`, `state`, `postcode`, `slug` and `uri`. Pass `name` as `location` and `postcode` as `postcode` to the search endpoint. Several suburbs can share a name, so send the postcode too.

## Empty results

A text that matches nothing returns `200` with an empty `locations` list. That is a valid answer and it is billed. A `q` shorter than 2 characters answers `422` and is never sent to Homely.

- **Documentation:** [https://scrappa.co/docs/homely-api/homely_location_autocomplete](https://scrappa.co/docs/homely-api/homely_location_autocomplete)
- **API group:** Homely API
- **Endpoint:** `GET https://scrappa.co/api/homely/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 a suburb name or a postcode, at least 2 characters. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/homely/location-autocomplete?q=bondi"
```

## Example response

```json
{
    "success": true,
    "query": "bondi",
    "total": 1,
    "locations": [
        {
            "id": 5710720,
            "name": "Bondi",
            "state": "New South Wales",
            "postcode": "2026",
            "slug": "bondi-nsw-2026",
            "uri": "bondi-waverley-sydney-greater-new-south-wales",
            "type_code": 2
        }
    ],
    "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 are rejected, never ignored (`request_rejected` is the same failure raised by the source). Non-billable. |
| 503 | Source Unavailable | Homely could not be reached in time, refused the request, or its answer changed shape (`upstream_unavailable`, `request_blocked`, `deadline_exhausted`, `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)
