Skip to content

Beta: Price information with OJP Fares

A query of public transport prices via NOVA is made available via this interface.

This is an initial test system and the data comes from integration and not from production.

(Timetable)

Technical description

The OJP fare service allows you to calculate the price of trips. The service can be used to carry out queries in OJP format against the NOVA. The answers also include discount trips. The enquiry must be made in the future. The journeys must be entered as TripResult.

Price enquiries are only possible in Switzerland. Price enquiries with Half Fare Travelcard (“HTA”) are possible.

The price information is not binding. The actual price is not defined until the order is placed.

The number of requests is also limited.

Technical aspects

At the moment, only the integration system is available.

URL: https://api.opentransportdata.swiss/ojpfare/

Access is only possible using the API key. See: Developer Dashboard | Open Data Platform Mobility Switzerland (opentransportdata.swiss)

The service also allows you to send OJPTripRequests and then obtain the necessary TripResults for the query.

Example: OJPTripRequest within Bern

 

 

A TripResult in the answer:

 

The effective OJPFareRequest then looks like this (where we only show the position of the trip and do not fill it in):

 

Parameter

Trips are explained in OJPTripRequest. Therefore, the parameters are primarily discussed here

Parameter Explanation Example
oFareAuthorityfilter Currently set to NOVA. Is ignored in the service. ojp:FareAuthorityFilter>ch:1:NOVA</ojp:FareAuthorityFilter>
PassengerCategory PassengerCategory selection list. Ignored at the moment. <ojp:PassengerCategory>Adult</ojp:PassengerCategory>
Traveller More information about the traveller. Ignored at the moment.
Age The age of the traveller. Ignored at the moment.
EntitlementProduct At the moment, only the EntitlementProductRef HTA (half-price subscription) is supported.
If this is set, half-fare prices are shown, otherwise the full price.
The result then looks like this.request then looks like this (where we only show the position of the trip and do not fill it in):

Important points

  • The price calculation only works for the future.
  • Only public transport legs can be evaluated.
  • The price information also includes economy tickets, if they exist. Normal price tickets have the code 125
  • If On Demand, Sharing etc. is listed on the trip, the behaviour is not fully defined at the moment. As a matter of principle, we are informed that not all legs could be priced.

 

Known problems

The error messages are not optimal.

Further information