Trip Planner APIs

Create your own personal public transport trip planner. APIs interact with the transportnsw.info trip planner and provide the ability for NSW public transport trip planning, departure board, travel alerts, real-time transport services, walk and drive legs and Opal fares.


This is a companion discussion topic for the original entry at https://opendata.transport.nsw.gov.au/dataset/trip-planner-apis

TfNSW would like to advise the trip planner has been updated with new fares effective 3rd of July.

1 Like

I see Trip Planner has a “Connecting with public transport” set of options. How can I set these options through the API?

Hi @jayen. We’ve asked internally and will get back to you.

Hi - may just me being dumb but the trip planner api seems to be returning trips almost calculated 12 hours early. Just wondering if there is anything about this?

Do you have an example? I think the API returns times in UTC in ISO 8601 format.

That’s the issue - didn’t realize it returned times in UTC
Kinda strange imo - but fair enough

They’re in ISO 8601 format, which is totally normal. The Z at the end indicates UTC time: ISO 8601 - Wikipedia, which is also totally normal.

It’s rare to see a date&time format which doesn’t also include the timezone. When date and time are separated, then the timezone may be implied.

The strange part is that the API request uses separate date and time, but the response provides date&time together.

1 Like

All good - I’m just starting out using api’s personally so still learning everything :slight_smile:

Following the current documentation, the API does not generate a multimodal trip with cycling legs regardless of the options used. Is this expected behaviour?

Hi,
When using the /departure_mon endpoint, under the location.properties of each stopEvent, there is a “platform” field. I was not able to find any documentation on this field, but from experimentation, I’ve arrived at the following findings:

For train trips, this platform field is given as the station’s 3-letter code, followed by the platform number. Eg. “PDH4” for Pendle Hill, Platform 4.

For bus trips from major interchanges, the platform field is given as the bus stand that it departs from. Eg. “K” for Stand K

For bus trips from most minor bus stops, the platform field is given as “X1” (eg. at stop 2065134).

However, from North Sydney Girls High School (2065138), busses seem to depart from platform “X2”. Likewise with Pendle Hill Station (2145141), busses depart from “X4”.
And at Westpoint Bus Interchange (2148373), the bus stands are labelled by number, not letter, and so a bus departing from platform “X8” denotes Stand 8.

I am using this to filter the stand that busses depart from at bus stops. I had tried to filter stands by their reported “platform” field, and ignore when it equals “X1”, however there seem to be other values possible. I was wondering what the mechanism for the value in this “platform” field was?

Thanks.

Addendum: Platforms at Kogarah Station do NOT appear to be labelled with station code, instead being reported as “P1”, “P2”, “P3” and “P4”.

For the platform, the Light Rail stations have platform data as LR1, LR2. It will be good to have documentation so that this is made clear. I checked the feed data and this was not clearly specified and seems random