# at home Autocomplete API Documentation

<p><strong>at home Autocomplete API Documentation</strong> Find cities or stations by a part of their Japanese name. Each suggestion has the name, the site code and the roman value. Use the roman value as the city parameter of the search routes.</p>

- **Documentation:** [https://scrappa.co/docs/athome-jp-api/athome_jp_autocomplete](https://scrappa.co/docs/athome-jp-api/athome_jp_autocomplete)
- **API group:** at home Japan API
- **Endpoint:** `GET https://scrappa.co/api/athome-jp/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 |
| --- | --- | --- | --- |
| `keyword` | string | Yes | Part of a city or station name in Japanese, for example 新宿. |
| `type` | string | No | city (default) or station. |
| `prefecture` | string | No | Limit the suggestions to one prefecture, for example tokyo. |

## Example response

```json
{
    "data": {
        "suggestions": [
            {
                "code": "13104",
                "name": "\u65b0\u5bbf\u533a",
                "type": "city",
                "roman": "shinjuku",
                "prefecture": "\u6771\u4eac\u90fd",
                "prefecture_roman": "tokyo",
                "is_designated_city": false
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing or invalid, or the site does not know the city. No upstream request is made for a missing parameter. This response is not billable. |
| 404 | Not Found | The listing or agency does not exist or is no longer online. This response is not billable. |
| 502 | Bad Gateway | The site answered with a shape this API does not know. This response is not billable. |
| 503 | Service Unavailable | at home could not be reached or blocked the request, also after one retry. Retry later. 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)
