Skip to content

Occupancy Forecast

Beta Preview — Feedback Welcome!


occupancy forecasts on the online timetable of SBB, sbb.ch

Go to the Data

Beta preview of the data set:

(occupancy-forecast)

Change Log

2024-02-23:

  • New status “Beta Preview“. This means that we now produce the data set on a regular daily basis, with our usual SLAs. However, adjustments to the data formats and other optimisations remain possible.
  • New permalinks: Split into 2 datasets (see above) so that one permalink is available for each. Attention: This changes the permalink of 2024-02-07!

2024-02-07 Start of the daily update of the data records.

2023-12-21 First version of this page published with two test data sets.

Description

An occupancy forecast is a prediction (prognosis, forecast) of the occupancy rate of a given transport option (train, bus, etc.) expected at some date and time in the future. Usually, it is indicated with manikin symbols (1, 2 or 3 manikins).

As of spring 2024, we will publish on this platform the SBB occupancy forecasts at class level, for the trains of SBB and other train operators (BLS, Thurbo, SOB). The data will also be used in our Open Journey Planner. The source of the data is the system CAPRE of SBB, to which we have access by courtesy of SBB.

Functional Aspects

The forecasts of the SBB CAPRE system are available as a source. We compile the data daily in a data set for the next three months and offer it for download on this page.

The occupancy forecasts are saved in a file for each operating day (DateFrameRef/opDate) and railway operator (operatorRef; 11: SBB, 33: BLS, 65: Thurbo AG, 82: Schweizerische Südostbahn SOB). This contains all the relevant trains (TrainNumberRef/trainNumber). For each train, all stops or sections of the journey are indicated with location (StopPoint, departureStation, etc.) and times, as well as the occupancy forecasts.

The occupancy forecasts are displayed by class (firstClass, secondClass). Possible values are:

  • “unknown”: No forecast available.
  • “manySeatsAvailable”: low occupancy, corresponds to one manikin symbol.
  • “fewSeatsAvailable”: medium occupancy, corresponds to manikins.
  • “standingRoomOnly”: high occupancy, corresponds to three manikins.

A detailed, specialized description and technical specification of 2 data formats is contained in this document.

Technical Aspects

The data set is provided in two “flavours”:

  • a standard-compliant variant with XML based on CEN SIRI ET.
  • an independent, lightweight format based on JSON.

Both files contain around 9000 trains per day for the next 3 months (92 days). The data files (ZIP files) are each around 100 MB in size.

Example: SIRI-ET-based format:

<?xml version="1.0" encoding="UTF-8"?>
<!-- (C) Copyright 2005-2012 CEN SIRI -->
<Siri xmlns="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1" xsi:schemaLocation="http://www.siri.org.uk/siri ../../xsd/siri.xsd">
  <ServiceDelivery>
    <ResponseTimestamp>2023-12-15T09:57:22+01:00</ResponseTimestamp>
    <ProducerRef>OdmchOccupancyForecast</ProducerRef>
    <EstimatedTimetableDelivery version="2.1">
      <ResponseTimestamp>2023-12-01T09:57:22+01:00</ResponseTimestamp>
      <EstimatedJourneyVersionFrame>
        <RecordedAtTime>2023-12-01T09:57:22+01:00</RecordedAtTime>
        <EstimatedVehicleJourney>
          <LineRef>null</LineRef>
          <DirectionRef>ch:1:Direction:H</DirectionRef>
          <FramedVehicleJourneyRef>
            <DataFrameRef>2023-12-04</DataFrameRef>
            <DatedVehicleJourneyRef>null</DatedVehicleJourneyRef>
          </FramedVehicleJourneyRef>
          <OperatorRef>11</OperatorRef>
          <TrainNumbers>
            <TrainNumberRef>1009</TrainNumberRef>
          </TrainNumbers>
          <EstimatedCalls>
            <EstimatedCall>
              <StopPointRef>8503424</StopPointRef>
              <StopPointName>Schaffhausen</StopPointName>
              <AimedDepartureTime>2023-12-04T06:47:00+01:00</AimedDepartureTime>
              <ExpectedDepartureOccupancy>
                <FareClass>firstClass</FareClass>
                <OccupancyLevel>fewSeatsAvailable</OccupancyLevel>
              </ExpectedDepartureOccupancy>
              <ExpectedDepartureOccupancy>
                <FareClass>secondClass</FareClass>
                <OccupancyLevel>standingRoomOnly</OccupancyLevel>
              </ExpectedDepartureOccupancy>
            </EstimatedCall>
            <EstimatedCall>
              <StopPointRef>8503000</StopPointRef>
              <StopPointName>Zürich HB</StopPointName>
            </EstimatedCall>
          </EstimatedCalls>
        </EstimatedVehicleJourney>
      </EstimatedJourneyVersionFrame>
    </EstimatedTimetableDelivery>
  </ServiceDelivery>
</Siri> 
</Siri>

Example: JSON-based format:

{
  "operatorRef": "11",
  "opDate": "2023-12-04",
  "lastUpdated": "2023-12-01T09:57:22+01:00",
  "timeToLive": "86400",
  "dataSource": "https://opentransportdata.swiss/search?q=occupancy",
  "version": "0.9",
  "trains": [
    {
      "trainNumber": "1009",
      "journeyRef": "null",
      "lineRef": "null",
      "sections": [
        {
          "departureDayShift": 0,
          "departureStationId": "8503424",
          "departureStationName": "Schaffhausen",
          "departureTime": "06:47:00",
          "destinationStationId": "8503000",
          "destinationStationName": "Zürich HB",
          "expectedDepartureOccupancy": [
            {
              "fareClass": "firstClass",
              "occupancyLevel": "fewSeatsAvailable"
            },
            {
              "fareClass": "secondClass",
              "occupancyLevel": "standingRoomOnly"
            }
          ]
        }
      ]
    }
  ]
}

The ZIP archives contain:

  • One folder per operating day, e.g. 2023-12-14
  • One file per operator with XML or JSON, as shown in the examples above, e.g. operator-11.xml or operator-82.json.