# Apartment List Location Autocomplete API Documentation

Scrappa's `GET /api/apartmentlist/location-autocomplete` finds the cities, neighborhoods and ZIP codes that `GET /api/apartmentlist/search` accepts in `location_id`.

## What you get

For each match: `id`, `slug`, `type` (`city`, `neighborhood` or `zip_code`), `name`, `display_name`, `long_name`, `coordinates`, `bounds`, `population`, `county_id` and `metro_id`.

## Matching

`q` takes the start of a place name (`aust`) or a ZIP code (`78701`), at least 2 characters. `types` narrows the result to `city`, `neighborhood` or `zip_code`; the default is all three. A query with no match returns `success: true` and an empty `locations` list.

## Coverage

United States only.

- **Documentation:** [https://scrappa.co/docs/apartmentlist-api/apartmentlist_location_autocomplete](https://scrappa.co/docs/apartmentlist-api/apartmentlist_location_autocomplete)
- **API group:** Apartment List API
- **Endpoint:** `GET https://scrappa.co/api/apartmentlist/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 place name or a ZIP code, 2-80 characters. |
| `types` | string | No | city, neighborhood or zip_code. Comma-separated. Default all three. |

## Example request

```bash
#!/bin/bash

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

## Example response

```json
{
    "success": true,
    "query": "aust",
    "total": 1,
    "locations": [
        {
            "id": 642592,
            "slug": "/tx/austin",
            "type": "city",
            "name": "Austin",
            "display_name": "Austin, TX",
            "long_name": "Austin, Texas",
            "coordinates": {
                "lat": 30.3037,
                "lon": -97.7545
            },
            "bounds": {
                "ne": {
                    "lat": 30.516863,
                    "lon": -97.561489
                },
                "sw": {
                    "lat": 30.09868,
                    "lon": -97.938383
                }
            },
            "population": 790390,
            "county_id": 710949,
            "metro_id": 747301
        }
    ],
    "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 | Apartment List could not be reached in time, answered with an error, or its page layout changed (`upstream_unavailable`, `upstream_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)
