Public Transport - Location Facilities and Operators


#1

Operator contact details & location facilities for train stations, wharves & bus interchanges.


This is a companion discussion topic for the original entry at https://opendata.transport.nsw.gov.au/dataset/public-transport-location-facilities-and-operators-deprecated

#2

We’ve been reviewing how we deliver data. We are moving static or infrequently updated files from being delivered as an api.transport.nsw.gov.au to a downloadable dataset. You will still be able to get the file programmatically via the Open Data portal API.

Facilities and Operators will be the first file to move across.

What does that mean to me?

Transport for NSW will no longer be updating the file returned from the endpoint:
https://api.transport.nsw.gov.au/v1/publictransport/facilitiesandoperators

You will need to use the Open Data portal API (dataset API) to retrieve the file.

How do I use the Open Data portal API?

To download a file you need three pieces of information

  1. an authorization key,
  2. the UUID of the file you want to download and
  3. the download endpoint.

The authorization key is just your portal credentials base64 encoded. You can create your key in your code or by using an online encoder. If using the online encoder, enter your username and password separated by a colon. i.e Username:Password .

The file UUID is found in the additional information section on the resource page.

The download endpoint is:
https://opendata.transport.nsw.gov.au/api/download

Example call in curl:
curl -H “Authorization: Basic [Your Key Here]” https://opendata.transport.nsw.gov.au/api/download/[File UUID Here]

To download “location facilities” the command would look like:

curl -H “Authorization: Basic bm90bXk6cmVhbHBhc3N3b3JkOi” https://opendata.transport.nsw.gov.au/api/download/ca137e89-b274-428c-988c-1f56be759260