Occupancy Forecast

Brief Description

An occupancy forecast is a Prediction of the expected occupancy rate of a particular mode of transport at a particular time in the future. It is usually displayed with doll symbols (1, 2 or 3 dolls).

Since spring 2024, we have been publishing on this platform the occupancy forecasts at class level for SBB trains and other railways (BLS, Thurbo, SOB). The data is also used in our Open Journey Planner. With the help of this occupancy forecast data, customers can switch to trains with lower occupancy, maximising their own comfort and ensuring a more even occupancy rate on public transport.

Occupancy forecasts in the SBB online timetable, sbb.ch.

Functional Description

The source of the data is SBB’s CAPRE system, to which we have access by kind permission of SBB. We compile the data every day into one data set for the next three months and offer it for download on this page.

The occupancy forecasts are saved in one file per operating day (DateFrameRef/opDate) and railway (operatorRef; 11: SBB, 33: BLS, 65: Thurbo AG, 82: Schweizerische Südostbahn SOB). All trains in question (TrainNumberRef) are stored in this file. All stops or sections of the journey are specified for each train, including the location (StopPoint, departureStation, etc.) and times, as well as the occupancy forecasts.

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

  • ‘unknown’: No forecast available.
  • ‘manySeatsAvailable’: low occupancy, corresponds to a doll symbol.
  • ‘fewSeatsAvailable’: medium occupancy, corresponding to two doll symbols.
  • ‘standingRoomOnly’: high occupancy, corresponds to three doll symbols.

A detailed technical description and technical specification of the data formats can be found here:

Technical Description

The data set is offered 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 9,000 trains per day for the next three months (92 days). The data files (ZIP files) are 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, for example operator-11.xml or operator-82.json.

#AutoTranslate