# SUUMO Lines API

<p>List the train lines of a prefecture, or the stations of one line. A station search in the rent search needs four values from this endpoint: the station `code` as `station`, the line `code` as `line`, its `line_group` and the `area_code`. `listing_count` is the number of rental listings SUUMO shows for the line or station.</p>

- **Documentation:** [https://scrappa.co/docs/suumo-api/suumo_lines](https://scrappa.co/docs/suumo-api/suumo_lines)
- **API group:** SUUMO API
- **Endpoint:** `GET https://scrappa.co/api/suumo/lines`

## 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 |
| --- | --- | --- | --- |
| `prefecture` | string | Yes | Prefecture as a lower-case English name: `tokyo`, `osaka`, `kanagawa`, `hokkaido` and so on (all 47). |
| `line` | string | No | A 4-digit line code from the lines list, e.g. `0005`. Returns the stations of that line instead. Needs line_group and area_code. |
| `line_group` | string | No | The `line_group` value of that line in the lines list, e.g. `00051`. Required with line. |
| `area_code` | string | No | The `area_code` value of the lines list, e.g. `013`. Required with line. |

## Example response

```json
{
    "data": {
        "lines": [
            {
                "code": "0005",
                "name": "\uff2a\uff32\u5c71\u624b\u7dda",
                "line_group": "00051",
                "listing_count": 291186
            },
            {
                "code": "0125",
                "name": "\uff2a\uff32\u4eac\u6d5c\u6771\u5317\u7dda",
                "line_group": "01251",
                "listing_count": 210663
            }
        ],
        "area_code": "013",
        "prefecture": "tokyo"
    },
    "meta": {
        "billable": true,
        "endpoint_family": "lines"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
|  | The listing does not exist or is no longer online. This response is not billable. |  |
|  | A parameter or filter is missing, invalid or not available for the property type. This response is not billable. |  |
|  | SUUMO is temporarily unavailable or answered a page that no longer matches the documented contract. Retry the request. 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)
