# Trip.com Train Stations API Documentation

<p><strong>Trip.com Train Stations API Documentation</strong> Find train stations by name or list the hot stations of a country. Each station has a code, the name, the original name, a type, country, province, city code, coordinates, tags such as eurostar and child stations. The country filter is applied to the real country of each station. Use the codes with the Train Search and Train Price Calendar endpoints. China and Korea return few stations. A search without a match returns an empty list and costs nothing. Cost: 1 credit.</p>

- **Documentation:** [https://scrappa.co/docs/tripcom-api/tripcom_trains_stations](https://scrappa.co/docs/tripcom-api/tripcom_trains_stations)
- **API group:** Trip.com API
- **Endpoint:** `GET https://scrappa.co/api/tripcom/trains/stations`

## 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 |
| --- | --- | --- | --- |
| `mode` | string | No | search or recommend. Defaults to search. recommend lists the hot stations of one country. |
| `query` | string | No | Station or city name, 2 to 100 characters. Required for mode=search. Example: london. |
| `country` | string | No | Two-letter country code, e.g. GB, FR, DE, IT, ES, JP. Results are filtered to this country. Required for mode=recommend. |

## Example response

```json
{
    "data": {
        "mode": "search",
        "query": "London",
        "total": 1,
        "country": "GB",
        "stations": [
            {
                "code": "GB1601",
                "name": "London Euston",
                "tags": [],
                "type": 1,
                "city_id": "338",
                "latitude": 51.5283763,
                "city_code": "LON",
                "longitude": -0.1345585,
                "country_code": "GB",
                "country_name": "United Kingdom",
                "name_original": "London Euston",
                "province_name": "London",
                "flight_city_code": "LON",
                "children_stations": []
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "train_stations"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing or invalid. This response is not billable. |
| 503 | Unexpected Upstream Format | Trip.com answered with a format Scrappa does not know. This response is not billable. |
| 503 | Upstream Unavailable | Trip.com did not answer after one retry. This response is not billable. Retry later. |

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