# Trainline Station Search API

> Search European train and coach stations on Trainline, with location codes, coordinates and carriers

- Vendor: `trainlinestationsearchapi` · version 1.0 · category Transport · tags trainline api, train station search api, rail stations api, european trains api, coach stations api, station codes api
- Datasource: custom HTTP routes
- Marketplace page: https://apiclay.com/api/trainlinestationsearchapi
- This document: https://apiclay.com/docs/trainlinestationsearchapi.md
- OpenAPI 3.1: https://apiclay.com/api/trainlinestationsearchapi/openapi.json
- MCP: connect https://api.apiclay.com/v1/mcp (see https://apiclay.com/llms.txt), then `apiclay_describe_api` with vendor `trainlinestationsearchapi`
- Updated: 2026-11-18

## About

## Trainline Station Search API

Trainline's location search across Europe's rail and coach networks: type part of a city or station name and get matching cities and stations with Trainline location code, country, latitude and longitude, time zone, parent city and the carriers (SNCF, DB, Trenitalia, Eurostar, FlixBus and more) that serve each one.

Data comes from **thetrainline.com** (https://www.thetrainline.com). Every route calls the source's own public API and returns it unchanged.

Typical flow: `/stations?searchTerm=paris&amp;locale=en-GB`.

### Routes

#### GET `/stations` - Station search
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| searchTerm | query | string | yes | City or station name, or part of it. |
| locale | query | string | no | e.g. `en-GB`, `fr-FR`, `de-DE`, `it-IT`. |

Returns: `searchLocations[]` (up to 20) with `name`, `code` (`urn:trainline:...`), `countryCode`, `locationType` (city/station), `latitude`, `longitude`, `timezone`, `parent`, `score`, `connections[]` (carriers).

### Caveats

- Location search only; fares and bookings need a Trainline session and are not offered.
- Upstream responses can change over time. Verify fields before relying on them.
- Not affiliated with or endorsed by thetrainline.com.

## Pricing

- Pay as you go: 0.0012 credits/request
- Trial: 1 free requests per buyer
- Billing order: trial requests -> subscribed plan requests -> pay as you go. 1 credit's USD value is shown on the marketplace page.

## HTTP routes

Only the public, buyer-facing parts of each route are listed; vendor-side credentials stay on the gateway.

### GET /stations — Station search
- Gateway: `GET https://api.apiclay.com/v1/api/trainlinestationsearchapi/stations`
- Public query params: `searchTerm` (string, required), `locale` (string)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

## Call example

```bash
curl -X GET "https://api.apiclay.com/v1/api/trainlinestationsearchapi/stations?searchTerm=<searchTerm>" \
  -H "token: <YOUR_APICLAY_TOKEN>"
```

Index of every published API: https://apiclay.com/llms.txt
