The Darwin Push Port is an XML push feed that continuously streams information about the creation of, and changes to, train schedule records, together with train running predictions made by Darwin.
The Push Port can be filtered to a specific area of interest by TIPLOC, or to provide information for the entire country. Either way, the information delivered is complex and must be properly interpreted before presentation to end users.
The Push Port requires the user to build a database capable of capturing extremely high volumes of information, as well as a query engine to draw the information from your database. There is a large amount of interpretation work involved in this; however this allows substantial flexibility to apply the information to any product within the limitations of your own infrastructure.
The Push Port has three components:
- Reference Data, available over FTP once a day
- Timetable, available over FTP once a day
- Real-time updates, available over Stomp and historically, in-day, via FTP
The reference data contains:
- TIPLOCs, CRS codes, TOC codes and location names
- TOC codes, names and website URLs
- Late Running reason codes and text
- Cancellation reason codes and text
- Via locations
- CIS codes and names
There are two components to the Darwin Timetable:
- A timetable snapshot, available once a day via FTP
- Schedule updates via the Real-time feed (see below)
NOTE: All messages in the real-time update stream are sent in XML with the message body compressed using gzip.
Each message in the update feed contains update response element, which is in turn nested inside a 'Pport' element:
- Schedule data
- Association data
- Actual and Forecast data
- Train order data
- Station Messages
- Train Alerts
- Tracking ID corrections
How do I get the data?
To access the data feeds you must register for an account at http://datafeeds.nationalrail.co.uk. Once you have submitted the registration form, you should receive a confirmation email. Follow the instructions in the email and set your new password.
Once you have set your password and signed in, navigate to the data feeds screen by clicking on the My Feeds link at the top of the page. You will find your queue name, username and password, as well as details of the username and password you should use to download data from the FTP service.
Keep your queue name private, and do not let others know what it is.
Accessing real-time data
The data from the Push Port is available on datafeeds.nationalrail.co.uk via:
Messages bodies are compressed using gzip before being placed on per-user queues.
Each user's queue maintains 5 minutes worth of Push Port messages.
Important - Please note that once you have registered for an account, if you leave your message queue idle for an extended period, i.e. you do not connect your STOMP client to pull data down, your account and queue will be deleted. The unused account expiry period is currently set to 100 days. If your account has been deleted, you will receive a notification email, and you will be able to re-register for a new account.
Accessing non-real time data
Darwin releases the timetable and reference data file once a day. These files along with a snapshot file that is taken shortly after the timetable has been downloaded are made available for download via an FTP site. All Push Port messages that are older than 5 minutes are also placed in this FTP site in log files, with each log file containing 5 minutes of Push Port messages. It should be noted that the messages in the log files in the FTP site are not compressed.
The FTP site's URL and access credentials are displayed in the My Feeds screen.
You should follow the good practice guide when using this service.
Code examples for STOMP clients are available in Github.
The advanced usage page contains examples of some advanced applications for the data feeds, including bridging the ActiveMQ feeds to your own messaging server.
If you are having problems with the feeds:
- First, read this wiki - there's a lot of material here that will help you
- Check twitter 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 email@example.com
|National Rail Enquiries Data Feeds|
|Data Feeds||About the Feeds • Darwin Webservice (Public) • Darwin Webservice (Staff) • Historical Service Performance • Push Port|
|Push Port||About • XML Schemas • Schedule Data • Association Data • Train Status Data • Station Messages|