Usage Charging Document not available

51 views
Skip to first unread message

Sanjit Raman

unread,
May 19, 2024, 6:08:12 PMMay 19
to A gathering place for the Open Rail Data community
Hey, I was reading through the terms and conditions of using NationalRails Darwin protocol, however it seems that the link to the Usage Charging Document is not available.

I am trying to build a little project that tells me next departing rail times from my station into London.

If anyone has some suggestions, please let me know!

Thanks in advance,

Sanjit

Peter Hicks

unread,
May 19, 2024, 6:14:30 PMMay 19
to A gathering place for the Open Rail Data community
Hi Sanjit

If you're using Darwin as in the Push Port, there is no charge for the data from opendata.nationalrail.co.uk.

If you're using the Live Departure Boards API, you'll only incur charges after you've maxed out a very generous free tier which is something like 5000 requests per hour and 5 million requests in a railway period. 

I doubt you'll get close even if you're requesting data one per second (which I wouldn't recommend).

https://wiki.openraildata.com/index.php?title=About_the_National_Rail_Feeds has a link that works to the usage charging document. 



Peter



--
You received this message because you are subscribed to the Google Groups "A gathering place for the Open Rail Data community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openraildata-t...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openraildata-talk/c515eb7c-3011-46da-bde5-682245f22781n%40googlegroups.com.

Sanjit Raman

unread,
May 20, 2024, 12:22:14 AMMay 20
to A gathering place for the Open Rail Data community
Hi Peter,

Thank you for your prompt reply!

I was having a look at the different sources of data around -- for my purposes, I want to be able to recreate one of those platform departure signs at home (accurately, so perhaps refreshes every 1 min during my commute times)... Do you know what would be the most suitable for this? Are there some projects that have already done this kind of thing?

I can confirm the wiki link works, and was quite helpful.

Kind regards,

Sanjit

Mike F (Hastings Line)

unread,
May 20, 2024, 4:00:22 AMMay 20
to A gathering place for the Open Rail Data community

Sanjit

Calling the departure board API is actually very straightforward, reliable and responsive

The actual implementation will depend on the programming language you use, but the steps to follow are
  1. Register with the National Rail Enquiries Darwin Lite Webservice and get your authentication token
  2. Use your favourite web service client to test that the GetDepartureBoardRequest works (sample query below)
  3. Check the GetDepartureBoardResult XML that is returned and study the data specs at https://realtime.nationalrail.co.uk/OpenLDBWS/
  4. Write code to parse the XML
    • Make allowance for different times: scheduled, estimated and actual, also cancellations and replacement bus services
    • There may also be operational messages returned that you may want to display 
  5. Write code to display the departure board
Mike


Sample departure board query:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:typ="http://thalesgroup.com/RTTI/2013-11-28/Token/types" xmlns:ldb="http://thalesgroup.com/RTTI/2017-10-01/ldb/">
<soap:Header>
    <typ:AccessToken>
        <typ:TokenValue>your-token-goes-here</typ:TokenValue>
    </typ:AccessToken>
</soap:Header>
<soap:Body>
    <ldb:GetDepartureBoardRequest>
        <ldb:numRows>100</ldb:numRows>
        <ldb:crs>STP</ldb:crs>
        <ldb:filterCrs></ldb:filterCrs>
        <ldb:filterType>to</ldb:filterType>
        <ldb:timeOffset>0</ldb:timeOffset>
        <ldb:timeWindow>120</ldb:timeWindow>
    </ldb:GetDepartureBoardRequest>
</soap:Body>
</soap:Envelope>

David Wheatley

unread,
May 20, 2024, 4:16:49 AMMay 20
to A gathering place for the Open Rail Data community
Hi Sanjit,

I run raildotmatrix.co.uk which uses the LDBWS API to retrieve live data for various HTML/JS-based departure boards, as well as railannouncements.co.uk which combines this with FOI-released audio recordings to announce train departures in real time alongside a departure board.

To make my life easier, my requests get proxied through a self-hosted Huxley2 instance which essentially transforms the XML into usable JSON data instead, more suited to a web frontend.

Hits to the Huxley2 instance are actually done via a Cloudflare Worker which automatically embeds details of associated services so that splits can be rendered correctly (subject to frontend bugs). This worker also performs some caching of data so that I don't re-request every service every time data is loaded on the website (as I was going to go well beyond the free usage limits!).

Across my two websites which use the LDBWS API, I make approximately 576k requests per week, which is putting me close to about half of the API's free usage limits. I'm not too close to be worried about that one, but I have exceeded the 5000 req/hr usage cap a few times (which can be seen on the charts below) and I haven't been rate limited or restricted from the API (yet). I wouldn't worry about the API limits, as Peter says.

Screenshot 2024-05-20 090907.pngScreenshot 2024-05-20 090938.png

Amusingly, I've not been able to access the LDBWS API dashboard for the last 3 years despite my token being active. My user for the website appears to have been deleted at some point and I haven't needed to make a new one.


On Monday 20 May 2024 at 05:22:14 UTC+1 Sanjit Raman wrote:
Reply all
Reply to author
Forward
0 new messages