# realestateVIEW Location Autocomplete API Documentation

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

## What you get

Each location has `id`, `suburb`, `state`, `state_name`, `postcode`, `lga`, `region` and `display_text`. Pass `state`, `suburb` and `postcode` to the search endpoint. Several suburbs can share a name, so always send the postcode too.

## Only suburbs

Only suburbs are returned, because a search covers one suburb. Cities, streets and buildings in the source suggestions are left out.

## 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 nothing is looked up.

- **Documentation:** [https://scrappa.co/docs/realestateview-api/realestateview_location_autocomplete](https://scrappa.co/docs/realestateview-api/realestateview_location_autocomplete)
- **API group:** realestateVIEW API
- **Endpoint:** `GET https://scrappa.co/api/realestateview/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/realestateview/location-autocomplete?q=melbourne"
```

## Example response

```json
{
    "success": true,
    "query": "melbourne",
    "total": 1,
    "locations": [
        {
            "id": 2706,
            "suburb": "Melbourne",
            "state": "vic",
            "state_name": "Victoria",
            "postcode": "3000",
            "lga": "Melbourne Council",
            "region": "Melbourne",
            "display_text": "Melbourne, VIC 3000",
            "location_type": "suburb"
        }
    ],
    "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 | realestateVIEW 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)
