# Swiss Transport

> Plan journeys on Switzerland's public transport through the keyless Opendata.ch API: search trains, trams, buses, boats and cable cars between any two places, read a stop's live departure or arrival board with delays and platforms, find the stops nearest a point, and break a journey down leg by leg. No account or API key is required.

App · Travel & Places · 8 actions. Web page: https://docs.lodol.com/docs/integrations/swiss-transport

## Actions

### Find nearby stops

List the public transport stops closest to a point, nearest first, each with how far away it is in metres. Feed it a phone's coordinates or a place looked up elsewhere to answer 'which stop do I walk to?'.

**Inputs**

- Latitude (`latitude`, number, required): Latitude of the point to search around, between -90 and 90. Switzerland sits between about 45.8 and 47.8. From -90 to 90.
- Longitude (`longitude`, number, required): Longitude of the point to search around, between -180 and 180. Switzerland sits between about 5.9 and 10.5. From -180 to 180.
- Number of results (`max_results`, number): How many places to keep, from 1 to 50. Leave empty to keep every match the timetable returns. From 1 to 50.

**Outputs**

- `latitude` (number)
- `longitude` (number)
- `nearest_station` (object)
- `station_count` (number)
- `stations` (list)

**Example output**

```json
{
  "latitude": 47.378177,
  "longitude": 8.540192,
  "nearest_station": {
    "coordinate_type": "WGS84",
    "distance_meters": 118,
    "id": "8503000",
    "latitude": 47.378177,
    "longitude": 8.540192,
    "map_url": "https://www.openstreetmap.org/?mlat=47.378177&mlon=8.540192#map=17/47.378177/8.540192",
    "name": "Z\u00fcrich HB",
    "score": null,
    "type": "station"
  },
  "station_count": 1,
  "stations": [
    {
      "coordinate_type": "WGS84",
      "distance_meters": 118,
      "id": "8503000",
      "latitude": 47.378177,
      "longitude": 8.540192,
      "map_url": "https://www.openstreetmap.org/?mlat=47.378177&mlon=8.540192#map=17/47.378177/8.540192",
      "name": "Z\u00fcrich HB",
      "score": null,
      "type": "station"
    }
  ]
}
```

### Get arrivals

Read a stop's arrival board: the next services pulling in, each with its line, where it came from, the platform, the time and any delay (the board to check before meeting someone off a train).

**Inputs**

- Stop name (`station`, text): The stop whose board to read, by name: 'Aarau', 'Zürich HB', 'Luzern, Bahnhof'. Give this or a stop id; if you give both, the id wins.
- Stop ID (`station_id`, text): The stop whose board to read, by id: the 'id' of a result from 'Search places' or 'Find nearby stops'. Takes precedence over the stop name.
- Board time (`when`, date and time): Show the board as it stands at this moment. Leave empty for now. Also accepts Swiss local text such as '2026-03-25 17:30' or '17:30'.
- Transport modes (`transportations`, text): Only use these means of transport. Leave empty for all of them. One or more of: `train`, `tram`, `ship` (Boat), `bus`, `cableway` (Cable car, funicular or gondola).
- Number of services (`limit`, number): How many services to list, from 1 to 100. Defaults to 10. This is a soft limit: services leaving in the same minute as the last one are included too. From 1 to 100.

**Outputs**

- `arrival_count` (number)
- `arrivals` (list)
- `requested_at` (text)
- `station` (object)
- `station_id` (text)
- `station_name` (text)

**Example output**

```json
{
  "arrival_count": 1,
  "arrivals": [
    {
      "arrival": null,
      "arrival_timestamp": null,
      "capacity_1st": 1,
      "capacity_2nd": 2,
      "category": "IR",
      "category_code": 1,
      "delay_minutes": 3,
      "departure": "2026-03-25T17:32:00+01:00",
      "departure_timestamp": 1774456320,
      "destination": "Gen\u00e8ve-A\u00e9roport",
      "expected_arrival": null,
      "expected_departure": "2026-03-25T17:35:00+01:00",
      "expected_platform": null,
      "is_delayed": true,
      "line": "IR 15",
      "minutes_from_now": 12,
      "name": "IR1715",
      "number": "15",
      "operator": "SBB",
      "platform": "5",
      "station": {
        "coordinate_type": "WGS84",
        "distance_meters": null,
        "id": "8501120",
        "latitude": 46.516785,
        "longitude": 6.629086,
        "map_url": "https://www.openstreetmap.org/?mlat=46.516785&mlon=6.629086#map=17/46.516785/6.629086",
        "name": "Lausanne",
        "score": null,
        "type": null
      },
      "stop_count": 12
    }
  ],
  "requested_at": "2026-03-25 17:30",
  "station": {
    "coordinate_type": "WGS84",
    "distance_meters": null,
    "id": "8500010",
    "latitude": 47.547408,
    "longitude": 7.589547,
    "map_url": "https://www.openstreetmap.org/?mlat=47.547408&mlon=7.589547#map=17/47.547408/7.589547",
    "name": "Basel SBB",
    "score": null,
    "type": "station"
  },
  "station_id": "8500010",
  "station_name": "Basel SBB"
}
```

### Get departures

Read a stop's departure board: the next services leaving, each with its line, where it is heading, the platform, the time and any delay. Name the stop or give its id, and set a time to read the board as it will stand later.

**Inputs**

- Stop name (`station`, text): The stop whose board to read, by name: 'Aarau', 'Zürich HB', 'Luzern, Bahnhof'. Give this or a stop id; if you give both, the id wins.
- Stop ID (`station_id`, text): The stop whose board to read, by id: the 'id' of a result from 'Search places' or 'Find nearby stops'. Takes precedence over the stop name.
- Board time (`when`, date and time): Show the board as it stands at this moment. Leave empty for now. Also accepts Swiss local text such as '2026-03-25 17:30' or '17:30'.
- Transport modes (`transportations`, text): Only use these means of transport. Leave empty for all of them. One or more of: `train`, `tram`, `ship` (Boat), `bus`, `cableway` (Cable car, funicular or gondola).
- Number of services (`limit`, number): How many services to list, from 1 to 100. Defaults to 10. This is a soft limit: services leaving in the same minute as the last one are included too. From 1 to 100.

**Outputs**

- `departure_count` (number)
- `departures` (list)
- `requested_at` (text)
- `station` (object)
- `station_id` (text)
- `station_name` (text)

**Example output**

```json
{
  "departure_count": 1,
  "departures": [
    {
      "arrival": null,
      "arrival_timestamp": null,
      "capacity_1st": 1,
      "capacity_2nd": 2,
      "category": "IR",
      "category_code": 1,
      "delay_minutes": 3,
      "departure": "2026-03-25T17:32:00+01:00",
      "departure_timestamp": 1774456320,
      "destination": "Gen\u00e8ve-A\u00e9roport",
      "expected_arrival": null,
      "expected_departure": "2026-03-25T17:35:00+01:00",
      "expected_platform": null,
      "is_delayed": true,
      "line": "IR 15",
      "minutes_from_now": 12,
      "name": "IR1715",
      "number": "15",
      "operator": "SBB",
      "platform": "5",
      "station": {
        "coordinate_type": "WGS84",
        "distance_meters": null,
        "id": "8501120",
        "latitude": 46.516785,
        "longitude": 6.629086,
        "map_url": "https://www.openstreetmap.org/?mlat=46.516785&mlon=6.629086#map=17/46.516785/6.629086",
        "name": "Lausanne",
        "score": null,
        "type": null
      },
      "stop_count": 12
    }
  ],
  "requested_at": "2026-03-25 17:30",
  "station": {
    "coordinate_type": "WGS84",
    "distance_meters": null,
    "id": "8500010",
    "latitude": 47.547408,
    "longitude": 7.589547,
    "map_url": "https://www.openstreetmap.org/?mlat=47.547408&mlon=7.589547#map=17/47.547408/7.589547",
    "name": "Basel SBB",
    "score": null,
    "type": "station"
  },
  "station_id": "8500010",
  "station_name": "Basel SBB"
}
```

### Get journey details

Break one journey down leg by leg: every train, bus, boat or walk it is made of, with the line, the direction, the platforms, the times, and every stop each leg calls at. Use 'Which connection' to detail a later option from the same search.

**Inputs**

- From (`from_location`, text, required): Where the journey starts: a stop name ('Lausanne', 'Zürich, Bahnhofstrasse'), a full address, or the station id returned by 'Search places'.
- To (`to_location`, text, required): Where the journey ends: a stop name, an address, or a station id.
- Departure time (`departure_time`, date and time): When to travel. Leave empty to search from now. Also accepts Swiss local text from an earlier step, such as '2026-03-25 17:30', '2026-03-25' or '17:30'.
- Treat the time as the arrival time (`is_arrival_time`, true/false): Turn on to search for journeys that arrive by the given time instead of leaving after it. Off by default. Default: `false`.
- Via (`via`, list): Stops the journey must pass through, at most five. Accepts a list or a comma-separated string.
- Transport modes (`transportations`, text): Only use these means of transport. Leave empty for all of them. One or more of: `train`, `tram`, `ship` (Boat), `bus`, `cableway` (Cable car, funicular or gondola).
- Which connection (`connection_index`, number): Which journey of the search to detail, counting from 0 for the first one. Defaults to 0. From 0 to 15.

**Outputs**

- `arrival` (text)
- `connection` (object)
- `connection_index` (number)
- `departure` (text)
- `duration_minutes` (number)
- `from_station` (text)
- `leg_count` (number)
- `legs` (list)
- `to_station` (text)
- `transfers` (number)
- `walk_leg_count` (number)

**Example output**

```json
{
  "arrival": "2026-03-25T18:20:00+01:00",
  "connection": {
    "arrival": "2026-03-25T18:20:00+01:00",
    "arrival_platform": "3",
    "arrival_timestamp": 1774459200,
    "capacity_1st": 1,
    "capacity_2nd": 2,
    "delay_minutes": 3,
    "departure": "2026-03-25T17:32:00+01:00",
    "departure_timestamp": 1774456320,
    "duration": "00d00:48:00",
    "duration_minutes": 48,
    "from": {
      "arrival": null,
      "arrival_timestamp": null,
      "capacity_1st": 1,
      "capacity_2nd": 2,
      "delay_minutes": 3,
      "departure": "2026-03-25T17:32:00+01:00",
      "departure_timestamp": 1774456320,
      "expected_arrival": null,
      "expected_departure": "2026-03-25T17:35:00+01:00",
      "expected_platform": null,
      "is_delayed": true,
      "platform": "5",
      "station": {
        "coordinate_type": "WGS84",
        "distance_meters": null,
        "id": "8501120",
        "latitude": 46.516785,
        "longitude": 6.629086,
        "map_url": "https://www.openstreetmap.org/?mlat=46.516785&mlon=6.629086#map=17/46.516785/6.629086",
        "name": "Lausanne",
        "score": null,
        "type": null
      },
      "station_name": "Lausanne"
    },
    "from_station": "Lausanne",
    "is_delayed": true,
    "leg_count": 1,
    "legs": [
      {
        "arrival": "2026-03-25T18:20:00+01:00",
        "arrival_platform": "3",
        "category": "IR",
        "delay_minutes": 3,
        "departure": "2026-03-25T17:32:00+01:00",
        "destination": "Gen\u00e8ve-A\u00e9roport",
        "duration_minutes": 48,
        "from": {
          "arrival": null,
          "arrival_timestamp": null,
          "capacity_1st": 1,
          "capacity_2nd": 2,
          "delay_minutes": 3,
          "departure": "2026-03-25T17:32:00+01:00",
          "departure_timestamp": 1774456320,
          "expected_arrival": null,
          "expected_departure": "2026-03-25T17:35:00+01:00",
          "expected_platform": null,
          "is_delayed": true,
          "platform": "5",
          "station": {
            "coordinate_type": "WGS84",
            "distance_meters": null,
            "id": "8501120",
            "latitude": 46.516785,
            "longitude": 6.629086,
            "map_url": "https://www.openstreetmap.org/?mlat=46.516785&mlon=6.629086#map=17/46.516785/6.629086",
            "name": "Lausanne",
            "score": null,
            "type": null
          },
          "station_name": "Lausanne"
        },
        "from_station": "Lausanne",
        "is_delayed": true,
        "journey": {
          "capacity_1st": 1,
          "capacity_2nd": 2,
          "category": "IR",
          "category_code": 1,
          "destination": "Gen\u00e8ve-A\u00e9roport",
          "line": "IR 15",
          "name": "IR 1715",
          "number": "15",
          "operator": "SBB",
          "stop_count": 4
        },
        "line": "IR 15",
        "number": "15",
        "operator": "SBB",
        "platform": "5",
        "to": {
          "arrival": "2026-03-25T18:20:00+01:00",
          "arrival_timestamp": 1774459200,
          "capacity_1st": null,
          "capacity_2nd": null,
          "delay_minutes": null,
          "departure": null,
          "departure_timestamp": null,
          "expected_arrival": null,
          "expected_departure": null,
          "expected_platform": null,
          "is_delayed": false,
          "platform": "3",
          "station": {
            "coordinate_type": "WGS84",
            "distance_meters": null,
            "id": "8501008",
            "latitude": 46.210217,
            "longitude": 6.142437,
            "map_url": "https://www.openstreetmap.org/?mlat=46.210217&mlon=6.142437#map=17/46.210217/6.142437",
            "name": "Gen\u00e8ve",
            "score": null,
            "type": null
          },
          "station_name": "Gen\u00e8ve"
        },
        "to_station": "Gen\u00e8ve",
        "type": "journey",
        "walk": null
      }
    ],
    "minutes_from_now": 12,
    "platform": "5",
    "products": [
      "IR"
    ],
    "service": {
      "irregular": null,
      "regular": "daily"
    },
    "to": {
      "arrival": "2026-03-25T18:20:00+01:00",
      "arrival_timestamp": 1774459200,
      "capacity_1st": null,
      "capacity_2nd": null,
      "delay_minutes": null,
      "departure": null,
      "departure_timestamp": null,
      "expected_arrival": null,
      "expected_departure": null,
      "expected_platform": null,
      "is_delayed": false,
      "platform": "3",
      "station": {
        "coordinate_type": "WGS84",
        "distance_meters": null,
        "id": "8501008",
        "latitude": 46.210217,
        "longitude": 6.142437,
        "map_url": "https://www.openstreetmap.org/?mlat=46.210217&mlon=6.142437#map=17/46.210217/6.142437",
        "name": "Gen\u00e8ve",
        "score": null,
        "type": null
      },
      "station_name": "Gen\u00e8ve"
    },
    "to_station": "Gen\u00e8ve",
    "transfers": 0
  },
  "connection_index": 0,
  "departure": "2026-03-25T17:32:00+01:00",
  "duration_minutes": 48,
  "from_station": "Lausanne",
  "leg_count": 1,
  "legs": [
    {
      "arrival": "2026-03-25T18:20:00+01:00",
      "arrival_platform": "3",
      "category": "IR",
      "delay_minutes": 3,
      "departure": "2026-03-25T17:32:00+01:00",
      "destination": "Gen\u00e8ve-A\u00e9roport",
      "duration_minutes": 48,
      "from": {
        "arrival": null,
        "arrival_timestamp": null,
        "capacity_1st": 1,
        "capacity_2nd": 2,
        "delay_minutes": 3,
        "departure": "2026-03-25T17:32:00+01:00",
        "departure_timestamp": 1774456320,
        "expected_arrival": null,
        "expected_departure": "2026-03-25T17:35:00+01:00",
        "expected_platform": null,
        "is_delayed": true,
        "platform": "5",
        "station": {
          "coordinate_type": "WGS84",
          "distance_meters": null,
          "id": "8501120",
          "latitude": 46.516785,
          "longitude": 6.629086,
          "map_url": "https://www.openstreetmap.org/?mlat=46.516785&mlon=6.629086#map=17/46.516785/6.629086",
          "name": "Lausanne",
          "score": null,
          "type": null
        },
        "station_name": "Lausanne"
      },
      "from_station": "Lausanne",
      "is_delayed": true,
      "journey": {
        "capacity_1st": 1,
        "capacity_2nd": 2,
        "category": "IR",
        "category_code": 1,
        "destination": "Gen\u00e8ve-A\u00e9roport",
        "line": "IR 15",
        "name": "IR 1715",
        "number": "15",
        "operator": "SBB",
        "stop_count": 4
      },
      "line": "IR 15",
      "number": "15",
      "operator": "SBB",
      "platform": "5",
      "to": {
        "arrival": "2026-03-25T18:20:00+01:00",
        "arrival_timestamp": 1774459200,
        "capacity_1st": null,
        "capacity_2nd": null,
        "delay_minutes": null,
        "departure": null,
        "departure_timestamp": null,
        "expected_arrival": null,
        "expected_departure": null,
        "expected_platform": null,
        "is_delayed": false,
        "platform": "3",
        "station": {
          "coordinate_type": "WGS84",
          "distance_meters": null,
          "id": "8501008",
          "latitude": 46.210217,
          "longitude": 6.142437,
          "map_url": "https://www.openstreetmap.org/?mlat=46.210217&mlon=6.142437#map=17/46.210217/6.142437",
          "name": "Gen\u00e8ve",
          "score": null,
          "type": null
        },
        "station_name": "Gen\u00e8ve"
      },
      "to_station": "Gen\u00e8ve",
      "type": "journey",
      "walk": null
    }
  ],
  "to_station": "Gen\u00e8ve",
  "transfers": 0,
  "walk_leg_count": 0
}
```

### Get last connection

Find the latest journey that still gets you there by a given time (the last train home). Searches by arrival time, drops anything that would arrive late, and returns the one that leaves last, so you also learn the time to leave by.

**Inputs**

- From (`from_location`, text, required): Where the journey starts: a stop name ('Lausanne', 'Zürich, Bahnhofstrasse'), a full address, or the station id returned by 'Search places'.
- To (`to_location`, text, required): Where the journey ends: a stop name, an address, or a station id.
- Arrive by (`arrive_by`, date and time, required): The time you need to be there. A date on its own means the end of that day. Also accepts Swiss local text such as '2026-03-25 23:30' or '23:30'.
- Via (`via`, list): Stops the journey must pass through, at most five. Accepts a list or a comma-separated string.
- Transport modes (`transportations`, text): Only use these means of transport. Leave empty for all of them. One or more of: `train`, `tram`, `ship` (Boat), `bus`, `cableway` (Cable car, funicular or gondola).

**Outputs**

- `arrival` (text)
- `arrive_by` (text)
- `candidates_considered` (number)
- `connection` (object)
- `departure` (text)
- `duration_minutes` (number)
- `found` (true/false)
- `from_station` (text)
- `minutes_from_now` (number)
- `platform` (text)
- `to_station` (text)
- `transfers` (number)

**Example output**

```json
{
  "arrival": "2026-03-25T23:20:00+01:00",
  "arrive_by": "2026-03-25 23:30",
  "candidates_considered": 16,
  "connection": {
    "arrival": "2026-03-25T18:20:00+01:00",
    "arrival_platform": "3",
    "arrival_timestamp": 1774459200,
    "capacity_1st": 1,
    "capacity_2nd": 2,
    "delay_minutes": 3,
    "departure": "2026-03-25T17:32:00+01:00",
    "departure_timestamp": 1774456320,
    "duration": "00d00:48:00",
    "duration_minutes": 48,
    "from": {
      "arrival": null,
      "arrival_timestamp": null,
      "capacity_1st": 1,
      "capacity_2nd": 2,
      "delay_minutes": 3,
      "departure": "2026-03-25T17:32:00+01:00",
      "departure_timestamp": 1774456320,
      "expected_arrival": null,
      "expected_departure": "2026-03-25T17:35:00+01:00",
      "expected_platform": null,
      "is_delayed": true,
      "platform": "5",
      "station": {
        "coordinate_type": "WGS84",
        "distance_meters": null,
        "id": "8501120",
        "latitude": 46.516785,
        "longitude": 6.629086,
        "map_url": "https://www.openstreetmap.org/?mlat=46.516785&mlon=6.629086#map=17/46.516785/6.629086",
        "name": "Lausanne",
        "score": null,
        "type": null
      },
      "station_name": "Lausanne"
    },
    "from_station": "Lausanne",
    "is_delayed": true,
    "leg_count": 1,
    "legs": [
      {
        "arrival": "2026-03-25T18:20:00+01:00",
        "arrival_platform": "3",
        "category": "IR",
        "delay_minutes": 3,
        "departure": "2026-03-25T17:32:00+01:00",
        "destination": "Gen\u00e8ve-A\u00e9roport",
        "duration_minutes": 48,
        "from": {
          "arrival": null,
          "arrival_timestamp": null,
          "capacity_1st": 1,
          "capacity_2nd": 2,
          "delay_minutes": 3,
          "departure": "2026-03-25T17:32:00+01:00",
          "departure_timestamp": 1774456320,
          "expected_arrival": null,
          "expected_departure": "2026-03-25T17:35:00+01:00",
          "expected_platform": null,
          "is_delayed": true,
          "platform": "5",
          "station": {
            "coordinate_type": "WGS84",
            "distance_meters": null,
            "id": "8501120",
            "latitude": 46.516785,
            "longitude": 6.629086,
            "map_url": "https://www.openstreetmap.org/?mlat=46.516785&mlon=6.629086#map=17/46.516785/6.629086",
            "name": "Lausanne",
            "score": null,
            "type": null
          },
          "station_name": "Lausanne"
        },
        "from_station": "Lausanne",
        "is_delayed": true,
        "journey": {
          "capacity_1st": 1,
          "capacity_2nd": 2,
          "category": "IR",
          "category_code": 1,
          "destination": "Gen\u00e8ve-A\u00e9roport",
          "line": "IR 15",
          "name": "IR 1715",
          "number": "15",
          "operator": "SBB",
          "stop_count": 4
        },
        "line": "IR 15",
        "number": "15",
        "operator": "SBB",
        "platform": "5",
        "to": {
          "arrival": "2026-03-25T18:20:00+01:00",
          "arrival_timestamp": 1774459200,
          "capacity_1st": null,
          "capacity_2nd": null,
          "delay_minutes": null,
          "departure": null,
          "departure_timestamp": null,
          "expected_arrival": null,
          "expected_departure": null,
          "expected_platform": null,
          "is_delayed": false,
          "platform": "3",
          "station": {
            "coordinate_type": "WGS84",
            "distance_meters": null,
            "id": "8501008",
            "latitude": 46.210217,
            "longitude": 6.142437,
            "map_url": "https://www.openstreetmap.org/?mlat=46.210217&mlon=6.142437#map=17/46.210217/6.142437",
            "name": "Gen\u00e8ve",
            "score": null,
            "type": null
          },
          "station_name": "Gen\u00e8ve"
        },
        "to_station": "Gen\u00e8ve",
        "type": "journey",
        "walk": null
      }
    ],
    "minutes_from_now": 12,
    "platform": "5",
    "products": [
      "IR"
    ],
    "service": {
      "irregular": null,
      "regular": "daily"
    },
    "to": {
      "arrival": "2026-03-25T18:20:00+01:00",
      "arrival_timestamp": 1774459200,
      "capacity_1st": null,
      "capacity_2nd": null,
      "delay_minutes": null,
      "departure": null,
      "departure_timestamp": null,
      "expected_arrival": null,
      "expected_departure": null,
      "expected_platform": null,
      "is_delayed": false,
      "platform": "3",
      "station": {
        "coordinate_type": "WGS84",
        "distance_meters": null,
        "id": "8501008",
        "latitude": 46.210217,
        "longitude": 6.142437,
        "map_url": "https://www.openstreetmap.org/?mlat=46.210217&mlon=6.142437#map=17/46.210217/6.142437",
        "name": "Gen\u00e8ve",
        "score": null,
        "type": null
      },
      "station_name": "Gen\u00e8ve"
    },
    "to_station": "Gen\u00e8ve",
    "transfers": 0
  },
  "departure": "2026-03-25T22:32:00+01:00",
  "duration_minutes": 48,
  "found": true,
  "from_station": "Lausanne",
  "minutes_from_now": 47,
  "platform": "5",
  "to_station": "Gen\u00e8ve",
  "transfers": 0
}
```

### Get next departure

Answer 'when is the next one?' for a trip: the next journey leaving now from one place to another, with how many minutes away it is, its platform, any delay, and how long it takes. Returns 'found: false' when nothing more runs today rather than failing the step.

**Inputs**

- From (`from_location`, text, required): Where the journey starts: a stop name ('Lausanne', 'Zürich, Bahnhofstrasse'), a full address, or the station id returned by 'Search places'.
- To (`to_location`, text, required): Where the journey ends: a stop name, an address, or a station id.
- Via (`via`, list): Stops the journey must pass through, at most five. Accepts a list or a comma-separated string.
- Transport modes (`transportations`, text): Only use these means of transport. Leave empty for all of them. One or more of: `train`, `tram`, `ship` (Boat), `bus`, `cableway` (Cable car, funicular or gondola).

**Outputs**

- `arrival` (text)
- `connection` (object)
- `delay_minutes` (number)
- `departure` (text)
- `duration_minutes` (number)
- `found` (true/false)
- `from_station` (text)
- `is_delayed` (true/false)
- `minutes_from_now` (number)
- `platform` (text)
- `products` (list)
- `to_station` (text)
- `transfers` (number)

**Example output**

```json
{
  "arrival": "2026-03-25T18:20:00+01:00",
  "connection": {
    "arrival": "2026-03-25T18:20:00+01:00",
    "arrival_platform": "3",
    "arrival_timestamp": 1774459200,
    "capacity_1st": 1,
    "capacity_2nd": 2,
    "delay_minutes": 3,
    "departure": "2026-03-25T17:32:00+01:00",
    "departure_timestamp": 1774456320,
    "duration": "00d00:48:00",
    "duration_minutes": 48,
    "from": {
      "arrival": null,
      "arrival_timestamp": null,
      "capacity_1st": 1,
      "capacity_2nd": 2,
      "delay_minutes": 3,
      "departure": "2026-03-25T17:32:00+01:00",
      "departure_timestamp": 1774456320,
      "expected_arrival": null,
      "expected_departure": "2026-03-25T17:35:00+01:00",
      "expected_platform": null,
      "is_delayed": true,
      "platform": "5",
      "station": {
        "coordinate_type": "WGS84",
        "distance_meters": null,
        "id": "8501120",
        "latitude": 46.516785,
        "longitude": 6.629086,
        "map_url": "https://www.openstreetmap.org/?mlat=46.516785&mlon=6.629086#map=17/46.516785/6.629086",
        "name": "Lausanne",
        "score": null,
        "type": null
      },
      "station_name": "Lausanne"
    },
    "from_station": "Lausanne",
    "is_delayed": true,
    "leg_count": 1,
    "legs": [
      {
        "arrival": "2026-03-25T18:20:00+01:00",
        "arrival_platform": "3",
        "category": "IR",
        "delay_minutes": 3,
        "departure": "2026-03-25T17:32:00+01:00",
        "destination": "Gen\u00e8ve-A\u00e9roport",
        "duration_minutes": 48,
        "from": {
          "arrival": null,
          "arrival_timestamp": null,
          "capacity_1st": 1,
          "capacity_2nd": 2,
          "delay_minutes": 3,
          "departure": "2026-03-25T17:32:00+01:00",
          "departure_timestamp": 1774456320,
          "expected_arrival": null,
          "expected_departure": "2026-03-25T17:35:00+01:00",
          "expected_platform": null,
          "is_delayed": true,
          "platform": "5",
          "station": {
            "coordinate_type": "WGS84",
            "distance_meters": null,
            "id": "8501120",
            "latitude": 46.516785,
            "longitude": 6.629086,
            "map_url": "https://www.openstreetmap.org/?mlat=46.516785&mlon=6.629086#map=17/46.516785/6.629086",
            "name": "Lausanne",
            "score": null,
            "type": null
          },
          "station_name": "Lausanne"
        },
        "from_station": "Lausanne",
        "is_delayed": true,
        "journey": {
          "capacity_1st": 1,
          "capacity_2nd": 2,
          "category": "IR",
          "category_code": 1,
          "destination": "Gen\u00e8ve-A\u00e9roport",
          "line": "IR 15",
          "name": "IR 1715",
          "number": "15",
          "operator": "SBB",
          "stop_count": 4
        },
        "line": "IR 15",
        "number": "15",
        "operator": "SBB",
        "platform": "5",
        "to": {
          "arrival": "2026-03-25T18:20:00+01:00",
          "arrival_timestamp": 1774459200,
          "capacity_1st": null,
          "capacity_2nd": null,
          "delay_minutes": null,
          "departure": null,
          "departure_timestamp": null,
          "expected_arrival": null,
          "expected_departure": null,
          "expected_platform": null,
          "is_delayed": false,
          "platform": "3",
          "station": {
            "coordinate_type": "WGS84",
            "distance_meters": null,
            "id": "8501008",
            "latitude": 46.210217,
            "longitude": 6.142437,
            "map_url": "https://www.openstreetmap.org/?mlat=46.210217&mlon=6.142437#map=17/46.210217/6.142437",
            "name": "Gen\u00e8ve",
            "score": null,
            "type": null
          },
          "station_name": "Gen\u00e8ve"
        },
        "to_station": "Gen\u00e8ve",
        "type": "journey",
        "walk": null
      }
    ],
    "minutes_from_now": 12,
    "platform": "5",
    "products": [
      "IR"
    ],
    "service": {
      "irregular": null,
      "regular": "daily"
    },
    "to": {
      "arrival": "2026-03-25T18:20:00+01:00",
      "arrival_timestamp": 1774459200,
      "capacity_1st": null,
      "capacity_2nd": null,
      "delay_minutes": null,
      "departure": null,
      "departure_timestamp": null,
      "expected_arrival": null,
      "expected_departure": null,
      "expected_platform": null,
      "is_delayed": false,
      "platform": "3",
      "station": {
        "coordinate_type": "WGS84",
        "distance_meters": null,
        "id": "8501008",
        "latitude": 46.210217,
        "longitude": 6.142437,
        "map_url": "https://www.openstreetmap.org/?mlat=46.210217&mlon=6.142437#map=17/46.210217/6.142437",
        "name": "Gen\u00e8ve",
        "score": null,
        "type": null
      },
      "station_name": "Gen\u00e8ve"
    },
    "to_station": "Gen\u00e8ve",
    "transfers": 0
  },
  "delay_minutes": 3,
  "departure": "2026-03-25T17:32:00+01:00",
  "duration_minutes": 48,
  "found": true,
  "from_station": "Lausanne",
  "is_delayed": true,
  "minutes_from_now": 12,
  "platform": "5",
  "products": [
    "IR"
  ],
  "to_station": "Gen\u00e8ve",
  "transfers": 0
}
```

### Search connections

Plan a journey between two places on the Swiss timetable. Each result carries the departure and arrival times, platforms, how long it takes, how many changes it needs, which lines it uses and any delay reported right now. Search from a departure time or, with 'Treat the time as the arrival time', backwards from when you need to be there.

**Inputs**

- From (`from_location`, text, required): Where the journey starts: a stop name ('Lausanne', 'Zürich, Bahnhofstrasse'), a full address, or the station id returned by 'Search places'.
- To (`to_location`, text, required): Where the journey ends: a stop name, an address, or a station id.
- Via (`via`, list): Stops the journey must pass through, at most five. Accepts a list or a comma-separated string.
- Departure time (`departure_time`, date and time): When to travel. Leave empty to search from now. Also accepts Swiss local text from an earlier step, such as '2026-03-25 17:30', '2026-03-25' or '17:30'.
- Treat the time as the arrival time (`is_arrival_time`, true/false): Turn on to search for journeys that arrive by the given time instead of leaving after it. Off by default. Default: `false`.
- Transport modes (`transportations`, text): Only use these means of transport. Leave empty for all of them. One or more of: `train`, `tram`, `ship` (Boat), `bus`, `cableway` (Cable car, funicular or gondola).
- Number of connections (`limit`, number): How many journeys to return, from 1 to 16. Journeys leaving at the same minute count as one. Defaults to the API's own handful. From 1 to 16.
- Page (`page`, number): Which page of journeys to return, 0 to 3. Page 0 is the first. Feed the 'next_page' value from a previous run back in here to look further ahead. From 0 to 3.

**Outputs**

- `connection_count` (number)
- `connections` (list)
- `from_station` (text)
- `is_arrival_time` (true/false)
- `next_page` (number)
- `page` (number)
- `to_station` (text)

**Example output**

```json
{
  "connection_count": 1,
  "connections": [
    {
      "arrival": "2026-03-25T18:20:00+01:00",
      "arrival_platform": "3",
      "arrival_timestamp": 1774459200,
      "capacity_1st": 1,
      "capacity_2nd": 2,
      "delay_minutes": 3,
      "departure": "2026-03-25T17:32:00+01:00",
      "departure_timestamp": 1774456320,
      "duration": "00d00:48:00",
      "duration_minutes": 48,
      "from": {
        "arrival": null,
        "arrival_timestamp": null,
        "capacity_1st": 1,
        "capacity_2nd": 2,
        "delay_minutes": 3,
        "departure": "2026-03-25T17:32:00+01:00",
        "departure_timestamp": 1774456320,
        "expected_arrival": null,
        "expected_departure": "2026-03-25T17:35:00+01:00",
        "expected_platform": null,
        "is_delayed": true,
        "platform": "5",
        "station": {
          "coordinate_type": "WGS84",
          "distance_meters": null,
          "id": "8501120",
          "latitude": 46.516785,
          "longitude": 6.629086,
          "map_url": "https://www.openstreetmap.org/?mlat=46.516785&mlon=6.629086#map=17/46.516785/6.629086",
          "name": "Lausanne",
          "score": null,
          "type": null
        },
        "station_name": "Lausanne"
      },
      "from_station": "Lausanne",
      "is_delayed": true,
      "leg_count": 1,
      "legs": [
        {
          "arrival": "2026-03-25T18:20:00+01:00",
          "arrival_platform": "3",
          "category": "IR",
          "delay_minutes": 3,
          "departure": "2026-03-25T17:32:00+01:00",
          "destination": "Gen\u00e8ve-A\u00e9roport",
          "duration_minutes": 48,
          "from": {
            "arrival": null,
            "arrival_timestamp": null,
            "capacity_1st": 1,
            "capacity_2nd": 2,
            "delay_minutes": 3,
            "departure": "2026-03-25T17:32:00+01:00",
            "departure_timestamp": 1774456320,
            "expected_arrival": null,
            "expected_departure": "2026-03-25T17:35:00+01:00",
            "expected_platform": null,
            "is_delayed": true,
            "platform": "5",
            "station": {
              "coordinate_type": "WGS84",
              "distance_meters": null,
              "id": "8501120",
              "latitude": 46.516785,
              "longitude": 6.629086,
              "map_url": "https://www.openstreetmap.org/?mlat=46.516785&mlon=6.629086#map=17/46.516785/6.629086",
              "name": "Lausanne",
              "score": null,
              "type": null
            },
            "station_name": "Lausanne"
          },
          "from_station": "Lausanne",
          "is_delayed": true,
          "journey": {
            "capacity_1st": 1,
            "capacity_2nd": 2,
            "category": "IR",
            "category_code": 1,
            "destination": "Gen\u00e8ve-A\u00e9roport",
            "line": "IR 15",
            "name": "IR 1715",
            "number": "15",
            "operator": "SBB",
            "stop_count": 4
          },
          "line": "IR 15",
          "number": "15",
          "operator": "SBB",
          "platform": "5",
          "to": {
            "arrival": "2026-03-25T18:20:00+01:00",
            "arrival_timestamp": 1774459200,
            "capacity_1st": null,
            "capacity_2nd": null,
            "delay_minutes": null,
            "departure": null,
            "departure_timestamp": null,
            "expected_arrival": null,
            "expected_departure": null,
            "expected_platform": null,
            "is_delayed": false,
            "platform": "3",
            "station": {
              "coordinate_type": "WGS84",
              "distance_meters": null,
              "id": "8501008",
              "latitude": 46.210217,
              "longitude": 6.142437,
              "map_url": "https://www.openstreetmap.org/?mlat=46.210217&mlon=6.142437#map=17/46.210217/6.142437",
              "name": "Gen\u00e8ve",
              "score": null,
              "type": null
            },
            "station_name": "Gen\u00e8ve"
          },
          "to_station": "Gen\u00e8ve",
          "type": "journey",
          "walk": null
        }
      ],
      "minutes_from_now": 12,
      "platform": "5",
      "products": [
        "IR"
      ],
      "service": {
        "irregular": null,
        "regular": "daily"
      },
      "to": {
        "arrival": "2026-03-25T18:20:00+01:00",
        "arrival_timestamp": 1774459200,
        "capacity_1st": null,
        "capacity_2nd": null,
        "delay_minutes": null,
        "departure": null,
        "departure_timestamp": null,
        "expected_arrival": null,
        "expected_departure": null,
        "expected_platform": null,
        "is_delayed": false,
        "platform": "3",
        "station": {
          "coordinate_type": "WGS84",
          "distance_meters": null,
          "id": "8501008",
          "latitude": 46.210217,
          "longitude": 6.142437,
          "map_url": "https://www.openstreetmap.org/?mlat=46.210217&mlon=6.142437#map=17/46.210217/6.142437",
          "name": "Gen\u00e8ve",
          "score": null,
          "type": null
        },
        "station_name": "Gen\u00e8ve"
      },
      "to_station": "Gen\u00e8ve",
      "transfers": 0
    }
  ],
  "from_station": "Lausanne",
  "is_arrival_time": false,
  "next_page": 1,
  "page": 0,
  "to_station": "Gen\u00e8ve"
}
```

### Search places

Find Swiss stations, stops, points of interest and addresses by name, best match first. Use it to turn 'Basel' into the exact stop name and id the other actions take, and to get a place's coordinates.

**Inputs**

- Search text (`query`, text, required): The place to look for. A partial name works: 'Basel' matches Basel SBB, Basel Bad Bf and the rest.
- Kind of place (`location_type`, text): Narrow the search to one kind of place. Defaults to everything. One of: `all` (Everything (default)), `station` (Stations and stops only), `poi` (Points of interest only), `address` (Addresses only).
- Number of results (`max_results`, number): How many places to keep, from 1 to 50. Leave empty to keep every match the timetable returns. From 1 to 50.

**Outputs**

- `location_count` (number)
- `location_type` (text)
- `locations` (list)
- `needs_refinement` (true/false)
- `query` (text)
- `top_match` (object)

**Example output**

```json
{
  "location_count": 1,
  "location_type": "all",
  "locations": [
    {
      "coordinate_type": "WGS84",
      "distance_meters": null,
      "id": "8500010",
      "latitude": 47.547408,
      "longitude": 7.589547,
      "map_url": "https://www.openstreetmap.org/?mlat=47.547408&mlon=7.589547#map=17/47.547408/7.589547",
      "name": "Basel SBB",
      "score": null,
      "type": "station"
    }
  ],
  "needs_refinement": false,
  "query": "Basel",
  "top_match": {
    "coordinate_type": "WGS84",
    "distance_meters": null,
    "id": "8500010",
    "latitude": 47.547408,
    "longitude": 7.589547,
    "map_url": "https://www.openstreetmap.org/?mlat=47.547408&mlon=7.589547#map=17/47.547408/7.589547",
    "name": "Basel SBB",
    "score": null,
    "type": "station"
  }
}
```
