New real-time regional bus data is now available

Real-time bus data for 3 regions of NSW are now available via the API gateway.
These new regions are centered around Bega (/southeasttablelands), Dubbo (/centralwestandorana), and Coffs Harbour (/northcoast). All new endpoints are listed below.

The following regional operators have been superseded by the new GTFS feeds and agency_IDs will change in the complete GTFS bundle. New IDs are listed in the reference table of GTFS agencies here.

B032 Bega Valley Coaches
B014 Dubbo Buslines
B057 Ryans Bus Service
B033 Sapphire Coast Buslines
B034 Sapphire Coast Buslines
B052 Sawtell Coaches

https://api.transport.nsw.gov.au/v1/gtfs/schedule/regionbuses/southeasttablelands
https://api.transport.nsw.gov.au/v1/gtfs/realtime/regionbuses/southeasttablelands
https://api.transport.nsw.gov.au/v1/gtfs/vehiclepos/regionbuses/southeasttablelands

https://api.transport.nsw.gov.au/v1/gtfs/schedule/regionbuses/centralwestandorana
https://api.transport.nsw.gov.au/v1/gtfs/realtime/regionbuses/centralwestandorana
https://api.transport.nsw.gov.au/v1/gtfs/vehiclepos/regionbuses/centralwestandorana

https://api.transport.nsw.gov.au/v1/gtfs/schedule/regionbuses/northcoast
https://api.transport.nsw.gov.au/v1/gtfs/realtime/regionbuses/northcoast
https://api.transport.nsw.gov.au/v1/gtfs/vehiclepos/regionbuses/northcoast

3 Likes

We now have 2 more regions with real-time bus data! These are centred on Wagga Wagga (/riverinamurray) and Queanbeyan (/southeasttablelands2).

https://api.transport.nsw.gov.au/v1/gtfs/schedule/regionbuses/riverinamurray
https://api.transport.nsw.gov.au/v1/gtfs/realtime/regionbuses/riverinamurray
https://api.transport.nsw.gov.au/v1/gtfs/vehiclepos/regionbuses/riverinamurray

https://api.transport.nsw.gov.au/v1/gtfs/schedule/regionbuses/southeasttablelands2
https://api.transport.nsw.gov.au/v1/gtfs/realtime/regionbuses/southeasttablelands2
https://api.transport.nsw.gov.au/v1/gtfs/vehiclepos/regionbuses/southeasttablelands2

Again, the list of operators is updated here.

Another region is now live! Data from Surfside Buslines in Tweed Heads is available at these endpoints:

https://api.transport.nsw.gov.au/v1/gtfs/schedule/regionbuses/northcoast2
https://api.transport.nsw.gov.au/v1/gtfs/realtime/regionbuses/northcoast2
https://api.transport.nsw.gov.au/v1/gtfs/vehiclepos/regionbuses/northcoast2

Additional real-time data is now available for Grafton and Parkes/Forbes via existing endpoints.

Grafton (regionbuses/northcoast)

agency_id agency_name
5783 Busways
5966 Busways
5044 Atwal Bus
5055 BNA Buses
5062 BNA Buses
5585 BNA Buses
5950 Lawrence Bus Service

Parkes/Forbes (regionbuses/centralwestandorana)

agency_id agency_name
5673 Forbes Buslines
5841 Forbes Buslines
5683 Western Road Liners
5880 Western Road Liners

Hi - there are now 12 regionbus sub-URIs, each managing their own group of buses. Based on the realtimetripid format, or the operator, is there an API call or similar that I can call in real time to find the appropriate URI?

I’ve found this table of 736 specific ā€˜agency_id to URI’ mappings which I can hard-code into my app but that’s not overly elegant and it’s likely to change I’m sure.

Actually, thinking about it I could just download the entire CSV when needed - as a data set it isn’t particularly large but fingers crossed that the GUIDs in the path don’t change!

TIA,
Andy

Hi @andy.stewart ,

This table is systematically updated whenever there is a change in the data.

May I know what you mean by ā€˜GUID’ here?

Hi Suraj - the URL to the CSV table (https://opendata.transport.nsw.gov.au/data/dataset/a2d81975-a1ee-42d4-8eab-ce53879b501e/resource/30b850b7-f439-4e30-8072-e07ef62a2a36/download/list-of-overlapping-agencies-in-gtfs-feeds_20250515.csv) contains two GUIDS (a2d8…. and 30b8…) which have been assigned through some process or other.

My concern/query was that if the file path is going to change the next time that table is updated or, probably more likely, now that the file has a unique path assigned to it, it will retain that path forever, even when updated.

It really depends on TransportNSW’s processes - is the updated file a ā€˜new’ file (probably with a new unique path) or just an amended version of the ā€˜same’ file (retaining the currently assigned path).

Does that make sense?

Hi - calling the resource_show endpoint defined by CKAN’s API shows that the resource ID (the latter GUID) has been kept the same since 2017, so we should be able to just call that and then get the latest URL from the url property within result.

Thanks applecuckoo confirming that the resource GUID is constant, which is what I was hoping.

To get the most recent data I’m actually using this URL as I already have the bus agencyID as returned by the trip API:

url = ā€œhttps://opendata.transport.nsw.gov.au/data/api/action/datastore_search?resource_id=30b850b7-f439-4e30-8072-e07ef62a2a36&filters={%22For%20Realtime%20GTFS%20agency_id%22:%22ā€ + agencyid + ā€œ%22}&limit=1ā€

It returns, among other things, the region-specific half of the GTFS URL (eg ā€˜regionbuses/centralwestandorana’).