# LandSearch Autocomplete API Documentation

<p><strong>LandSearch Autocomplete API</strong> finds states, counties, cities and postal codes by name or postal code. Each suggestion carries the <code>slug</code> that the search and profiles routes take as <code>location</code>, its type and its parent place. Failed requests are not billed.</p>

- **Documentation:** [https://scrappa.co/docs/landsearch-api/landsearch_autocomplete](https://scrappa.co/docs/landsearch-api/landsearch_autocomplete)
- **API group:** LandSearch API
- **Endpoint:** `GET https://scrappa.co/api/landsearch/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 | Place name or postal code prefix, 2 to 100 characters. |
| `type` | string | No | Keep one kind of place: locality, subterritory (county), postal_code or territory (state). |
| `limit` | integer | No | Suggestions to return, 1 to 20. Default 10. |

## Example response

```json
{
    "data": {
        "count": 3,
        "items": [
            {
                "id": 233252,
                "name": "Austin",
                "slug": "austin-tx",
                "type": "locality",
                "label": null,
                "parent": {
                    "id": 1082,
                    "name": "Travis",
                    "slug": "travis-county-tx",
                    "type": "subterritory",
                    "label": "County"
                },
                "state_code": "TX"
            },
            {
                "id": 234407,
                "name": "Austin",
                "slug": "austin-mn",
                "type": "locality",
                "label": null,
                "parent": {
                    "id": 1604,
                    "name": "Mower",
                    "slug": "mower-county-mn",
                    "type": "subterritory",
                    "label": "County"
                },
                "state_code": "MN"
            },
            {
                "id": 258549,
                "name": "Austintown",
                "slug": "austintown-oh",
                "type": "locality",
                "label": null,
                "parent": {
                    "id": 443,
                    "name": "Mahoning",
                    "slug": "mahoning-county-oh",
                    "type": "subterritory",
                    "label": "County"
                },
                "state_code": "OH"
            }
        ],
        "query": "aust"
    },
    "meta": {
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing or invalid. This response is not billable. |
| 503 | Upstream Unavailable | LandSearch could not be reached. Retry shortly. This response is not billable. |

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