How to tell is the train service is Opal or Booking Required


#1

Using departure_mon API, is it possible to tell if a train trip is Opal or Booking Required service?

Is it in thetransportation.operator.id ? or is it transportation.product.class ?

I’ve been digging around to find possible references, but the TfNSW_TripPlannerAPI_technical_doc.pdf doesn’t go into it enough.

Many thanks


#2

Yep, good question. this one is a bit of a hack. Since bookings are not necessarily correlated to a mode or operator, etc, we have implemented this by detecting the informational message.

Check for stopEvents[].infos[].subtitle and see if it contains the text “Book your seat”

It’s not very elegant, but that’s how we’re doing it at transportnsw.info, and we are ensuring that this part of the text will not change.


#3

Cursor_and_Departures___transportnsw_info

just a quick screenshot of the javascript in transportnsw.info to prove that we are looking for this string