Relatime train data to a Text file


#1

Hello People,
I am new to API, PHP and any type of coding. Please forgive me if I sound dumb or unclear.

We wanted to generate a text file using a script/Code (php ) to fetch real-time train data from a specific station (Circular quay or Wynyard) for next 5-10 trains using API key. can anyone please help or guide on how to create the script with stop ID to generate a text file output.
I have tried to follow the instruction provided on the NSW portal but unable to code with stop ID or generate a text file output. we do have NEC live Parser which will Parse the PHP and will keep refreshing the text file each 600 Mili second.

Thanks
Anir


#2

If you follow the instructions using the API Explorer to download the realtime file in Protocol Buffer format. THe easist way to convert the file to json format is to download a Python script to convert it. All of which are available with examples on the Google GTFS Realtime page at https://developers.google.com/transit/gtfs-realtime/examples


#3

Hi Anir –

We also have some APIs which we’ll be releasing publicly in a few week’s time. They are currently going through testing and verification. These may be more suitable to your needs.