# 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"), `op` + `opUrl` (operator's official site: send the user there to book or check), `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 on the dates it lists, e.g. during track works; count trains without it).
  - `curated[]`: direct trains that run but are not in open data yet (no times; link to the operator).
  - `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), `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 6 Nov to 3 Dec 2026. 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`.
