Code change for programmatic download of GTFS and TXC files

If you are programmatically downloading the GTFS and TXC files available on the Dashboard, you need to change your code as the URL for the Developer Portal (and subsequently the Dashboard) has changed.

We recommend you use our API gateway utilising our simplified API key authentication to download these files.

Sample code is provided below:

cURL:
curl -k --header “Authorization:apikey l7xxxxxx” --request GET ‘https://api.transport.nsw.gov.au/v1/gtfs/schedule/buses’ > bus.zip

wget:
wget --header "Authorization:apikey l7xxxxxx " 'https://api.transport.nsw.gov.au/v1/gtfs/schedule/buses

The JSON, CSV, XLS and GeoJSON files are available in the Data Catalogue on the Open Data Hub or using the DOWNLOAD links next to the files on the dashboard.

Please note: The Developer Portal URL will change at least once more in the coming months and code will need to be changed. Keep an eye on the Forum for more information.

We suggest you use the APIs provided in the API Catalogue as they will not be affected by URL changes. Information about using our APIs can be found in the User Guide.

If you have any issues or question please reply below.

2 Likes