# Trainline Journeys API Documentation

<p><strong>Trainline Journeys API Documentation</strong> Search rail and coach journeys between two stations. Each journey has its legs with stations, times, platforms, carrier, train number and timetable id, the duration, the distance, the number of changes and the CO2 estimate. Each journey carries offers: every purchasable fare with its name, travel class, availability, conditions, extras and prices. total_price is the price for all passengers and per_passenger_price is the fare of one passenger. changes counts the legs minus one. fare_change_conditions lists the exchange and refund texts of the fare. A return between UK stations returns both directions in one call. For a continental return, requires_inward_call is true: call the return endpoint for the way back. Use search_id with the page endpoint to read more journeys.</p>

- **Documentation:** [https://scrappa.co/docs/trainline-api/trainline_journeys](https://scrappa.co/docs/trainline-api/trainline_journeys)
- **API group:** Trainline API
- **Endpoint:** `GET https://scrappa.co/api/trainline/journeys`

## 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 |
| --- | --- | --- | --- |
| `origin` | string | Yes | Origin station id from the stations endpoint. Example: urn:trainline:generic:loc:EUS1444gb. |
| `destination` | string | Yes | Destination station id from the stations endpoint. Example: urn:trainline:generic:loc:MAN2968gb. |
| `date` | string | Yes | Travel date, YYYY-MM-DD, today or later and inside the booking horizon of about 178 days. |
| `time` | string | No | Earliest departure time, HH:MM. Defaults to 09:00. |
| `journey_type` | string | No | single, return or open_return. Defaults to single. A return needs return_date. |
| `return_date` | string | No | Return travel date, YYYY-MM-DD. Required for a return. |
| `return_time` | string | No | Earliest return departure time, HH:MM. Defaults to 09:00. |
| `adults` | integer | No | Adults aged 16 and over, 1 to 9. Defaults to 1. |
| `children` | integer | No | Children, 0 to 9. Adults and children together are at most 9. |
| `child_age` | integer | No | Age of all children, 0 to 15. Defaults to 8. |
| `transport_mode` | string | No | all, train or coach. train drops every journey that has a leg by another mode. Defaults to all. |
| `currency` | string | No | GBP or EUR. Defaults to GBP. Use EUR for continental routes. |

## Example response

```json
{
    "data": {
        "origin": "urn:trainline:generic:loc:EUS1444gb",
        "currency": "GBP",
        "journeys": [
            {
                "id": "785924f2-9819-4468-9ca7-eee4855546bd",
                "legs": [
                    {
                        "origin": {
                            "code": "urn:trainline:atoc:loc:EUS1444",
                            "name": "London Euston",
                            "latitude": 51.5284,
                            "timezone": "Europe/London",
                            "longitude": -0.1346,
                            "short_code": "EUS",
                            "country_code": "GB"
                        },
                        "carrier": {
                            "code": "urn:trainline:atoc:carrier:VT",
                            "name": "Avanti West Coast"
                        },
                        "cancelled": false,
                        "reservable": true,
                        "destination": {
                            "code": "urn:trainline:atoc:loc:MAN2968",
                            "name": "Manchester Piccadilly",
                            "latitude": 53.4767,
                            "timezone": "Europe/London",
                            "longitude": -2.229,
                            "short_code": "MAN",
                            "country_code": "GB"
                        },
                        "distance_km": 280,
                        "arrival_time": "2026-11-03T11:19:00+00:00",
                        "timetable_id": "W34038",
                        "train_number": "VT705500",
                        "departure_time": "2026-11-03T09:13:00+00:00",
                        "transport_mode": "train",
                        "arrival_platform": "5",
                        "bike_restriction": "ALLOWEDWITHRESERVATION",
                        "duration_minutes": 126,
                        "departure_platform": "2",
                        "replacement_service": false,
                        "reservation_mandatory": true
                    }
                ],
                "offers": [
                    {
                        "id": "1255d59b-8f81-47ad-8174-a5c78999f34a",
                        "fares": [
                            {
                                "id": "757f730c-41ca-4835-9213-905be875207e",
                                "code": "urn:trainline:atoc:fare:SOS",
                                "name": "Anytime Single",
                                "tags": [
                                    "flex:anytime",
                                    "refundable:yes"
                                ],
                                "price": {
                                    "amount": 193,
                                    "currency": "GBP"
                                },
                                "terms": [
                                    "urn:trainline:noncon:atoc:rfndbl",
                                    "urn:trainline:noncon:atoc:anytime"
                                ],
                                "category": "Peak",
                                "passengers": 1,
                                "valid_until": {
                                    "inward": null,
                                    "outward": "2026-11-05T04:30:00+00:00"
                                },
                                "availability": {
                                    "status": "AVAILABLE",
                                    "remaining": null
                                },
                                "travel_class": "Standard",
                                "passenger_types": [
                                    {
                                        "name": "Adult",
                                        "max_age": null,
                                        "min_age": 16
                                    }
                                ],
                                "validity_period": "P2D",
                                "delivery_methods": [
                                    "AtocMTicket",
                                    "AtocETicket",
                                    "AtocKiosk",
                                    "AtocUkSecondClassPost",
                                    "AtocUKInternationalPost",
                                    "AtocUKSpecialDelivery",
                                    "AtocIndirectETicket"
                                ],
                                "route_restriction": "Travel is allowed via any permitted route.",
                                "per_passenger_price": {
                                    "amount": 193,
                                    "currency": "GBP"
                                }
                            }
                        ],
                        "vendor": "UK National Rail",
                        "fare_code": "urn:trainline:atoc:fare:SOS",
                        "fare_name": "Anytime Single",
                        "full_price": {
                            "amount": 193,
                            "currency": "GBP"
                        },
                        "section_id": "e0e2d381-3327-4246-8b6d-8e01c5e3d488",
                        "description": "Travel any time of day.",
                        "total_price": {
                            "amount": 193,
                            "currency": "GBP"
                        },
                        "travel_classes": [
                            "Standard"
                        ],
                        "included_extras": [
                            {
                                "name": "Allocated seating",
                                "group": "seatSelection",
                                "quantity": 1
                            },
                            {
                                "name": "WiFi",
                                "group": "wifi",
                                "quantity": 1
                            },
                            {
                                "name": "Power socket",
                                "group": "electricSocket",
                                "quantity": 1
                            },
                            {
                                "name": "1 suitcase (max 30x70x90cm), 1 small carry-on bag, 1 handbag",
                                "group": "luggage",
                                "quantity": 1
                            }
                        ],
                        "available_extras": [
                            {
                                "name": "Bike",
                                "group": "bicycle",
                                "quantity": 3
                            },
                            {
                                "name": "Allocated seating",
                                "group": "seatSelection",
                                "quantity": 1
                            },
                            {
                                "name": "WiFi",
                                "group": "wifi",
                                "quantity": 1
                            },
                            {
                                "name": "Power socket",
                                "group": "electricSocket",
                                "quantity": 1
                            },
                            {
                                "name": "1 suitcase (max 30x70x90cm), 1 small carry-on bag, 1 handbag",
                                "group": "luggage",
                                "quantity": 1
                            }
                        ],
                        "fare_change_conditions": [
                            "Flexible ticket with no time restrictions on when you can travel.",
                            "Your journey must be on the date, or the day after the date, specified on the ticket.",
                            "Can be booked in advance or purchased on the day of travel.",
                            "Refundable until 23:59 the day before the ticket becomes valid for travel. Non-refundable if purchased on the day of travel.",
                            "If you wish to travel on a date outside of the ticket validity period or change the Class of ticket, you will need to buy a new ticket and apply for a refund on your current ticket.",
                            "Yes - normal railcard and child discounts available.",
                            "You may start, break and resume, or end your journey at any intermediate station along the route of travel.",
                            "Mobile Tickets and etickets aren't valid for travel on London Underground. See our FAQs for more info.",
                            "SOS",
                            "View information about wheelchair spaces and accessibility on board your train here www.nationalrail.co.uk/on-the-train/accessible-train-travel-and-facilities. Find out how to book travel assistance here www.nationalrail.co.uk/help-and-assistance/passenger-assist."
                        ],
                        "requires_travel_together": false
                    },
                    {
                        "id": "cd15c147-83f2-4e4f-856a-6dd91d5c9704",
                        "fares": [
                            {
                                "id": "f880bc96-b00a-4f42-a8a3-42d80804310e",
                                "code": "urn:trainline:atoc:fare:FOS",
                                "name": "Anytime Single (1st Class)",
                                "tags": [
                                    "flex:anytime",
                                    "refundable:yes"
                                ],
                                "price": {
                                    "amount": 290,
                                    "currency": "GBP"
                                },
                                "terms": [
                                    "urn:trainline:noncon:atoc:rfndbl",
                                    "urn:trainline:noncon:atoc:anytime"
                                ],
                                "category": "Peak",
                                "passengers": 1,
                                "valid_until": {
                                    "inward": null,
                                    "outward": "2026-11-05T04:30:00+00:00"
                                },
                                "availability": {
                                    "status": "AVAILABLE",
                                    "remaining": null
                                },
                                "travel_class": "First",
                                "passenger_types": [
                                    {
                                        "name": "Adult",
                                        "max_age": null,
                                        "min_age": 16
                                    }
                                ],
                                "validity_period": "P2D",
                                "delivery_methods": [
                                    "AtocMTicket",
                                    "AtocETicket",
                                    "AtocKiosk",
                                    "AtocUkSecondClassPost",
                                    "AtocUKInternationalPost",
                                    "AtocUKSpecialDelivery",
                                    "AtocIndirectETicket"
                                ],
                                "route_restriction": "Travel is allowed via any permitted route.",
                                "per_passenger_price": {
                                    "amount": 290,
                                    "currency": "GBP"
                                }
                            }
                        ],
                        "vendor": "UK National Rail",
                        "fare_code": "urn:trainline:atoc:fare:FOS",
                        "fare_name": "Anytime Single (1st Class)",
                        "full_price": {
                            "amount": 290,
                            "currency": "GBP"
                        },
                        "section_id": "e0e2d381-3327-4246-8b6d-8e01c5e3d488",
                        "description": "Travel any time of day.",
                        "total_price": {
                            "amount": 290,
                            "currency": "GBP"
                        },
                        "travel_classes": [
                            "First"
                        ],
                        "included_extras": [
                            {
                                "name": "Allocated seating",
                                "group": "seatSelection",
                                "quantity": 1
                            },
                            {
                                "name": "WiFi",
                                "group": "wifi",
                                "quantity": 1
                            },
                            {
                                "name": "Power socket",
                                "group": "electricSocket",
                                "quantity": 1
                            },
                            {
                                "name": "1 suitcase (max 30x70x90cm), 1 small carry-on bag, 1 handbag",
                                "group": "luggage",
                                "quantity": 1
                            },
                            {
                                "name": "At seat service",
                                "group": "meal",
                                "quantity": 1
                            },
                            {
                                "name": "Comfier seats",
                                "group": "extraLegroom",
                                "quantity": 1
                            },
                            {
                                "name": "Table seat",
                                "group": "firstClassComfort",
                                "quantity": 1
                            },
                            {
                                "name": "Complimentary food and drink",
                                "group": "drinksAndSnacks",
                                "quantity": 1
                            },
                            {
                                "name": "1st class lounge",
                                "group": "departureLounge",
                                "quantity": 1
                            }
                        ],
                        "available_extras": [
                            {
                                "name": "Bike",
                                "group": "bicycle",
                                "quantity": 3
                            },
                            {
                                "name": "Allocated seating",
                                "group": "seatSelection",
                                "quantity": 1
                            },
                            {
                                "name": "WiFi",
                                "group": "wifi",
                                "quantity": 1
                            },
                            {
                                "name": "Power socket",
                                "group": "electricSocket",
                                "quantity": 1
                            },
                            {
                                "name": "1 suitcase (max 30x70x90cm), 1 small carry-on bag, 1 handbag",
                                "group": "luggage",
                                "quantity": 1
                            },
                            {
                                "name": "At seat service",
                                "group": "meal",
                                "quantity": 1
                            },
                            {
                                "name": "Comfier seats",
                                "group": "extraLegroom",
                                "quantity": 1
                            },
                            {
                                "name": "Table seat",
                                "group": "firstClassComfort",
                                "quantity": 1
                            },
                            {
                                "name": "Complimentary food and drink",
                                "group": "drinksAndSnacks",
                                "quantity": 1
                            },
                            {
                                "name": "1st class lounge",
                                "group": "departureLounge",
                                "quantity": 1
                            }
                        ],
                        "fare_change_conditions": [
                            "Flexible ticket with no time restrictions on when you can travel.",
                            "Your journey must be on the date, or the day after the date, specified on the ticket.",
                            "Can be booked in advance or purchased on the day of travel.",
                            "Refundable until 23:59 the day before the ticket becomes valid for travel. Non-refundable if purchased on the day of travel.",
                            "If you wish to travel on a date outside of the ticket validity period or change the Class of ticket, you will need to buy a new ticket and apply for a refund on your current ticket.",
                            "Yes - normal railcard and child discounts available.",
                            "Only Senior, Disabled Persons and HM Forces Railcards secure discounts in First Class, and, subject to time restriction, the Two Together Railcard.",
                            "You may start, break and resume, or end your journey at any intermediate station along the route of travel.",
                            "Mobile Tickets and etickets aren't valid for travel on London Underground. See our FAQs for more info.",
                            "FOS",
                            "View information about wheelchair spaces and accessibility on board your train here www.nationalrail.co.uk/on-the-train/accessible-train-travel-and-facilities. Find out how to book travel assistance here www.nationalrail.co.uk/help-and-assistance/passenger-assist."
                        ],
                        "requires_travel_together": false
                    }
                ],
                "changes": 0,
                "carriers": [
                    {
                        "code": "urn:trainline:atoc:carrier:VT",
                        "name": "Avanti West Coast"
                    }
                ],
                "sellable": true,
                "co2_grams": 9828,
                "distance_km": 280,
                "arrival_time": "2026-11-03T11:19:00+00:00",
                "departure_time": "2026-11-03T09:13:00+00:00",
                "live_confidence": "Possible",
                "bike_restriction": "ALLOWEDWITHRESERVATION",
                "duration_minutes": 126,
                "unsellable_reason": null,
                "cheapest_total_price": {
                    "amount": 43.5,
                    "currency": "GBP"
                }
            }
        ],
        "warnings": null,
        "search_id": "1ab6ab81-b316-4f2e-ba21-df3055a8e3cc",
        "expires_at": "2026-10-20T15:57:57+00:00",
        "destination": "urn:trainline:generic:loc:MAN2968gb",
        "journey_type": "single",
        "journey_count": 1,
        "transport_mode": "all",
        "inward_journeys": null,
        "requires_inward_call": false
    },
    "meta": {
        "billable": true,
        "endpoint_family": "journeys"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter is missing or invalid. This response is not billable. |
| 404 | Resource Not Found | The station ids are unknown or no journey is offered between these stations. This response is not billable. |
| 503 | Upstream Unavailable | Trainline did not answer in time. Scrappa retries on other exits first. This response is not billable. Retry after a few seconds. |

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