# Trip.com Train Price Calendar API Documentation

<p><strong>Trip.com Train Price Calendar API Documentation</strong> Get the lowest train price for each departure window of about four hours, from a start date on. Each window has the date, the start time, the price as a number in the requested currency, whether the window has one train only (direct) and the train numbers. Use station codes from the Train Stations endpoint. The calendar reaches about 88 days ahead in Europe, Japan and Korea and about 14 days in China. A pair without trains returns an empty list and costs nothing. One way only. Cost: 1 credit per successful call. Failed calls cost 0.</p>

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

## 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 |
| --- | --- | --- | --- |
| `from` | string | Yes | Departure station code from the Train Stations endpoint, e.g. GB3467. |
| `to` | string | Yes | Arrival station code in the same market, e.g. FR3466. |
| `date` | string | Yes | First day of the calendar, YYYY-MM-DD, today or later. |
| `currency` | string | No | USD, EUR, GBP, JPY or KRW. Defaults to USD. Prices come back in this currency. |
| `locale` | string | No | Site language: en, en-gb, de, fr, ja, ko or zh-hk. Defaults to en. |

## Example response

```json
{
    "data": {
        "to": "FR3466",
        "from": "GB3467",
        "total": 1,
        "windows": [
            {
                "price": 54.2,
                "direct": true,
                "currency": "EUR",
                "train_numbers": [
                    "ES 9018"
                ],
                "departure_date": "2027-03-14",
                "departure_time": "08:00"
            }
        ],
        "currency": "EUR",
        "start_date": "2027-03-14",
        "lowest_price": 54.2
    },
    "meta": {
        "billable": true,
        "endpoint_family": "train_calendar"
    },
    "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 or no capacity was free. 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)
