Swiss Transport

App · Travel & Places · 8 actions

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.

Actions

ActionWhat it does
Find nearby stopsList the public transport stops closest to a point, nearest first, each with how far away it is in meters.
Get arrivalsRead a stop's arrival board: the next services pulling in, each with its line, the time it gets in, the platform, any delay and its final destination (the board to check before meeting someone off a train).
Get departuresRead a stop's departure board: the next services leaving, each with its line, where it is heading, the platform, the time and any delay.
Get journey detailsBreak 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.
Get last connectionFind the latest journey that still gets you there by a given time (the last train home).
Get next departureAnswer '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.
Search connectionsPlan a journey between two places on the Swiss timetable.
Search placesFind Swiss stations, stops, points of interest and addresses by name, best match first.

Find nearby stops

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

Inputs

LatitudelatitudenumberRequired
Latitude of the point to search around, between -90 and 90. Switzerland sits between about 45.8 and 47.8.From -90 to 90.
LongitudelongitudenumberRequired
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 resultsmax_resultsnumber
How many places to keep, from 1 to 50. The timetable returns at most 10, so leave it empty to keep every match.From 1 to 50.

Outputs

latitudenumber
longitudenumber
nearest_stationobject
station_countnumber
stationslist
Example output
{
  "latitude": 47.378177,
  "longitude": 8.540192,
  "nearest_station": {
    "coordinate_type": "WGS84",
    "distance_meters": 118,
    "id": "8503000",
    "latitude": 47.378176,
    "longitude": 8.540212,
    "map_url": "https://www.openstreetmap.org/?mlat=47.378176&mlon=8.540212#map=17/47.378176/8.540212",
    "name": "Z\u00fcrich HB",
    "score": null,
    "transport_mode": "train",
    "type": "station"
  },
  "station_count": 1,
  "stations": [
    {
      "coordinate_type": "WGS84",
      "distance_meters": 118,
      "id": "8503000",
      "latitude": 47.378176,
      "longitude": 8.540212,
      "map_url": "https://www.openstreetmap.org/?mlat=47.378176&mlon=8.540212#map=17/47.378176/8.540212",
      "name": "Z\u00fcrich HB",
      "score": null,
      "transport_mode": "train",
      "type": "station"
    }
  ]
}

Get arrivals

Read a stop's arrival board: the next services pulling in, each with its line, the time it gets in, the platform, any delay and its final destination (the board to check before meeting someone off a train). The timetable doesn't say where each service started.

Inputs

Stop namestationtext
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 IDstation_idtext
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 timewhendate 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 modestransportationslist
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 serviceslimitnumber
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_countnumber
arrivalslist
requested_attext
stationobject
station_idtext
station_nametext
Example output
{
  "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,
        "transport_mode": null,
        "type": "station"
      },
      "stop_count": 12
    }
  ],
  "requested_at": "2026-03-25 17:30",
  "station": {
    "coordinate_type": "WGS84",
    "distance_meters": null,
    "id": "8500010",
    "latitude": 47.547413,
    "longitude": 7.58956,
    "map_url": "https://www.openstreetmap.org/?mlat=47.547413&mlon=7.58956#map=17/47.547413/7.58956",
    "name": "Basel SBB",
    "score": null,
    "transport_mode": "train",
    "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 namestationtext
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 IDstation_idtext
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 timewhendate 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 modestransportationslist
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 serviceslimitnumber
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_countnumber
departureslist
requested_attext
stationobject
station_idtext
station_nametext
Example output
{
  "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,
        "transport_mode": null,
        "type": "station"
      },
      "stop_count": 12
    }
  ],
  "requested_at": "2026-03-25 17:30",
  "station": {
    "coordinate_type": "WGS84",
    "distance_meters": null,
    "id": "8500010",
    "latitude": 47.547413,
    "longitude": 7.58956,
    "map_url": "https://www.openstreetmap.org/?mlat=47.547413&mlon=7.58956#map=17/47.547413/7.58956",
    "name": "Basel SBB",
    "score": null,
    "transport_mode": "train",
    "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

Fromfrom_locationtextRequired
Where the journey starts: a stop name ('Lausanne', 'Zürich, Bahnhofstrasse'), a full address, a point as 'latitude,longitude' ('46.5168,6.6291'), or the station id returned by 'Search places'. From an address or a point, the journey begins with the walk to the first stop.
Toto_locationtextRequired
Where the journey ends: a stop name, an address, a point as 'latitude,longitude', or a station id.
Departure timedeparture_timedate 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 timeis_arrival_timetrue/false
Turn on to search for journeys that arrive by the given time instead of leaving after it. Off by default.Default: false.
Viavialist
Stops the journey must pass through, at most two, by stop name or id (not addresses). Accepts a list or a comma-separated string; give a stop whose name has a comma, such as 'Aarau, Bahnhof', as its own list entry or by its id.
Transport modestransportationslist
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 connectionconnection_indexnumber
Which journey of the search to detail, counting from 0 for the first one. Defaults to 0. With 'Treat the time as the arrival time' on, 0 is the journey that arrives last by that time, 1 the one before it, and so on.From 0 to 15.
Allow shared bikes and scootersshared_mobilitytrue/false
Turn on to let a rented bike, e-scooter or car from the sharing schemes listed on sharedmobility.ch replace the walk to the first stop and from the last one. It matters when the journey starts or ends at an address or a point. Off by default.Default: false.

Outputs

arrivaltext
connectionobject
connection_indexnumber
departuretext
duration_minutesnumber
from_stationtext
leg_countnumber
legslist
to_stationtext
transfersnumber
walk_leg_countnumber
Example output
{
  "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,
        "transport_mode": null,
        "type": "station"
      },
      "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,
            "transport_mode": null,
            "type": "station"
          },
          "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",
        "rental": null,
        "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,
            "transport_mode": null,
            "type": "station"
          },
          "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,
        "transport_mode": null,
        "type": "station"
      },
      "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,
          "transport_mode": null,
          "type": "station"
        },
        "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",
      "rental": null,
      "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,
          "transport_mode": null,
          "type": "station"
        },
        "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

Fromfrom_locationtextRequired
Where the journey starts: a stop name ('Lausanne', 'Zürich, Bahnhofstrasse'), a full address, a point as 'latitude,longitude' ('46.5168,6.6291'), or the station id returned by 'Search places'. From an address or a point, the journey begins with the walk to the first stop.
Toto_locationtextRequired
Where the journey ends: a stop name, an address, a point as 'latitude,longitude', or a station id.
Arrive byarrive_bydate and timeRequired
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'.
Viavialist
Stops the journey must pass through, at most two, by stop name or id (not addresses). Accepts a list or a comma-separated string; give a stop whose name has a comma, such as 'Aarau, Bahnhof', as its own list entry or by its id.
Transport modestransportationslist
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

arrivaltext
arrive_bytext
candidates_considerednumber
connectionobject
departuretext
duration_minutesnumber
foundtrue/false
from_stationtext
minutes_from_nownumber
platformtext
to_stationtext
transfersnumber
Example output
{
  "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,
        "transport_mode": null,
        "type": "station"
      },
      "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,
            "transport_mode": null,
            "type": "station"
          },
          "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",
        "rental": null,
        "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,
            "transport_mode": null,
            "type": "station"
          },
          "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,
        "transport_mode": null,
        "type": "station"
      },
      "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

Fromfrom_locationtextRequired
Where the journey starts: a stop name ('Lausanne', 'Zürich, Bahnhofstrasse'), a full address, a point as 'latitude,longitude' ('46.5168,6.6291'), or the station id returned by 'Search places'. From an address or a point, the journey begins with the walk to the first stop.
Toto_locationtextRequired
Where the journey ends: a stop name, an address, a point as 'latitude,longitude', or a station id.
Viavialist
Stops the journey must pass through, at most two, by stop name or id (not addresses). Accepts a list or a comma-separated string; give a stop whose name has a comma, such as 'Aarau, Bahnhof', as its own list entry or by its id.
Transport modestransportationslist
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

arrivaltext
connectionobject
delay_minutesnumber
departuretext
duration_minutesnumber
foundtrue/false
from_stationtext
is_delayedtrue/false
minutes_from_nownumber
platformtext
productslist
to_stationtext
transfersnumber
Example output
{
  "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,
        "transport_mode": null,
        "type": "station"
      },
      "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,
            "transport_mode": null,
            "type": "station"
          },
          "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",
        "rental": null,
        "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,
            "transport_mode": null,
            "type": "station"
          },
          "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,
        "transport_mode": null,
        "type": "station"
      },
      "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

Fromfrom_locationtextRequired
Where the journey starts: a stop name ('Lausanne', 'Zürich, Bahnhofstrasse'), a full address, a point as 'latitude,longitude' ('46.5168,6.6291'), or the station id returned by 'Search places'. From an address or a point, the journey begins with the walk to the first stop.
Toto_locationtextRequired
Where the journey ends: a stop name, an address, a point as 'latitude,longitude', or a station id.
Viavialist
Stops the journey must pass through, at most two, by stop name or id (not addresses). Accepts a list or a comma-separated string; give a stop whose name has a comma, such as 'Aarau, Bahnhof', as its own list entry or by its id.
Departure timedeparture_timedate 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 timeis_arrival_timetrue/false
Turn on to search for journeys that arrive by the given time instead of leaving after it. Off by default.Default: false.
Transport modestransportationslist
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 connectionslimitnumber
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.
Pagepagenumber
Which page of journeys to return, 0 to 10. Page 0 is the first. Feed the 'next_page' value from a previous run back in here to look further ahead; it is empty when there are no more.From 0 to 10.
Allow shared bikes and scootersshared_mobilitytrue/false
Turn on to let a rented bike, e-scooter or car from the sharing schemes listed on sharedmobility.ch replace the walk to the first stop and from the last one. It matters when the journey starts or ends at an address or a point. Off by default.Default: false.

Outputs

connection_countnumber
connectionslist
from_stationtext
is_arrival_timetrue/false
next_pagenumber
pagenumber
to_stationtext
Example output
{
  "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,
          "transport_mode": null,
          "type": "station"
        },
        "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,
              "transport_mode": null,
              "type": "station"
            },
            "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",
          "rental": null,
          "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,
              "transport_mode": null,
              "type": "station"
            },
            "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,
          "transport_mode": null,
          "type": "station"
        },
        "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. Addresses and points of interest have no id, but their names work as the start or end of a journey.

Inputs

Search textquerytextRequired
The place to look for. A partial name works: 'Basel' matches Basel SBB, Basel Bad Bf and the rest.
Kind of placelocation_typetext
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 resultsmax_resultsnumber
How many places to keep, from 1 to 50. The timetable returns at most 10, so leave it empty to keep every match.From 1 to 50.

Outputs

location_countnumber
location_typetext
locationslist
needs_refinementtrue/false
querytext
top_matchobject
Example output
{
  "location_count": 1,
  "location_type": "all",
  "locations": [
    {
      "coordinate_type": "WGS84",
      "distance_meters": null,
      "id": "8500010",
      "latitude": 47.547413,
      "longitude": 7.58956,
      "map_url": "https://www.openstreetmap.org/?mlat=47.547413&mlon=7.58956#map=17/47.547413/7.58956",
      "name": "Basel SBB",
      "score": null,
      "transport_mode": "train",
      "type": "station"
    }
  ],
  "needs_refinement": false,
  "query": "Basel",
  "top_match": {
    "coordinate_type": "WGS84",
    "distance_meters": null,
    "id": "8500010",
    "latitude": 47.547413,
    "longitude": 7.58956,
    "map_url": "https://www.openstreetmap.org/?mlat=47.547413&mlon=7.58956#map=17/47.547413/7.58956",
    "name": "Basel SBB",
    "score": null,
    "transport_mode": "train",
    "type": "station"
  }
}

On this page