Toll Calculator API

Roads and Maritime Services (RMS) has developed the Toll Calculator API to provide developers a means of accessing the most up-to-date toll pricing for journeys undertaken across NSW roads.


This is a companion discussion topic for the original entry at https://opendata.transport.nsw.gov.au/dataset/toll-calculator-api

Quarterly toll price update will occur on 1 October 2018. However, the Toll Calculator API will not update until a few days later.

confirming that the Toll Calculator was updated this morning and now reflects the current toll pricing.

This seems to be inaccurate? I generated a polyline using the Google Maps Directions API along the M7 from the M5 (-33.9642466,150.875037) to the M4 (-33.7930349,150.8363779) and it comes up with a toll of $7.92 when it should be $8.03 according to the RMS toll calculator.
Also, when I put in a polyline generated from a route between Kiama and Glenbrook, which uses the exact same section of the M7, it came up as $3.98.
I verified my polylines here to make sure they were accurate.
Am I doing something wrong or is there an issue with the API? Nothing like this is mentioned in the Known Issues section of the docs.

Hi @jamsandwich we’re still looking into this and it’s with a tech team.

1 Like

Just a reminder there is an update to the Toll Calculator API as Version 2! This has the correct toll calculations and will have updated tolls from 1 July 2020. Please make sure you add this API to your application in order to use the new and updated Toll Calculator V2.
To add to your application, login and go to “My Account” and then “Applications” and add the Toll Calculator API v2 to your application.

1 Like

Good Morning All,

please be advised the new M4 - M8 link is currently being worked on and should be available in Toll Calculator API early next week.

Good Morning All,

Toll Calculator API changes are now live in prod. Change log:

  • M4, M8 and M5E are now combined into one motorway - Westconnex (WCX)
  • Gantry and tolling data for M4-M8 Link now available in WCX motorway.
  • OSM data has been updated to include M4-M8 Link
  • Toll gantries for WCX are now standardised to all use Toll Point code (e.g. TP01B) instead of mix of Segment (TS0101) and Toll Point (TP01B).
  • Removed some Westconnex origin-destination pairs in the tolling /data endpoint which were not physically possible, but a theoretical toll was still calculated.

Hi
I’m not sure if I’m writing this in right place, please let me know where i should ask this.

I’m trying to use this API to create a table in excel that has all the different entrance & exits to motorways and total the tolls for each trip/combination of entry/exit

If this already exists somewhere great I can pull data from that but I want to be able to update each month so i can make sure its up to date

In excel:
I go to the “Data” tab
→ “Get Data” (under “Get & Transform Data”) section
→ “From Other Sources”
→ “From Web”
→ Enter “https://api.transport.nsw.gov.au/v2/roads/toll_calc/route”
→ “Web API”
→ Enter my key
→ “Connect”
It comes up with an error “a web API key can only be specified when a web API key name is provided.”

And I have tried many other combinations and tried all the other tabs
I’ve also tried with every shorter variation of the URL and had no luck

If anyone could help me that would be fantastic
Or if you could point me in the right direction to get help I’d very much appreciate it

Eric

The updates mentioned in the Jan 24 comment appear to have all been lost in the April toll updates? I see Westconnex has reverted back to being two separate toll roads (new M4 and M8/M5 East), there are now a mix of toll segments and toll points again and there are also the invalid origin-destinations, e.g. exit gantries on exit-only gantries.

1 Like

@jxeeno are you able to have a look please?

@brainwad,
can you check now? @jxeeno has told me he’s deployed a fix.

Yep, it’s back in the new format now.

1 Like

I can’t seem to access the /data endpoint anymore?

curl -X 'GET' \
  'https://api.transport.nsw.gov.au/v2/roads/toll_calc/data' \
  -H 'accept: application/json' \
  -H 'Authorization:  $MY_API_KEY'

gives

{
    "ErrorDetails": {
        "TransactionId": "0000018b5c3b61fe-19d09de",
        "ErrorDateTime": "2023-10-29T18:01:26.398+11:00",
        "Message": "The calling application is unauthenticated.",
        "RequestedUrl": "/v2/roads/toll_calc/data",
        "RequestMethod": "GET"
    }
}

I last sucessfully accessed in in July, before the migration of the opendata site to the new platform. I created a new API key in the new UI, in case the old one was invalidated, but it doesn’t make any difference.

Have you tried adding the word apikey with a space before your token?

Thanks, that was it.

1 Like

:tada: Hi Team,
please be advised the Rozelle Interchange gantry and tolling data is now available in Toll Calculator API. :tada: