Transport

Swiss public transport API

API Documentation

Rate Limit

There is no fixed limit per client. The service is shared by thousands of applications, so please cache what you can: the timetable changes twice a week, real-time data every 30 seconds. An application that asks the same question every few seconds will be throttled.

API Resources

The Transport API builds on REST style resources which respond in JSON. Individual resources are detailed below. Cross Origin Resource Sharing (CORS) is enabled, so you can easily use the API on transport.opendata.ch from any website (avoid setting custom headers though).


/locations

Returns the matching locations for the given parameters. Either query or ( x and y ) are required.

The locations in the response are scored to determine which is the most exact location.

This method can return a refine response, what means that the request has to be redone.

Resource URL

http://transport.opendata.ch/v1/locations

Request Parameters

Name Required Description Example
query optional Specifies the location name to search for Basel
x optional Latitude 47.476001
y optional Longitude 8.306130
type optional With query; with x and y, station leaves out the nearest address and gives stops only. Specifies the location type, possible types are:
  • all (default): stations and stops first, then addresses and points of interest
  • station: Looks up for stations (train station, bus station)
  • poi: Looks up for points of interest (Clock tower, China garden)
  • address: Looks up for an address (Zurich Bahnhofstrasse 33)
Addresses and points of interest have no id; they can be given as from or to of a connection.
address

Response parameters

Name Description
stations A list of locations

Example Request

GET http://transport.opendata.ch/v1/locations?query=Basel

Example response

{
    "stations": [
        {
            "id": "8500010",
            "name": "Basel SBB",
            "score": null,
            "coordinate": {
                "type": "WGS84",
                "x": 47.547408,
                "y": 7.589547
            },
            "distance": null
        }
    ]
}
            

/connections

Returns the next connections from a location to another.

Resource URL

http://transport.opendata.ch/v1/connections

Request Parameters

Name Required Description Example
from required Specifies the departure location of the connection: a stop (name or id), an address, or a coordinate latitude,longitude in WGS84. From an address or a coordinate the connection begins with the walk to the first stop. Lausanne
46.5168,6.6291
to required Specifies the arrival location of the connection, in the same forms as from Genève
via optional Specifies up to two via stops. When specifying several vias, array notation (via[]=via1&via[]=via2) is required. Bern
date optional Date of the connection, in the format YYYY-MM-DD 2012-03-25
time optional Time of the connection, in the format hh:mm 17:30
isArrivalTime optional defaults to 0, if set to 1 the passed date and time is the arrival time 1
transportations optional Transportation means; one or more of train, tram, ship, bus, cableway transportations[]=tram&
transportations[]=bus
limit optional 1 - 16. Specifies the number of connections to return. If several connections depart at the same time they are counted as 1. 4
page optional 0 - 10. Allows pagination of connections. Zero-based, so first page is 0, second is 1, third is 2 and so on. -1 to -10 go back in time: page -1 is the connections just before page 0, -2 the ones before those. 3
walkingSpeed optional 2 - 10, in km/h; defaults to 5. How fast the walk from an address or a coordinate to the first stop, and from the last stop to one, is walked. Walks between two stops are the timetable's and do not change. 3.5
minTransferTime optional 0 - 60, in minutes. No change of vehicle is shorter than this, even where the timetable allows a shorter one. 10
sharedMobility optional defaults to 0; with 1, shared bikes, scooters and cars (from sharedmobility.ch) may take the place of the walk to the first stop and from the last. Such a section has a rental. 1
geometry optional defaults to 0; with 1, each section gives the line it follows on a map, in geometry. The connection search example plays a journey back on it. 1

Response parameters

Name Description
connections A list of connections

Example Requests

GET http://transport.opendata.ch/v1/connections?from=Lausanne&to=Genève

which is the same as

GET http://transport.opendata.ch/v1/connections?from=8501120&to=8501008

Example response

{
    "connections" : [
        {
            "from" : {
                "arrival" : null,
                "arrivalTimestamp" : null,
                "departure" : "2012-03-31T08:58:00+02:00",
                "departureTimestamp" : 1333177080,
                "platform" : "7",
                "prognosis" : {
                    "platform" : null,
                    "arrival" : null
                    "departure" : null
                    "capacity1st" : "-1",
                    "capacity2nd" : "-1",
                },
                "station" : {
                    "coordinate" : {
                        "type" : "WGS84",
                        "x" : 46.516785,
                        "y" : 6.629086
                    },
                    "id" : "8501120",
                    "name" : "Lausanne",
                    "score" : null
                }
            },
            "to" : {
                "arrival" : "2012-03-31T09:46:00+02:00",
                "arrivalTimestamp" : 1333179960,
                "departure" : null,
                "departureTimestamp" : null,
                "platform" : "2",
                "prognosis" : {
                    "platform" : null,
                    "arrival" : null,
                    "departure" : null
                    "capacity1st" : null,
                    "capacity2nd" : null,
                },
                "station" : {
                    "coordinate" : {
                        "type" : "WGS84",
                        "x" : 46.210217,
                        "y" : 6.142437
                    },
                    "id" : "8501008",
                    "name" : "Genève",
                    "score" : null
                }
            }
        },
    ],
    // ...
}
            

/stationboard

Returns the next connections leaving from a specific location.

Resource URL

http://transport.opendata.ch/v1/stationboard

Request Parameters

Name Required Description Example
station required Specifies the location of which a stationboard should be returned Aarau
id optional The id of the station whose stationboard should be returned.
Alternative to the station parameter; one of these two is required.
If both an id and a station are specified the id has precedence.
8503059 (for Zurich Stadelhofen)
limit optional Number of departing connections to return.
This is not a hard limit - if multiple connections leave at the same time it'll return any connections that leave at the same time as the last connection within the limit.
For example: limit=4 will return connections leaving at :
  • 19:30
  • 19:32
  • 19:32
  • 19:35
  • 19:35
Because one of the connections leaving at 19:35 is within the limit, all connections leaving at 19:35 are shown.
15
transportations optional Transportation means; one or more of train, tram, ship, bus, cableway ?transportations[]=tram&transportations[]=bus
datetime optional Date and time of departing connections, in the format YYYY-MM-DD hh:mm. 2012-03-25 17:30
type optional departure (default) or arrival arrival
showCancelled optional 1 to keep cancelled journeys, and journeys that pass the station without calling, on the board, each marked "cancelled": true (the others false). Without it they are left out and no journey carries cancelled. 1

Response parameters

Name Description
station The first matched location based on the query. The stationboard will be displayed if this is a station.
stationboard A list of journeys with the stop of the line leaving from that station.

Example Requests

GET http://transport.opendata.ch/v1/stationboard?station=Aarau&limit=10

which is the same as

GET http://transport.opendata.ch/v1/stationboard?id=008502113&limit=10

Example response

{
    "stationboard" : [
    {
        "stop":
        {
            "station":
            {
                "id": "8502996",
                "name": "Aarau, Bahnhof",
                "score": null,
                "coordinate":
                {
                    "type" : "WGS84",
                    "x": 47.39202,
                    "y": 8.050864
                }
            },
            "arrival": null,
            "arrivalTimestamp": null,
            "departure": "2012-03-31T14:39:00+02:00",
            "departureTimestamp": 1333197540,
            "platform": "",
            "prognosis":
            {
                "platform": null,
                "arrival": null,
                "departure": null,
                "capacity1st": "-1",
                "capacity2nd": "-1"
            }
        },
        "name": "BUS13543",
        "category": "BUS",
        "number": "13543",
        "operator": null,
        "to": "Frick, Bahnhof"
    },{
        "stop":
        {
            "station":
            {
                "id": "8502996",
                "name": "Aarau, Bahnhof",
                "score": null,
                "coordinate":
                {
                    "type": "WGS84",
                    "x": 47.39202,
                    "y": 8.050864
                }
            },
            "arrival": null,
            "arrivalTimestamp": null,
            "departure": "2012-03-31T14:39:00+02:00",
            "departureTimestamp": 1333197540,
            "platform": "",
            "prognosis":
            {
                "platform": null,
                "arrival": null,
                "departure": null,
                "capacity1st": "-1",
                "capacity2nd": "-1"
            }
        },
        "name": "Bus 2",
        "category": "Bus",
        "number": "2",
        "operator": "BBA",
        "to": "Aarau Rohr, Unterdorf"
    },
    // ...
    ]
}
            

/trip

One trip with all its stops: every station from the first to the last, with platforms, times and real-time delays. Each journey of /stationboard and /connections names its trip in trip; the same id and day are what the national GTFS-RT feed refers to.

Resource URL

GET http://transport.opendata.ch/v1/trip

Request parameters

Name Required Description Example
id required, or number The trip's id, trip.id of a journey 1.TA.91-1-A-j26-1.1.H
number required, or id The train number instead, with or without the leading zeros of name. Gives every trip of that number on the day. 707
date optional The service day, YYYY-MM-DD: the day the trip starts, also when it runs past midnight. Today by default. 2026-11-23

Example request

GET http://transport.opendata.ch/v1/trip?number=707&date=2026-11-23

Response

trips, a list of journeys, each with every stop in passList and cancelled, true when the trip does not run after all. Empty when the trip does not run on that day. A trip only real time knows - a replacement bus, an extra train - is in no timetable file and is not found.


/formation

The coaches of a train at each of its stops: their order, the platform's sector, class, number and what each offers. The data are the Train Formation Service of opentransportdata.swiss, for trains of SBB, BLS, Thurbo, RhB, SOB, zb, SZU, TPF, OeBB and VDBB, as far as the railway gives them. The connections example draws them.

Resource URL

GET http://transport.opendata.ch/v1/formation

Request parameters

Name Required Description Example
id required The trip's id, trip.id of a journey 1.TA.91-1-A-j26-1.1.H
date optional The service day, trip.date. Today by default. 2026-11-23

Response

status is available; pending until about availableFrom, three hours before the train starts; none when the railway gives no formation; unsupported for buses, trams and other railways; or unknown for a trip not in the timetable. A train asked for while pending, up to ten hours ahead, is fetched next: ask again a few seconds later.

With available, updated says when it was fetched and stops lists the stops, each with station, arrival, departure, platform and:

  • coaches, the front first, in the direction the train leaves in. Each has position (from 1), sector, number, type (coach, family, restaurant, couchette, sleeper, baggage, locomotive, parked, other), classes, offers (wheelchair, business, family, stroller, lowFloor, bicycle, bicycleReservation) and the flags closed, unattended, groupsBoarding, groupsInTransit, noPassageAhead, noPassageBehind.
  • destinations: how far each part of the train runs, by fromPosition and toPosition. A train that divides has several.

Formations change at short notice, and are not fetched with every change. Name opentransportdata.swiss as the source when you show them.


/fare

What a connection costs: the price of a point-to-point ticket (Streckenbillett) for one adult, full and with a half-fare travelcard, in both classes. Send one connection exactly as /connections returned it; the price comes from the national fare service (NOVA) on opentransportdata.swiss.

Resource URL

POST http://transport.opendata.ch/v1/fare

Request body

One connection object as JSON, with its sections. Walks cost nothing and are left out; each ride needs its stations, times, category and operator, as /connections gives them.

Example request

curl -X POST http://transport.opendata.ch/v1/fare \
     -H 'Content-Type: application/json' \
     -d "$(curl -s 'http://transport.opendata.ch/v1/connections?from=Bern&to=Basel&limit=1' | jq '.connections[0]')"

Example response

{
    "currency": "CHF",
    "product": "Streckenbillett",
    "fares": {
        "2nd": {"full": 42.0, "halfFare": 21.0},
        "1st": {"full": 72.0, "halfFare": 36.0}
    }
}
            

A price is kept for a week per route - the same stations, categories and operators, at any time of day - and asked again after the timetable change in December. The fare service allows this API a limited number of requests: when they are spent for the minute or the day, /fare answers 503; try again later or show the connection without a price. 400 means a connection that cannot be priced (only walks, an operator the fare service does not know), 404 one the fare service has no price for. Saver tickets, regional passes and children's fares are not covered.


API Objects

API responses are composites of the following objects:

Location Object

Name Description
id The id of the location
type Type of the location, can contain:
  • station: Location is a train station, bus station
  • poi: Location is a point of interest (Clock tower, China garden)
  • address: Location is an address
  • refine: Location is not defined, the user has to relocate
name The location name
score The accuracy of the result
coordinates The location coordinates
distance If search has been with coordinates, distance to original point in meters

Coordinates Object

Name Description
type The type of the given coordinate
x Latitude
y Longitude

Connection Object

A connection represents a possible journey between two locations.

Name Description Example
from The departure checkpoint of the connection
to The arrival checkpoint of the connection
duration Duration of the journey 00d00:43:00
service Service information about how regular the connection operates
products Array with transport products IR, S9
capacity1st The highest occupancy expected in 1st class on the way: 1 low, 2 medium, 3 high. From the railways' forecast, for trains of SBB, BLS, SOB, Thurbo and zb; null for other vehicles and trains without a forecast 1
capacity2nd The same for 2nd class 2
sections A list of sections

Service Object

Operation information for a connection.

Name Description Example
regular Information about how regular a connection operates. daily
irregular Additional information about irregular operation dates. not 23., 24. Jun 2012

Prognosis Object

A prognosis contains "realtime" informations on the status of a connection checkpoint.

Name Description Example
platform The estimated arrival/departure platform 8
departure The departure time prognosis to the checkpoint
Date format: ISO 8601
2012-03-31T08:58:00+02:00
arrival The arrival time prognosis to the checkpoint
Date format: ISO 8601
2012-03-31T09:35:00+02:00
capacity1st The occupancy expected in 1st class when the train leaves this stop: 1 low, 2 medium, 3 high, null when unknown (see Source) 1
capacity2nd The same for 2nd class 2

Stop Object

A checkpoint represents an arrival or a departure point (in time and space) of a connection.

Name Description Example
station A location object showing this line's stop at the requested station.
arrival The arrival time to the checkpoint 14:58:00
departure The departure time from the checkpoint null
delay The delay at this checkpoint, can be null if no prognosis is available. 2
platform The arrival/departure platform 8
prognosis The checkpoint prognosis

Section Object

A connection consists of one or multiple sections.

Name Description Example
journey A journey, the transportation used by this section. Can be null
walk Information about walking distance, if available: duration in seconds {"duration": 240}
rental Only with sharedMobility=1, on a section taken with a shared vehicle (its walk gives the duration): provider, vehicle (bicycle, scooter_standing, car and others), propulsion, from_station, to_station, url {"provider": "PubliBike", "vehicle": "bicycle"}
geometry Only with geometry=1: polyline, the line as an encoded polyline, and precision, the decimals of its coordinates. A walk follows the streets and, through a station, gives levels, the lowest and highest floor it reaches (0 at street level). Trains and trams in Switzerland follow their tracks, as OpenStreetMap has them (© OpenStreetMap contributors); buses, boats and stretches abroad run straight from stop to stop. A long ride has some thousand points. {"polyline": "o~ywwA{fz~L…", "precision": 6}
departure The departure checkpoint of the connection
arrival The arrival checkpoint of the connection

Journey Object

The actual transportation of a section, e.g. a bus or a train between two stations.

Name Description Example
name The name of the transportation 019351
category Category of the transportation S
categoryCode The product class: 0 high-speed train (ICE, TGV), 1 InterCity/EuroCity, 2 InterRegio, 3 regional train (RE, R), 4 boat, 5 S-Bahn, 6 bus, 7 cableway or funicular, 8 special train, 9 tram or metro; null when unknown. Use it to choose an icon. 1
number The number of the transportation line 13
operator The company performing the transportation 8
to Final destination of the train Zürich HB
passList Checkpoints the train passed on the journey
capacity1st The highest occupancy expected in 1st class on the way: 1 low, 2 medium, 3 high. From the railways' forecast, for trains of SBB, BLS, SOB, Thurbo and zb; null for other vehicles and trains without a forecast 1
capacity2nd The same for 2nd class 2
trip The trip: id, its trip_id in the national GTFS feed, and date, its service day. What /trip takes {"id": "1.TA.91-1-A-j26-1.1.H", "date": "2026-11-23"}

Limit response

You can limit the response data with the fields parameter. If any fields[] is passed, only the specified fields are in the response. The API is aware of the hierarchy, if you set a field, everything below is in the response unless a more specific (further down in the hierarchy) field is set.

Example Request

GET http://transport.opendata.ch/v1/connections?from=Lausanne&to=Genève&fields[]=connections/from/departure&fields[]=connections/to/arrival

Example response

{
    "connections":[
        {
            "from":{
                "departure":"2012-05-01T19:42:00+0200",
            },
            "to":{
                "arrival":"2012-05-01T20:15:00+0200",
            }
        },
    ],
    //....
}

            

Example Request

GET http://transport.opendata.ch/v1/connections?from=Lausanne&to=Genève&fields[]=connections/from&fields[]=connections/to/station

Example response


{
    "connections":[
        {
            "from":{
                "station":{
                    "id":"8501120",
                    "name":"Lausanne",
                    "score":null,
                    "coordinate":{
                        "type":"WGS84",
                        "x":46.516785,
                        "y":6.629086
                    }
                },
                "arrival":null,
                "arrivalTimestamp":null,
                "departure":"2012-05-01T19:42:00+0200",
                "departureTimestamp":1335894120,
                "platform":"5",
                "prognosis":{
                    "platform":null,
                    "arrival":null,
                    "departure":null,
                    "capacity1st":"1",
                    "capacity2nd":"1"
                }
            },
            "to":{
                "station":{
                    "id":"8501008",
                    "name":"Gen\u00e8ve",
                    "score":null,
                    "coordinate":{
                        "type":"WGS84",
                        "x":46.210217,
                        "y":6.142437
                    }
                }
            }
        },
    ],
    // ...
}
            

Open Journey Planner (OJP 2.0)

Besides the JSON API above, the same timetable and journey planner answer at /ojp20 - outside /v1, at the path the national planner uses - in the Open Journey Planner 2.0 standard (OJP, CEN/TS 17118): the XML interface of the national journey planner, so that an application written for it can use this API by changing the address. No key is needed.

Resource URL

POST http://transport.opendata.ch/ojp20

Supported requests

  • OJPTripRequest: connections between stops, addresses or coordinates.
  • OJPStopEventRequest: departures or arrivals at a stop.
  • OJPTripInfoRequest: all calls of one journey, by the JourneyRef and OperatingDayRef of an earlier answer.
  • OJPLocationInformationRequest: stops by name, by id or within a rectangle.

Fare, refinement and other requests are not supported. Send the request with Content-Type: text/xml; the namespace prefixes are free (siri: and ojp: as you like).

Stop ids

Stops are named as by the national planner: a station by its SLOID (ch:1:sloid:7000), a platform by its own (ch:1:sloid:7000:4:8). In requests the DiDok number (8507000) works as well. An operating day is written 2026-11-20.

Example request

<OJP xmlns="http://www.vdv.de/ojp" xmlns:siri="http://www.siri.org.uk/siri" version="2.0">
  <OJPRequest><siri:ServiceRequest>
    <siri:RequestTimestamp>2026-11-20T07:00:00Z</siri:RequestTimestamp>
    <siri:RequestorRef>my-app</siri:RequestorRef>
    <OJPTripRequest>
      <siri:RequestTimestamp>2026-11-20T07:00:00Z</siri:RequestTimestamp>
      <Origin><PlaceRef><StopPlaceRef>ch:1:sloid:7000</StopPlaceRef><Name><Text>Bern</Text></Name></PlaceRef>
        <DepArrTime>2026-11-20T07:30:00Z</DepArrTime></Origin>
      <Destination><PlaceRef><StopPlaceRef>ch:1:sloid:3000</StopPlaceRef><Name><Text>Zürich HB</Text></Name></PlaceRef></Destination>
      <Params><NumberOfResults>4</NumberOfResults></Params>
    </OJPTripRequest>
  </siri:ServiceRequest></OJPRequest>
</OJP>
            

What the answers contain

Valid OJP 2.0, with platforms, real-time times, the line (PublicCode), its category (ProductCategory, Mode/ShortName), the train number and, for trains, the expected occupancy at each departure (ExpectedDepartureOccupancy). A trip of this interface can be priced by the national fare service (OJPFare) as it stands. Different from the national planner: LineRef, JourneyRef and OperatorRef are this planner's own; disruption messages (situations), service attributes and CO2 figures are not given. Connections are the same planner's as in /connections.

Errors are plain text: 400 for a request this interface does not take, 429 when the planner is busy, 502 when it fails.


For AI assistants (MCP)

The same API answers AI assistants at /mcp, as a Model Context Protocol server (streamable HTTP). Add it to Claude, ChatGPT, Cursor, VS Code or any other MCP client, and the assistant can look up stations, connections and departures for you. No key and no login are needed.

Server URL

https://transport.opendata.ch/mcp

Tools

  • find_stations: stations and stops by name, with their ids.
  • stations_nearby: the stops closest to a coordinate.
  • connections: connections from A to B, with platforms, delays and changes.
  • departures: the departure or arrival board of a station.

All tools only read. They answer from /locations, /connections and /stationboard, as short text, and the rate limit of the API applies to them.

Adding it

In Claude: Settings › Connectors › Add custom connector, with the URL above. In Claude Code: claude mcp add --transport http transport https://transport.opendata.ch/mcp. In VS Code or Cursor, in mcp.json:

{
  "servers": {
    "transport": { "type": "http", "url": "https://transport.opendata.ch/mcp" }
  }
}
            

Source

The API keeps its own copy of the Swiss public transport data and answers every request from it.

Timetable

  • What we fetch: the national timetable of all Swiss public transport as GTFS from opentransportdata.swiss, one file per timetable year (about 300 MB): timetable 2026, timetable 2027.
  • At the source: a complete new version about twice a week, usually on Wednesday and Saturday. The next timetable year is published in the autumn, ahead of the change in mid-December.
  • What we do with it: every hour we look whether a new version is out. A new version is downloaded once, and loaded when the real-time feed has switched to it - the afternoon after publication - so that delays always match the timetable. We keep the days from a week ago to three months ahead in a database; across the December change, both timetable years are merged.
  • In the API: a new timetable answers /locations, /stationboard and /connections within the hour it is loaded; the days held move on weekly.

Real time

  • What we fetch: delays, cancellations and added trips as GTFS-RT from opentransportdata.swiss (an API key is needed).
  • At the source: renewed every 30 seconds.
  • What we do with it: station boards read it every 30 seconds, the journey planner every minute.
  • In the API: delay and prognosis are at most about a minute behind the source.

Connections

  • How: computed here by MOTIS, an open-source journey planner (MIT licence), on the very file of timetable days the database holds and on the same real-time feed, read every minute. For a journey it finds the connections that are best in arrival time and in the number of changes, and /connections writes them in the form /v1 has always used: sections, products, platforms, delays.
  • Changes and walks: transfer times are those of the national timetable, per station; where the timetable gives a walk to a neighbouring stop that is shorter than the station's transfer time, the walk counts, as in the official journey planners. Walks between stops the timetable does not link, and the way from an address or a coordinate to the first stop and from the last stop to the destination, follow the streets of OpenStreetMap - up to 20 minutes on foot. From or to an address with no stop within that, the walk may take up to an hour; when walking is the only way and no via is asked for, the connection is the walk alone, a single section with walk and no products. The way to the first stop and from the last is walked at 1.4 m/s (about 5 km/h) to the platform itself, so near a large station it can take a few minutes more than to the station's entrance.
  • In the API: each new timetable and each weekly move of the days held rebuilds the planner, which takes 10 to 20 minutes. It is built beside the running one, which keeps answering until the new one takes over within seconds.

Streets, addresses and places

  • What we fetch: the Swiss extract of OpenStreetMap by Geofabrik (about 550 MB).
  • At the source: edited continuously, the extract published daily.
  • What we do with it: walks to, from and between stops follow its streets, and its addresses and points of interest are what /locations finds besides stops. Searched on this server; no query leaves it.
  • In the API: renewed monthly.

Shared mobility

  • What we fetch: bikes, scooters and cars to rent, as GBFS from sharedmobility.ch of the Swiss Federal Office of Energy (open use, source to be named).
  • At the source and here: every minute. /connections with sharedMobility=1 and the journey planner page use them for the way to the first stop and from the last; without the parameter, /connections walks, as it always has.

Occupancy

  • What we fetch: the occupancy forecast of the railways from opentransportdata.swiss: how full each train is expected to be when it leaves each station, in both classes. It covers trains of SBB, BLS, SOB, Thurbo and zb.
  • At the source: published once a night, for three months ahead.
  • What we do with it: fetched twice a day; the coming week is loaded.
  • In the API: capacity1st and capacity2nd of stops, journeys and connections, and ExpectedDepartureOccupancy in /ojp20.

Fares

  • What we ask: the national fare service (NOVA, OJPFare, beta) on opentransportdata.swiss, for /fare. It is sent the stations, times, categories and operators of the connection - nothing about who asks.
  • In the API: a price is kept a week per route and renewed with the December timetable.

Operator names

  • What we fetch: the names operators go by in the national timetable's HAFAS data (HRDF), from opentransportdata.swiss.
  • In the API: operator gives these shortened names, not the full company names.

The source code is on GitLab. If you show the data, please name its source: Timetable data: opentransportdata.swiss.

History

  • 2012: Opendata.ch starts the Transport API, written by Fabian Vogler (GitHub, his commits on GitLab) and the community, on top of the SBB's timetable interface.
  • 2017: the SBB systems behind it are to be switched off. search.ch steps in with its own web service, and from 31 July 2017 the API translates its answers.
  • 5 October 2026: the national timetable and its real-time data are open data, so the API answers from them directly: its own copy of the timetable and its own journey planner. The parameters and the answers of /v1 stay as they were.
  • November 2026: capacity1st and capacity2nd carry the railways' occupancy forecast, /fare prices a connection, /trip gives one trip with all its stops, /formation the coaches of a train, /ojp20 answers in the Open Journey Planner 2.0 standard, and /mcp opens the API to AI assistants as a Model Context Protocol (MCP) server.