Trainline API

Trainline API for Rail and Coach Journeys, Fares, Calling Points, and Price Calendars

Scrappa's Trainline API returns structured JSON from Trainline, the rail and coach ticket platform for the UK and Europe. Find stations, search journeys by origin, destination, date, time and passengers, and read every fare with its class, carrier, availability and conditions. Open the stops and live status of a train, the named ticket products with refund and exchange terms, price predictions, PlusBus add-ons, a cheapest-fare calendar and the railcard catalogue. Scrappa is an independent service and is not affiliated with or endorsed by Trainline.

500 free credits
No card needed
From $0.20 / 1k
Pay as you go
Structured JSON
Ready for apps
API key access
Test in minutes
14
Endpoints
15
Journeys per page
$0.20
Per 1k requests

Try it now

Make one request. Inspect structured JSON.

Use the first endpoint in this API family with a Scrappa API key. Every account includes 500 free monthly credits, so you can validate the response shape before buying credits.

Request preview
Request
curl -X GET "https://scrappa.co/api/trainline/journeys?origin=urn:trainline:generic:loc:EUS1444gb&destination=urn:trainline:generic:loc:MAN2968gb&date=2026-11-03&time=09:00&adults=1" \
  -H "Accept: application/json" \
  -H "X-API-KEY: YOUR_API_KEY"
JSON response
{
  "success": true,
  "data": {
    "origin": "urn:trainline:generic:loc:EUS1444gb",
    "destination": "urn:trainline:generic:loc:MAN2968gb",
    "journey_type": "single",
    "currency": "GBP",
    "search_id": "1ab6ab81-b316-4f2e-ba21-df3055a8e3cc",
    "journey_count": 3,
    "journeys": [
      {
        "id": "785924f2-9819-4468-9ca7-eee4855546bd",
        "departure_time": "2026-11-03T09:13:00+00:00",
        "arrival_time": "2026-11-03T11:19:00+00:00",
        "duration_minutes": 126,
        "changes": 0,
        "carriers": [{"code": "urn:trainline:atoc:carrier:VT", "name": "Avanti West Coast"}],
        "cheapest_total_price": {"amount": 43.5, "currency": "GBP"}
      }
    ]
  },
  "meta": {
    "endpoint_family": "journeys",
    "billable": true
  }
}

What you can build

Structured data for real applications. Here are some ideas.

Rail Fare Monitoring

Track the price of a route per day and per ticket product, with class, availability and conditions.

Travel Search Features

Add station search, journey results and train details to your own travel app.

Cheapest Day Finder

Read the lowest fare for every day of a route and pick the best day to travel.

Delay and Platform Tracking

Read the stops, platforms and live status of a train for customer messages.

Mobility Research

Compare carriers, travel times, changes and prices on UK and European corridors.

Trainline scraper API

Trainline API for train journeys, fares, calling points, and price calendars

The Trainline API is built for fare monitoring, travel search and mobility research. Find station ids, search journeys for a date and passengers, then open one journey for its stops, its ticket products and its price tiers.

Find station ids by name and pass them as origin and destination.

Read legs, platforms, carriers, changes and duration of each journey.

Compare fares per travel class with availability and conditions.

Read the cheapest fare of every day for a route.

Search UK rail, European rail and coach journeys with GBP or EUR prices.

Choose the right Trainline API endpoint

Use Stations for ids

Search a station or city by name and take the id of the result. Pass it as origin or destination to the journey endpoints.

Open Trainline Stations API docs

Use Journeys for fares

Search a route for a date, a time and passengers. Each journey lists its legs and every offer with class, availability, conditions and price.

Open Trainline Journeys API docs

Use the Fare Calendar for the best day

Read the cheapest one-way fare for each day of a window, then search the best day for the full list of journeys.

Open Trainline Fare Calendar API docs

Available endpoints

Everything you need in one API.

GET

Return Fare Calendar

/api/trainline/fares/calendar/return

Read the return leg fare for each outward and return day pair

Scrappa vs ScrapingBee / ScraperAPI

See how Scrappa compares to the official API.

Trainline journey data as JSON
Scrappa:
ScrapingBee / ScraperAPI: Build your own parser
Fares per class with conditions
Scrappa:
ScrapingBee / ScraperAPI:
Cheapest-fare calendar
Scrappa:
ScrapingBee / ScraperAPI:
Price per 1k requests
Scrappa: From $0.20
ScrapingBee / ScraperAPI: Varies by credits per request
Unified API key
Scrappa: Yes (80+ APIs)
ScrapingBee / ScraperAPI: Scraping only
Free tier
Scrappa: 500 credits/month
ScrapingBee / ScraperAPI: Trial credits

Key features

Station search with ids for every other endpoint
Journey search with legs, platforms, carriers, changes and duration
Fares per class with availability, conditions, extras and total and per passenger price
Calling points with live status, ticket products with refund and exchange terms
Cheapest-fare calendar with departure times, price tiers and PlusBus add-ons
UK and European rail and coach with GBP or EUR prices

Frequently asked questions

No. Scrappa is an independent service and is not affiliated with or endorsed by Trainline. The Trainline API returns structured JSON from public Trainline pages. It does not book tickets and needs no Trainline account.

Every Scrappa account includes 500 free credits each month. After that, each request costs one credit, which works out to $0.20 to $0.50 per 1,000 requests depending on your plan.

No. Only successful answers with data are billed. An upstream failure, an unknown id and an empty list are not billed.

No. total_price is the price for all passengers of the search. per_passenger_price on each fare is the price of one passenger.

The booking horizon is about 178 days. Searches and calendars beyond it answer a validation error.

Start using the Trainline API

Sign up and get 500 free credits. No credit card required.