Public-transport travel times between many origins and destinations
travel_time_matrixCompute the public-transport travel time in minutes from each of several origins to each of several destinations in Switzerland, for one departure time. One search per origin, however many destinations — built for comparing locations: which office site is best reached from where staff live, which flat has the shortest commutes, how well a venue is connected.
Use it when there are several places on either side. For one pair with the actual connection, use plan_journey; for everywhere reachable, reachable_area.
Inputs: origins and destinations are lists of places, each A station or stop name ("Zürich HB", "Bern", "Lausanne, Flon"), an address ("Bahnhofstrasse 1, Winterthur"), a named place ("ETH Zürich", "Kunsthaus"), a coordinate as "geo:47.3769,8.5417", or a place_id returned by find_place ("stop:8503000"). Names are read the way a rider types them; an ambiguous name returns candidates instead of a guess. (addresses and coordinates are snapped to their nearest stop, named in the answer). departure: Swiss local time in ISO 8601, e.g. "2026-09-26T08:00"; an explicit offset or Z is converted. A bare "08:00" means today (tomorrow if it has long passed). Omit for now. max_transfers caps changes.
The answer is minutes[i][j] from origins[i] to destinations[j], waiting for the first vehicle included, or null where no connection exists that day. Planned timetable; live delays are not included.
Example: {"origins": ["Winterthur", "Baden", "Zug"], "destinations": ["Zürich HB", "Zürich Oerlikon"], "departure": "2026-09-28T07:30"}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| origins | Yes | Where each row of the matrix starts. | |
| departure | No | When to leave. Omit for now. | |
| destinations | Yes | Where each column of the matrix ends. | |
| max_transfers | No | The most changes of vehicle allowed. | |
| transfer_time_factor | No | How much time to allow for changing trains, as a multiple of the timetable's minimum change times: 1 (default) is the timetable's own; 1.5 for luggage, children or reduced mobility; 0.7 for a fast walker. Between 0.5 and 3. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| minutes | Yes | ||
| origins | Yes | ||
| departure | No | ||
| destinations | Yes |