Trainline Fares API
The fare window between two places: origin, destination, the window's dates, its cheapest day and price, and `days`, the list of priced days in date order, each with its cheapest single (one-way) fare and the departure times of the cheapest trains. Days Trainline holds no fare data for may be missing or come back with date and cheapest_price null.
https://api.maviapi.com/v1/sites/thetrainline/fares5 credits per callParameters
| Name | Required | Example | Description |
|---|---|---|---|
fromstring in query | Optional | london | origin, a place or station name (best match is used, as in /locations) or a Trainline urn code |
tostring in query | Optional | manchester | destination, a place or station name or a Trainline urn code |
datestring in query | Optional | None | first day of the window, YYYY-MM-DD (UTC); defaults to today |
daysinteger in query | Optional | 3 | number of days to price starting at `date`, 1-14 |
currencystring in query | Optional | GBP | currency of the fares (GBP, EUR, USD, CHF, DKK, SEK or NOK)One of GBP, EUR, USD, CHF, DKK, SEK, NOK |
Response fields
origin
namee.g."London"codee.g."urn:trainline:generic:loc:182gb"destination
namee.g."Manchester Piccadilly"codee.g."urn:trainline:generic:loc:MAN2968gb"currencye.g."GBP"journey_typee.g."single"date_frome.g."2026-11-27"date_toe.g."2026-11-29"cheapest_pricee.g.21.9cheapest_datee.g."2026-11-28"days
datee.g."2026-11-27"cheapest_pricee.g.36currencye.g."GBP"departurespagination
counte.g.3has_moree.g.falsenext_cursorfetched_ate.g."2026-11-27T10:16:44.709Z"agee.g.0Example request
Set MAVI_KEY to your API key. A successful call costs 5 credits per call, and a failed call costs nothing.
curl 'https://api.maviapi.com/v1/sites/thetrainline/fares' \
-H "Authorization: Bearer $MAVI_KEY"Trainline Fares API questions
What you get, what it costs and how to call it.
What does the Trainline Fares API return?
The fare window between two places: origin, destination, the window's dates, its cheapest day and price, and `days`, the list of priced days in date order, each with its cheapest single (one-way) fare and the departure times of the cheapest trains. Days Trainline holds no fare data for may be missing or come back with date and cheapest_price null. The response has origin, destination, currency, journey_type, date_from, date_to, cheapest_price, cheapest_date and 4 more.
Which parameters does the Trainline Fares API take?
Every parameter of GET /fares is optional. You can pass from, to, date, days and currency.
How much does one Trainline Fares API call cost?
One successful call costs 5 credits. A failed call costs nothing. On the Hobby plan ($49 a month for 250,000 credits), 1,000 calls cost about $0.98. The Free plan gives you 1,000 credits a month, with no credit card required. See plans and credit prices for everything after that.
How do I call the Trainline Fares API?
Send an HTTPS GET request to https://api.maviapi.com/v1/sites/thetrainline/fares with your API key in the Authorization header, as in the example request on this page. Create a key on your API keys page, or try the endpoint first in the console with the free test key.
Is the Trainline Fares API official?
No. It is an independent, hosted API from maviapi for the public data on thetrainline.com, and it is not made, endorsed or supported by Trainline. Its parameters and response fields are documented on this page.