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

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

Is it in the ? 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

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, and we are ensuring that this part of the text will not change.

1 Like


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

1 Like