I want to download lists of journeys from multiple pairs of origins and destinations from category Trip Planner APIs.
I have a text file of two columns Origins and Destinations.
Is there any way to download multiple journeys from many O-D or how to modify script to download at one go?
Thanks in advance.
How to modify the json sample script to download mutiple a list of journeys from multiple pairs of origins and destinations
No, you need to call each pair individually.
I would suggest you write a piece of code to loop through your text file and then parse the output.
Thank you for replying me. I appreciate it.
I had the same idea with you, but I don’t know how to modify the script to do the loop.
Do you have any sample script or any suggestion? I am a beginner for json scripting.
Thank you so much in advance!
We don’t do premium support here at Transport but I can offer a little advice.
JSON isn’t a scripting language it’s a method to exchange data. You need to pick a language and make the API call from within whatever script you write. There are heaps of resources online so it should be pretty easy to teach yourself if you have programming experience.
Thanks Patrick for your advice.
I have seen several topics about what to do to edit script and exploring other topics giving instructions.
If possible, can you please tell me how to get the Shared Secret id as I followed user guide and seen the topic Using the API Explorer by @yvonne.lee, but I couldn’t find the Shared Secret id from my application.
I’ve read “API Key and Shared secret are prepopulated for you” from steps:
But can you do the following
- sign in
- create an app
- add the APIs you need for that app
- go to API Explorer
- choose the API and App/API Key
- Choose OAuth2 as the auth type
- Choose Client Credentials
- API Key and Shared secret are prepopulated for you
- Type in “user” to the Scope
- add in the Token Endpoint (use this one https://api.transport.nsw.gov.au/auth/oauth/v2/token8 if you don’t have one)
- Choose the API endpoint
- Click on Submit
- Grab the curl command and run it
I couldn’t find it anywhere.
Those are very old instructions, we made some changes a while back and now you only need the API key.
The instructions on how to create an application and obtain a API key is on our hub here:
There is other useful documentation here: