---
title: "Trainline API: JSON data, 14 endpoints, 1 credit per call"
description: "Get Trainline data as JSON with one API key: cards, cards discounts, fares best, fares calendar. 1,000 free credits a month."
url: https://perceptlayer.com/apis/trainline
---

[APIs](https://perceptlayer.com/apis) / [Travel](https://perceptlayer.com/verticals/travel) / Trainline

1 credit per call 14 endpoints

# Trainline API

Get Trainline data as JSON with one API key: cards, cards discounts, fares best, fares calendar. 1,000 free credits a month.

[Get a free API key](https://perceptlayer.com/signup) Run it below

Trainline

GET /v1/trainline/cards 

```
curl "https://api.perceptlayer.com/v1/trainline/cards" \
  -H "X-API-Key: $API_KEY"
```

cURL 1 credit per successful call

Run this call below or from your dashboard to see a live response.

Playground

## Run this API

cURL shell 

```
curl "https://api.perceptlayer.com/v1/trainline/cards" \
  -H "X-API-Key: $API_KEY"
```

Trainline · 14 endpoints

## Endpoints

Every endpoint takes the same key. Open one for its parameters and an example request.

| Endpoint | Required parameters | Cost |
| --- | --- | --- |
| [GET `/v1/trainline/cards`](https://perceptlayer.com/apis/trainline/cards) | none | 1 credit |
| [GET `/v1/trainline/cards-discounts`](https://perceptlayer.com/apis/trainline/cards-discounts) | none | 1 credit |
| [GET `/v1/trainline/fares-best`](https://perceptlayer.com/apis/trainline/fares-best) | none | 1 credit |
| [GET `/v1/trainline/fares-calendar`](https://perceptlayer.com/apis/trainline/fares-calendar) | `origin` `destination` `date_from` `date_to` +1 optional | 1 credit |
| [GET `/v1/trainline/fares-calendar-times`](https://perceptlayer.com/apis/trainline/fares-calendar-times) | `origin` `destination` `date_from` `date_to` +1 optional | 1 credit |
| [GET `/v1/trainline/journeys`](https://perceptlayer.com/apis/trainline/journeys) | `origin` `destination` `date` +9 optional | 1 credit |
| [GET `/v1/trainline/journeys-calling-points`](https://perceptlayer.com/apis/trainline/journeys-calling-points) | `timetable_id` `carrier` `departure_time` `origin` `destination` | 1 credit |
| [GET `/v1/trainline/journeys-local-transport`](https://perceptlayer.com/apis/trainline/journeys-local-transport) | `search_id` +2 optional | 1 credit |
| [GET `/v1/trainline/journeys-page`](https://perceptlayer.com/apis/trainline/journeys-page) | `search_id` +4 optional | 1 credit |
| [GET `/v1/trainline/journeys-price-prediction`](https://perceptlayer.com/apis/trainline/journeys-price-prediction) | `search_id` `journey_id` +1 optional | 1 credit |
| [GET `/v1/trainline/journeys-return`](https://perceptlayer.com/apis/trainline/journeys-return) | `search_id` `journey_id` +3 optional | 1 credit |
| [GET `/v1/trainline/journeys-ticket-options`](https://perceptlayer.com/apis/trainline/journeys-ticket-options) | `search_id` `outward_journey_id` +2 optional | 1 credit |
| [GET `/v1/trainline/stations`](https://perceptlayer.com/apis/trainline/stations) | `query` +2 optional | 1 credit |
| [GET `/v1/trainline/stations-nearby`](https://perceptlayer.com/apis/trainline/stations-nearby) | `station_id` +2 optional | 1 credit |

Overview

## About the Trainline API

Get Trainline data as JSON with one API key: cards, cards discounts, fares best, fares calendar. 1,000 free credits a month.

Travel JSON REST MCP

### More travel APIs

[Agoda](https://perceptlayer.com/apis/agoda) [Airbnb](https://perceptlayer.com/apis/airbnb) [Booking.com](https://perceptlayer.com/apis/booking) [Economy Car Rentals](https://perceptlayer.com/apis/economy-car-rentals) [Eventbrite](https://perceptlayer.com/apis/eventbrite) [Expedia](https://perceptlayer.com/apis/expedia) [FlixBus](https://perceptlayer.com/apis/flixbus) [GetYourGuide](https://perceptlayer.com/apis/getyourguide) [Google Flights](https://perceptlayer.com/apis/google-flights) [Google Hotels](https://perceptlayer.com/apis/google-hotels) [Google Travel Explore](https://perceptlayer.com/apis/google-travel-explore) [HolidayCheck](https://perceptlayer.com/apis/holidaycheck)

## Try the Trainline API with 1,000 free credits

No credit card. Failed calls are never billed.

[Get a free API key](https://perceptlayer.com/signup) [Read the docs](https://perceptlayer.com/docs)
