Skip to content
Scrappa Get API key
Trainline API 1 credit/request

Trainline Return Journeys API Documentation

GET https://scrappa.co/api/trainline/journeys/return

Trainline Return Journeys API Documentation Read the way back for an outward journey. Use it when a return search answers requires_inward_call true, as for London to Paris. Pass the search id, the id of the outward journey and the ids of the offers you want to price the return for. The return journeys are in journeys, in the same shape as a search. An answer without return journeys is a 200 with an empty list and is not billed.

Trainline Return Journeys API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/trainline/journeys/return
Auth header
x-api-key
Cost
1 credit/request
search_id = 1234567890 journey_id = 1234567890 alternative_ids = example
Response preview
200 OK
{
    "data": {
        "currency": "EUR",
        "journeys": [
            {
                "id": "journey-d64af4eb-e342-4331-851f-c6b5c2362fe8",
                "legs": [
                    {
                        "origin": {
                            "code": "urn:trainline:eurostar:loc:8727100",
                            "name": "Paris Gare du Nord",
                            "latitude": 48.8802,
                            "timezone": "Europe/Paris",
                            "longitude": 2.3552,
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

3 required parameters needed before sending a request.

2 optional filters available.

search_id string Required

search_id of the outward search.

Example value 1234567890
journey_id string Required

id of the outward journey.

Example value 1234567890
alternative_ids string Required

Comma separated ids of offers (offers[].id) of the outward journey, 1 to 10.

Example value example
transport_mode string Optional

all, train or coach. Defaults to all.

Example value example
currency string Optional

GBP or EUR. Defaults to GBP.

Example value USD

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "data": {
        "currency": "EUR",
        "journeys": [
            {
                "id": "journey-d64af4eb-e342-4331-851f-c6b5c2362fe8",
                "legs": [
                    {
                        "origin": {
                            "code": "urn:trainline:eurostar:loc:8727100",
                            "name": "Paris Gare du Nord",
                            "latitude": 48.8802,
                            "timezone": "Europe/Paris",
                            "longitude": 2.3552,
                            "short_code": null,
                            "country_code": "FR"
                        },
                        "carrier": {
                            "code": "urn:trainline:eurostardirect:carrier:eurostar",
                            "name": "Eurostar"
                        },
                        "cancelled": false,
                        "reservable": null,
                        "destination": {
                            "code": "urn:trainline:eurostar:loc:7015400",
                            "name": "London St Pancras International",
                            "latitude": 51.5319,
                            "timezone": "Europe/London",
                            "longitude": -0.1264,
                            "short_code": null,
                            "country_code": "GB"
                        },
                        "distance_km": null,
                        "arrival_time": "2026-11-22T09:30:00+00:00",
                        "timetable_id": "9011",
                        "train_number": "ES 9011",
                        "departure_time": "2026-11-22T08:02:00+01:00",
                        "transport_mode": "train",
                        "arrival_platform": null,
                        "bike_restriction": null,
                        "duration_minutes": 148,
                        "departure_platform": null,
                        "replacement_service": false,
                        "reservation_mandatory": null
                    }
                ],
                "offers": [
                    {
                        "id": "f74e2a02-c3fe-4fcb-98dc-c7d992743c01%alternative-f722223c-b018-4d72-acf2-2f23eca34b29",
                        "fares": [
                            {
                                "id": "fare-d6d6f413-024b-4d0d-a349-1ce069433f8f",
                                "code": "urn:trainline:eurostardirect:fare:807436929c8999194d9ceb499b47327b",
                                "name": "Eurostar Standard",
                                "tags": [],
                                "price": null,
                                "terms": [
                                    "urn:trainline:noncon:eurostar:25feerefundable7days",
                                    "urn:trainline:noncon:eurostar:100exchangeable1hour"
                                ],
                                "category": null,
                                "passengers": 1,
                                "valid_until": {
                                    "inward": null,
                                    "outward": null
                                },
                                "availability": {
                                    "status": "LIMITED",
                                    "remaining": 35
                                },
                                "travel_class": "Standard",
                                "passenger_types": [
                                    {
                                        "name": "adult",
                                        "max_age": null,
                                        "min_age": 12
                                    }
                                ],
                                "validity_period": null,
                                "delivery_methods": [],
                                "route_restriction": null,
                                "per_passenger_price": null
                            }
                        ],
                        "vendor": null,
                        "fare_code": "urn:trainline:eurostardirect:fare:807436929c8999194d9ceb499b47327b",
                        "fare_name": "Eurostar Standard",
                        "full_price": {
                            "amount": 86,
                            "currency": "EUR"
                        },
                        "section_id": "section-ceabf9b5-b7ea-44b3-98d2-34b7a39c6031",
                        "description": "Exchange without a fee 1 hour before original departure time. If new ticket is more expensive, you'll pay the difference. If new ticket is cheaper, the difference will not be refunded. Refundable with a \u20ac25/\u00a325/$40 fee per person per leg up to 7 days before the departure date. Tickets exchanged less than 7 days before the departure date will become non-refundable.",
                        "total_price": {
                            "amount": 86,
                            "currency": "EUR"
                        },
                        "travel_classes": [
                            "Standard"
                        ],
                        "included_extras": [
                            {
                                "name": "2 pieces of luggage + 1 small daypack/handbag",
                                "group": "luggage",
                                "quantity": 1
                            },
                            {
                                "name": "Buy drinks, meals and snacks on board",
                                "group": "restaurant",
                                "quantity": 1
                            },
                            {
                                "name": "WiFi",
                                "group": "wifi",
                                "quantity": 1
                            },
                            {
                                "name": "UK & EU plug sockets",
                                "group": "electricSocket",
                                "quantity": 1
                            }
                        ],
                        "available_extras": [
                            {
                                "name": "2 pieces of luggage + 1 small daypack/handbag",
                                "group": "luggage",
                                "quantity": 1
                            },
                            {
                                "name": "Buy drinks, meals and snacks on board",
                                "group": "restaurant",
                                "quantity": 1
                            },
                            {
                                "name": "WiFi",
                                "group": "wifi",
                                "quantity": 1
                            },
                            {
                                "name": "UK & EU plug sockets",
                                "group": "electricSocket",
                                "quantity": 1
                            }
                        ],
                        "fare_change_conditions": [
                            "Exchange without a fee 1 hour before original departure time. If new ticket is more expensive, you'll pay the difference. If new ticket is cheaper, the difference will not be refunded. Refundable with a \u20ac25/\u00a325/$40 fee per person per leg up to 7 days before the departure date. Tickets exchanged less than 7 days before the departure date will become non-refundable."
                        ],
                        "requires_travel_together": false
                    },
                    {
                        "id": "f74e2a02-c3fe-4fcb-98dc-c7d992743c01%alternative-e853d7e0-5899-438c-8664-7b57ced20724",
                        "fares": [
                            {
                                "id": "fare-2be30b32-5e0d-412c-ac74-cc54710f190a",
                                "code": "urn:trainline:eurostardirect:fare:5f1c216157d6f952476a0ddfc2565585",
                                "name": "Eurostar Plus",
                                "tags": [],
                                "price": null,
                                "terms": [
                                    "urn:trainline:noncon:eurostar:25feerefundable7days",
                                    "urn:trainline:noncon:eurostar:100exchangeable1hour"
                                ],
                                "category": null,
                                "passengers": 1,
                                "valid_until": {
                                    "inward": null,
                                    "outward": null
                                },
                                "availability": {
                                    "status": "LIMITED",
                                    "remaining": 11
                                },
                                "travel_class": "First",
                                "passenger_types": [
                                    {
                                        "name": "adult",
                                        "max_age": null,
                                        "min_age": 12
                                    }
                                ],
                                "validity_period": null,
                                "delivery_methods": [],
                                "route_restriction": null,
                                "per_passenger_price": null
                            }
                        ],
                        "vendor": null,
                        "fare_code": "urn:trainline:eurostardirect:fare:5f1c216157d6f952476a0ddfc2565585",
                        "fare_name": "Eurostar Plus",
                        "full_price": {
                            "amount": 82.5,
                            "currency": "EUR"
                        },
                        "section_id": "section-ceabf9b5-b7ea-44b3-98d2-34b7a39c6031",
                        "description": "Exchange without a fee 1 hour before original departure time. If new ticket is more expensive, you'll pay the difference. If new ticket is cheaper, the difference will not be refunded. Refundable with a \u20ac25/\u00a325/$40 fee per person per leg up to 7 days before the departure date. Tickets exchanged less than 7 days before the departure date will become non-refundable.",
                        "total_price": {
                            "amount": 82.5,
                            "currency": "EUR"
                        },
                        "travel_classes": [
                            "First"
                        ],
                        "included_extras": [
                            {
                                "name": "2 pieces of luggage + 1 small daypack/handbag",
                                "group": "luggage",
                                "quantity": 1
                            },
                            {
                                "name": "A delicious light meal and drinks served at your seat",
                                "group": "meal",
                                "quantity": 1
                            },
                            {
                                "name": "Extra spacious seats",
                                "group": "largeSeat",
                                "quantity": 1
                            },
                            {
                                "name": "WiFi",
                                "group": "wifi",
                                "quantity": 1
                            },
                            {
                                "name": "UK & EU plug sockets",
                                "group": "electricSocket",
                                "quantity": 1
                            }
                        ],
                        "available_extras": [
                            {
                                "name": "2 pieces of luggage + 1 small daypack/handbag",
                                "group": "luggage",
                                "quantity": 1
                            },
                            {
                                "name": "A delicious light meal and drinks served at your seat",
                                "group": "meal",
                                "quantity": 1
                            },
                            {
                                "name": "Extra spacious seats",
                                "group": "largeSeat",
                                "quantity": 1
                            },
                            {
                                "name": "WiFi",
                                "group": "wifi",
                                "quantity": 1
                            },
                            {
                                "name": "UK & EU plug sockets",
                                "group": "electricSocket",
                                "quantity": 1
                            }
                        ],
                        "fare_change_conditions": [
                            "Exchange without a fee 1 hour before original departure time. If new ticket is more expensive, you'll pay the difference. If new ticket is cheaper, the difference will not be refunded. Refundable with a \u20ac25/\u00a325/$40 fee per person per leg up to 7 days before the departure date. Tickets exchanged less than 7 days before the departure date will become non-refundable."
                        ],
                        "requires_travel_together": false
                    }
                ],
                "changes": 0,
                "carriers": [
                    {
                        "code": "urn:trainline:eurostardirect:carrier:eurostar",
                        "name": "Eurostar"
                    }
                ],
                "sellable": true,
                "co2_grams": null,
                "distance_km": null,
                "arrival_time": "2026-11-22T09:30:00+00:00",
                "departure_time": "2026-11-22T08:02:00+01:00",
                "live_confidence": null,
                "bike_restriction": null,
                "duration_minutes": 148,
                "unsellable_reason": null,
                "cheapest_total_price": {
                    "amount": 82.5,
                    "currency": "EUR"
                }
            }
        ],
        "warnings": [
            {
                "code": "DepartureDifferentFromRequested",
                "type": "SPECIAL",
                "message": "The station this train departs from is different to the station you searched for",
                "targets": [
                    {
                        "id": "journey-60cb5a26-9349-4050-9d2d-0ffbe82e54c6",
                        "type": "journey"
                    },
                    {
                        "id": "journey-1d7dfe6a-3289-46fd-9f06-b98a9cd461f3",
                        "type": "journey"
                    },
                    {
                        "id": "journey-8c8ceba5-a23f-4daf-9a22-056c3aeb7f87",
                        "type": "journey"
                    },
                    {
                        "id": "journey-5a74af9a-5c2c-4581-9034-9e49a617144b",
                        "type": "journey"
                    },
                    {
                        "id": "journey-4fe08bed-a7ee-4c02-88a4-ec91f7427291",
                        "type": "journey"
                    },
                    {
                        "id": "journey-5e9c3f20-09ae-4b29-86c9-588ffcbcb6c1",
                        "type": "journey"
                    },
                    {
                        "id": "journey-19e6be9d-0f94-48df-8e0a-4d29f2d5a72c",
                        "type": "journey"
                    },
                    {
                        "id": "journey-cb4e0966-5175-4eea-8df8-efc6b3da11e1",
                        "type": "journey"
                    },
                    {
                        "id": "journey-0d77f7f0-90df-485b-b999-eecd20afdf45",
                        "type": "journey"
                    },
                    {
                        "id": "journey-c62c6874-b48a-4283-9bfe-e310f1c11916",
                        "type": "journey"
                    },
                    {
                        "id": "journey-a478b904-1e80-4860-aff4-6cdbfc700a5e",
                        "type": "journey"
                    },
                    {
                        "id": "journey-afc2830e-6da1-49d8-8b73-108b83bfca86",
                        "type": "journey"
                    },
                    {
                        "id": "journey-fc2f393d-b809-44fb-af32-3225431395f5",
                        "type": "journey"
                    },
                    {
                        "id": "journey-20e948cf-7625-461d-a202-2e4c2db1a252",
                        "type": "journey"
                    },
                    {
                        "id": "journey-fe696a85-1775-40fc-bb15-ada4ecebf8c3",
                        "type": "journey"
                    },
                    {
                        "id": "journey-ac665123-61de-420a-9fc7-bba9dd486269",
                        "type": "journey"
                    },
                    {
                        "id": "journey-c877f774-eb01-45cf-9141-d72ffd0e4400",
                        "type": "journey"
                    },
                    {
                        "id": "journey-d64af4eb-e342-4331-851f-c6b5c2362fe8",
                        "type": "journey"
                    }
                ]
            }
        ],
        "search_id": "bb69701a-2a14-477d-a5ba-1ef94e111f6d",
        "expires_at": "2026-10-20T16:19:58+00:00",
        "journey_count": 1,
        "transport_mode": "all",
        "inward_journeys": null,
        "outward_search_id": "1ab6ab81-b316-4f2e-ba21-df3055a8e3cc",
        "outward_journey_id": "785924f2-9819-4468-9ca7-eee4855546bd",
        "requires_inward_call": false
    },
    "meta": {
        "billable": true,
        "endpoint_family": "journeys_return"
    },
    "success": true
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

A required parameter is missing or invalid. This response is not billable.

{
    "errors": {
        "origin": [
            "The origin is a station id from the stations endpoint."
        ]
    },
    "message": "The request validation failed"
}
404

Resource Not Found

The search, the journey or the offers are unknown or have expired. This response is not billable.

{
    "meta": {
        "billable": false,
        "retryable": false,
        "endpoint_family": "journeys_return"
    },
    "error": {
        "code": "NOT_FOUND",
        "message": "Trainline found no match. Use station ids from the stations endpoint and ids from a fresh search."
    },
    "success": false
}
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.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "journeys_return"
    },
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "The Trainline service is temporarily unavailable. Please retry."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.