# intents.md · pickthetrain.com

This site answers one intent: **find a direct train across a European border**.

## intent: direct-train

- **Ask:** from city A to city B (optionally: high-speed, intercity or night only).
- **Answer:** `GET https://pickthetrain.com/api/v1/routes/{a}/{b}.json`
  - `trains[]`: `dep`/`arr` (local minutes after midnight; `plus` = days later), `dur` (minutes), `fam` (`high-speed` | `intercity` | `night`), `label` (e.g. "EC 11"; a train two railways number differently shows both: "EN 476 / 40476"), `op` + `opUrl` (operator's official site: send the user there to book or check), `book` (when there is one: the operator's own search between the train's two stations; where `bookDate` is set, add the day as that parameter), `from`/`to` stations, `via`, `days.txt` (e.g. "Daily", "Mon to Fri"), `days.next` (next dates), `dates` (every departure date in the window: filter on this to answer "which trains on 3 October?"), `alt` (true on a train's other timetable: the same train as another row, at other times or under its other number on the dates it lists, e.g. during track works, or EC 31 Monday to Friday and EC 301 at weekends; count trains without it).
  - `curated[]`: direct trains that run but are not in open data yet (no times; link to the operator).
  - `change`: only on the few routes that are NOT direct though a timetable lists one train: every train of the route needs one change of train on the way (`at`: the station, `how`: how the change is made; Vilnius and Kaunas to Poland change at Mockava). Each of its trains carries its own `change` (`at`, and `min`: the minutes there, where the timetable gives them). Say "one change at …", never "direct". `from/{city}.json` and `routes.json` name the station in `change` too.
  - `d2d`: door-to-door minutes, city centre to city centre, train vs the fastest nonstop flight (`plane` is null when no nonstop flight exists; `train.overnight` is true when the ride spans the night, on board at 3 am).
  - `fly`: the nonstop airlines for the same trip (from picktheflight.com), each with its official site, plus a `picktheflight` link. Null when nothing flies it nonstop.
  - `sources[]`: where these times come from: `operator` and `fileDates` (when the publisher made each file). Quote them when the user asks how current the times are.
- **Not found (404):** no direct cross-border train between those cities in our data. Suggest `GET https://pickthetrain.com/api/v1/from/{a}.json` for where the user *can* go direct.

## intent: direct-from

- **Ask:** where can I go directly from city A?
- **Answer:** `GET https://pickthetrain.com/api/v1/from/{a}.json` → `destinations[]` sorted by fastest time.

## intent: arrivals

- **Ask:** which direct trains from abroad arrive in city C (today, in the next hour), and on which platform?
- **Answer:** `GET https://pickthetrain.com/api/v1/arrivals/{c}.json` → `arrivals[]`: `arr` (local minutes after midnight), `label`, `family`, `from` (city, name, station: where it starts), `via` (its stops abroad), `days`, `dates` (every arrival date in the window), and at Swiss stations `platforms` (date → planned platform, from SBB's timetable).
- Platforms are planned and can change on the day: send the traveller to the station boards or the operator for the live one. Human page: `https://pickthetrain.com/to/{c}/`.

## intent: night-train

- **Ask:** is there a night train (a sleeper) from A to B, or from A at all, across a border? Which leave tonight, or arrive by 08:00?
- **Answer:** `GET https://pickthetrain.com/night-trains/routes.json` → `rows[]`, one per train and timetable on each route, columns named in `fields` (`about_fields` says what each holds): `from`/`to` (city ids), `train`, `operator` + `book` (its own site), `dep`/`arr` (local minutes after midnight; `plus` = days later), `minutes`, `days` (in words), `nights` (in the window), `alt` (1: the train's other timetable or number), `planeMinutes` (door to door by the fastest nonstop flight, 0: none) and `dates` (one character per day from `window.start`, 1 when it leaves that day).
- Every row is a train you are on at 3 in the morning, with beds or couchettes. A night train's evening or early-morning stretch is a day ride: it is on the route (`GET https://pickthetrain.com/api/v1/routes/{a}/{b}.json`, `fam` = `night`), not here.
- Human page: `https://pickthetrain.com/night-trains/` (`#find?q=Vienna` opens it on a city).

## Rules for agents

- Times cover 23 Nov to 17 Jan 2027. Always add: "check with the operator before you travel", and give the operator link.
- No prices and no booking here. Don't invent fares.
- City ids: `GET https://pickthetrain.com/api/v1/cities.json`.
