Difference between revisions of "About the Network Rail feeds"

From Open Rail Data Wiki
Jump to navigation Jump to search
m (→‎Support: Remove Twitter link)
 
(46 intermediate revisions by 9 users not shown)
Line 1: Line 1:
== What are the feeds? ==
+
== Available Feeds ==
  
The following feeds are available:
+
The following feeds are available from Network Rail:
  
 
{| class="wikitable"
 
{| class="wikitable"
 
! Feed
 
! Feed
 
! Type
 
! Type
 +
! Rate
 
! Details
 
! Details
 
|-
 
|-
 
|[[RTPPM]]
 
|[[RTPPM]]
|Real-time low volume
+
|Real-time
 +
|1 per minute
 
|Real Time Public Performance Measure.  This shows the performance of trains against the timetable, measured as the percentage of trains arriving at destination on time, and is updated every minute
 
|Real Time Public Performance Measure.  This shows the performance of trains against the timetable, measured as the percentage of trains arriving at destination on time, and is updated every minute
 
|-
 
|-
 
|[[Train Movements]]
 
|[[Train Movements]]
|Real-time high-volume
+
|Real-time
|Messaging from the TRUST system, containing reports of train movements past timetabled calling and passing points
+
|Up to 600 per minute
 +
|Messaging from the TRUST system, containing reports of train movements past timetabled calling and passing points
 +
'''Note:''' Messages are [[NROD Message Batching|batched]] to reduce network overheads.
 
|-
 
|-
 
|[[TD]]
 
|[[TD]]
|Real-time high-volume
+
|Real-time
|Berth-level data from the Train Describer system, showing raw data with train movements in more detail than the [[Train Movements]] feed
+
|Up to 6000 per minute
 +
|Berth-level data from the Train Describer system, showing raw data with train movements in more detail than the [[Train Movements]] feed
 +
'''Note:''' Messages are [[NROD Message Batching|batched]] to reduce network overheads.
 
|-
 
|-
 
|[[VSTP]]
 
|[[VSTP]]
|Real-time low-volume
+
|Real-time
|Late-notice train schedules which are not available through the [[Schedule]] feed
+
|Low volume
 +
|Late-notice train schedules which are not available through the [[SCHEDULE]] feed
 
|-
 
|-
 
|[[TSR]]
 
|[[TSR]]
|Low-volume
+
|Updated Weekly
|Temporary Speed Restriction data as published in the Weekly Operating Notice
+
|Very low volume (11 per week)
 +
|Temporary Speed Restriction data as published in the Weekly Operating Notice. Published at approx. 0600 UTC on Fridays
 
|-
 
|-
 
|[[SCHEDULE]]  
 
|[[SCHEDULE]]  
|Static data
+
|Static
|Extracts of train schedules from [[ITPS]] in JSON format
+
|Daily
 +
|Extracts of train schedules from [[ITPS]] in CIF or JSON formats
 
|-
 
|-
 +
|[[Reference_Data|Reference Data]]
 +
|Static
 +
|Infrequent
 +
|Reference data which can be used to help analyse other data feeds
 +
|-
 +
|[[Stations_Experience_API|Stations Experience API]]
 +
|Dynamic
 +
|Unknown
 +
|Status of lifts fitted with electronic monitoring units
 
|}
 
|}
  
There are also several [[ReferenceData|sets of reference data]] which are helpful when working with the data.
+
== How do I get the data? ==
  
'''NOTE''': The [[Train Movements]] and [[TD]] messages are [[NROD Message Batching|batched]] to reduce network overheads.
+
First, register for an account by visiting [https://publicdatafeeds.networkrail.co.uk/ https://publicdatafeeds.networkrail.co.uk/].  You will receive a confirmation email.  Follow the instructions to log in and change your password.  When your account is active, you can connect to the service.  Your account may be in [[NROD_Account_States|one of three states]] - the system will send you an email when your account is activated and able to access feeds.
  
== How do I get the data? ==
+
=== Passwords ===
 +
There's a documented issue in the registration process, a user may be given an unhelpful error message when setting a password deemed insufficiently secure. A password must:
 +
* Be at least 8 characters long
 +
* Include a number
 +
* Include "special" characters
 +
* Include uppercase letters
 +
* Include lowercase letters
  
First, register for an account by visiting [http://datafeeds.networkrail.co.uk http://datafeeds.networkrail.co.uk].  You will receive a confirmation email - follow the instructions: log in and change your password.  When your account is active, you can connect to the service.  Your account may be in [[NROD_Account_States|one of three states]].
+
== Accessing the data feeds ==
  
The real-time feeds are available on message queue [http://activemq.apache.org/how-does-a-queue-compare-to-a-topic.html topics].  You will need to use a [http://stomp.github.com/ Stomp] or [http://activemq.apache.org/openwire.html OpenWire] client.  Stomp clients are [http://stomp.github.com/implementations.html#STOMP_1_1_Clients available in many languages].
+
The real-time feeds are accessed using Stomp - details are on the [[Connecting_with_Stomp#Network_Rail|Network Rail connection details page]].
  
 
The static feeds are available via authenticated HTTP GET requests.
 
The static feeds are available via authenticated HTTP GET requests.
  
== Support ==
+
== Status Page ==
 
 
There is no formal technical support from Network Rail for using this service.
 
 
 
Check the [[FAQ]] to see if anyone else has had the same issue.
 
  
This wiki contains a wealth of useful information, and the [https://groups.google.com/d/forum/openraildata-talk openraildata-talk] group on Google Groups has many people who can offer informal help and advice.
+
There is a [https://nrodcaci.grafana.net/public-dashboards/960fa54d94884dc7abd1f5ab9c70df7e?orgId=1 status page] provided by CACI for the publicdatafeeds platform.
  
== Good practice ==
+
== Good Practice ==
  
 
Please bear in mind the following points when you use the service - they're here to make sure everyone gets a good service:
 
Please bear in mind the following points when you use the service - they're here to make sure everyone gets a good service:
Line 60: Line 80:
 
* '''Sign up with one account''' - it gives an accurate reflection of how many people are actually using the service.
 
* '''Sign up with one account''' - it gives an accurate reflection of how many people are actually using the service.
 
* '''Connect to the service once''' - you can receive multiple feeds in a single connection.  If you need to access the data more than once, you can do so - but be sensible!
 
* '''Connect to the service once''' - you can receive multiple feeds in a single connection.  If you need to access the data more than once, you can do so - but be sensible!
* '''Don't leave a failed client running''' - if you can connect but get an authentication or authorization error, stop your client, don't leave it continually trying.
+
* '''Don't leave a failed client running''' - if you can connect but get an authentication or authorization error - '''stop your client''' - don't leave it continually trying.
 
* '''Make sure your client handles failures''' - if your client fails to connect or is disconnected, use [http://en.wikipedia.org/wiki/Exponential_backoff an exponential backoff] and wait 1s, 2s, 4s, 8s, 16s etc. before trying to reconnect.  Service problems sometimes occur, and if everyone tries to reconnect every second, the service will not recover quickly.
 
* '''Make sure your client handles failures''' - if your client fails to connect or is disconnected, use [http://en.wikipedia.org/wiki/Exponential_backoff an exponential backoff] and wait 1s, 2s, 4s, 8s, 16s etc. before trying to reconnect.  Service problems sometimes occur, and if everyone tries to reconnect every second, the service will not recover quickly.
 
* '''Use a durable subscriber''' - if you want data to be queued in case you disconnect, request a [[Durable Subscription|durable subscription]] when you connect.
 
* '''Use a durable subscriber''' - if you want data to be queued in case you disconnect, request a [[Durable Subscription|durable subscription]] when you connect.
 +
* '''Use [http://stomp.github.io/stomp-specification-1.2.html#Heart-beating Stomp heartbeats]''' to detect network problems that may otherwise leave your client hanging with no data.
 +
 +
==Examples==
 +
 +
Code examples for various languages are available from the [[Example_Code | Example Code]] page.
 +
 +
The [[Advanced Uses|advanced usage]] page contains examples of some advanced applications for the data feeds, including bridging the ActiveMQ feeds to your own messaging server.
  
= Background reading =
+
== Support ==
  
It may be useful to understand the background to the sources of some of these data feeds.  These links will help:
+
If you are having problems with the feeds:
  
* [http://www.aecom.com/deployedfiles/Internet/Geographies/Europe/Resources/Rail%20End%20to%20End/rail-end-to-end_stage-3-appendix_20100122.pdf Integrated Passenger Information: Delivering the Rail End to End Journey, Stage 3 - Technical Annex]
+
* First, read this wiki - there's a lot of material here that will help you
 +
* Check the [[Rail_Data_FAQ|FAQ]] to see if you have a common issue
 +
* Check the [https://nrodcaci.grafana.net/public-dashboards/960fa54d94884dc7abd1f5ab9c70df7e?orgId=1 status page] to see if an issue has been reported
 +
* If you want to discuss your problem with other people working with the service, the [https://groups.google.com/d/forum/openraildata-talk openraildata-talk] group on Google Groups will be useful
 +
* Finally, if you're still having a problem, email [mailto:dsg_nrod.support@caci.co.uk dsg_nrod.support@caci.co.uk]
  
==Examples==
+
==Releases==
  
Example code is available for several common languages:
+
For further information on the content of releases please see the [[ReleaseNotes | release notes]].
  
*[[PHP Example]]
+
{{Navtable-DataFeeds}}
*[[C-Sharp|C# Example]]
 
*[[Java]]
 
*[[Ruby]]
 
*[[Node]]
 
  
'''NOTE''': This code has been written by members of the community as a starting point, and may not be a complete solution.
+
[[Category:Network Rail Data Feeds]]

Latest revision as of 13:35, 9 March 2024

Available Feeds

The following feeds are available from Network Rail:

Feed Type Rate Details
RTPPM Real-time 1 per minute Real Time Public Performance Measure. This shows the performance of trains against the timetable, measured as the percentage of trains arriving at destination on time, and is updated every minute
Train Movements Real-time Up to 600 per minute Messaging from the TRUST system, containing reports of train movements past timetabled calling and passing points.

Note: Messages are batched to reduce network overheads.

TD Real-time Up to 6000 per minute Berth-level data from the Train Describer system, showing raw data with train movements in more detail than the Train Movements feed.

Note: Messages are batched to reduce network overheads.

VSTP Real-time Low volume Late-notice train schedules which are not available through the SCHEDULE feed
TSR Updated Weekly Very low volume (11 per week) Temporary Speed Restriction data as published in the Weekly Operating Notice. Published at approx. 0600 UTC on Fridays
SCHEDULE Static Daily Extracts of train schedules from ITPS in CIF or JSON formats
Reference Data Static Infrequent Reference data which can be used to help analyse other data feeds
Stations Experience API Dynamic Unknown Status of lifts fitted with electronic monitoring units

How do I get the data?

First, register for an account by visiting https://publicdatafeeds.networkrail.co.uk/. You will receive a confirmation email. Follow the instructions to log in and change your password. When your account is active, you can connect to the service. Your account may be in one of three states - the system will send you an email when your account is activated and able to access feeds.

Passwords

There's a documented issue in the registration process, a user may be given an unhelpful error message when setting a password deemed insufficiently secure. A password must:

  • Be at least 8 characters long
  • Include a number
  • Include "special" characters
  • Include uppercase letters
  • Include lowercase letters

Accessing the data feeds

The real-time feeds are accessed using Stomp - details are on the Network Rail connection details page.

The static feeds are available via authenticated HTTP GET requests.

Status Page

There is a status page provided by CACI for the publicdatafeeds platform.

Good Practice

Please bear in mind the following points when you use the service - they're here to make sure everyone gets a good service:

  • Sign up with one account - it gives an accurate reflection of how many people are actually using the service.
  • Connect to the service once - you can receive multiple feeds in a single connection. If you need to access the data more than once, you can do so - but be sensible!
  • Don't leave a failed client running - if you can connect but get an authentication or authorization error - stop your client - don't leave it continually trying.
  • Make sure your client handles failures - if your client fails to connect or is disconnected, use an exponential backoff and wait 1s, 2s, 4s, 8s, 16s etc. before trying to reconnect. Service problems sometimes occur, and if everyone tries to reconnect every second, the service will not recover quickly.
  • Use a durable subscriber - if you want data to be queued in case you disconnect, request a durable subscription when you connect.
  • Use Stomp heartbeats to detect network problems that may otherwise leave your client hanging with no data.

Examples

Code examples for various languages are available from the Example Code page.

The advanced usage page contains examples of some advanced applications for the data feeds, including bridging the ActiveMQ feeds to your own messaging server.

Support

If you are having problems with the feeds:

  • First, read this wiki - there's a lot of material here that will help you
  • Check the FAQ to see if you have a common issue
  • Check the status page to see if an issue has been reported
  • If you want to discuss your problem with other people working with the service, the openraildata-talk group on Google Groups will be useful
  • Finally, if you're still having a problem, email dsg_nrod.support@caci.co.uk

Releases

For further information on the content of releases please see the release notes.


Network Rail Open Data Feeds
Data Feeds About the Feeds Account States Durable Subscriptions Example Code ( PHP / C# / Java / Ruby / Node.js) • Advanced UsesFAQ Release Notes
RTPPM RTPPM Feed
Train Movements Train Movements Feed Train Activation Train Cancellation Train Movement Train Reinstatement Change of Origin Change of Identity Change of Location TSPEED Field Planned Cancellations Cancellation Codes
TD TD Feed C-Class Messages S-Class Messages Train Describers TD Berths
VSTP VSTP Feed
TSR TSR Feed Route Codes
SCHEDULE SCHEDULE Feed Schedule and Location Records Association Records CIF Codes How Scheduling Works Allowances
Reference Data Reference Data Feed TOC Codes CIF Codes Delay Attribution Codes Identifying Locations (STANOX, TIPLOC, NLC and 3-Alpha Codes) STANOX Geographical Areas Train Planning data