Please note: Rail Delivery Group plans to retire the National Rail Data Portal (including OpenLDBWS) in early 2026. Alternatives are now available via the Rail Data Marketplace
<!DOCTYPE html>
<html lang="en">
<head>
<style type='text/css'>
body {
font-family: monospace;
white-space: nowrap;
}
table {
border-collapse: collapse;
}
th,td {
border: 1px solid #eee;
padding: 10px;
vertical-align:top;
}
th:nth-child(1),th:nth-child(2) {
text-align: left;
}
th:nth-child(3),td:nth-child(3) {
text-align: center;
}
th:nth-child(4),td:nth-child(4) {
text-align: right;
}
</style>
</head>
<body>
<?php
require("OpenLDBWS.php");
$OpenLDBWS = new OpenLDBWS("YOUR_ACCESS_TOKEN");
$response = $OpenLDBWS->GetDepBoardWithDetails(10,"GTW");
$template["header"] = "
<table>
<thead>
<tr>
<th>Time</th>
<th>Destination</th>
<th>Platform</th>
<th>Expected</th>
</tr>
</thead>
<tbody>
";
$template["row"] = "
<tr>
<td>{std}</td>
<td><strong>{destination}</strong>{detail}</td>
<td>{platform}</td>
<td>{etd}</td>
</tr>
";
$template["footer"] = "
</tbody>
</table>
";
if (isset($response->GetStationBoardResult))
{
print "<p><strong>".$response->GetStationBoardResult->locationName."</strong> Departures</p>";
if (isset($response->GetStationBoardResult->nrccMessages))
{
print "<ul>";
foreach($response->GetStationBoardResult->nrccMessages->message as $message)
{
print "<li>".$message->{"_"}."</li>";
}
print "</ul>";
}
if (isset($response->GetStationBoardResult->trainServices->service))
{
print $template["header"];
foreach($response->GetStationBoardResult->trainServices->service as $service)
{
$row = $template["row"];
$destinations = array();
foreach($service->destination->location as $location)
{
$destinations[] = $location->locationName;
}
$row = str_replace("{std}",$service->std,$row);
$row = str_replace("{destination}",implode(" and ",$destinations),$row);
$row = str_replace("{platform}",(isset($service->platform)?$service->platform:" "),$row);
$row = str_replace("{etd}",$service->etd,$row);
$detail = "";
if (($service->etd != "Cancelled") && isset($service->subsequentCallingPoints))
{
foreach($service->subsequentCallingPoints->callingPointList as $k => $callingPointList)
{
$callingPoints = $callingPointList->callingPoint;
if ($k)
{
$callingPoint = array_shift($callingPoints);
$detail .= "<p>Train divides at <strong>".$callingPoint->locationName."</strong></p>";
}
$detail .= "<p>CALLING AT:</p>";
foreach($callingPoints as $callingPoint)
{
$detail .= $callingPoint->locationName." (".(($callingPoint->st == "On time")?$callingPoint->et:$callingPoint->st).")<br />";
}
}
$detail .= "<p>".$service->operator.(isset($service->length)?" (".$service->length." coaches)":"")."</p>";
}
$row = str_replace("{detail}",$detail,$row);
print $row;
}
print $template["footer"];
}
else
{
print "<p>No services within 2 hours.</p>";
}
}
?>
</body>
</html>
Gatwick Airport Departures
| Time | Destination | Platform | Expected |
|---|---|---|---|
| 11:10 | London Victoria CALLING AT: London Victoria (11:41)Gatwick Express (8 coaches) |
5 | 11:16 |
| 11:15 | Brighton CALLING AT: Three Bridges (11:19)Haywards Heath (11:29) Burgess Hill (11:35) Brighton (11:48) Thameslink (12 coaches) |
7 | On time |
| 11:16 | Cambridge CALLING AT: East Croydon (11:31)London Bridge (11:45) London Blackfriars (11:51) City Thameslink (11:53) Farringdon (11:56) London St Pancras (Intl) (12:00) Finsbury Park (12:07) Stevenage (12:28) Hitchin (12:34) Letchworth Garden City (12:39) Baldock (12:43) Ashwell & Morden (12:48) Royston (12:52) Cambridge (13:09) Thameslink (12 coaches) |
4 | 11:18 |
| 11:17 | Horsham CALLING AT: Three Bridges (11:22)Crawley (11:27) Ifield (11:30) Littlehaven (11:36) Horsham (11:40) Thameslink (12 coaches) |
3 | On time |
| 11:19 | Peterborough CALLING AT: Horley (11:21)Redhill (11:29) Merstham (11:33) Coulsdon South (11:38) East Croydon (11:45) London Bridge (12:00) London Blackfriars (12:06) City Thameslink (12:08) Farringdon (12:11) London St Pancras (Intl) (12:15) Finsbury Park (12:22) Stevenage (12:43) Hitchin (12:50) Arlesey (12:56) Biggleswade (13:01) Sandy (13:05) St Neots (13:12) Huntingdon (13:20) Peterborough (13:41) Thameslink (12 coaches) |
1 | On time |
| 11:22 | Littlehampton CALLING AT: Haywards Heath (11:33)Burgess Hill (11:39) Hassocks (11:43) Preston Park (11:50) Hove (11:53) Portslade (11:57) Shoreham-by-Sea (12:02) Lancing (12:06) Worthing (12:11) West Worthing (12:13) Durrington-on-Sea (12:16) Goring-by-Sea (12:19) Angmering (12:24) Littlehampton (12:34) Southern (8 coaches) |
6 | On time |
| 11:26 | London Victoria CALLING AT: East Croydon (11:41)Clapham Junction (11:54) London Victoria (12:01) Southern (8 coaches) |
4 | 11:27 |
| 11:26 | Ore CALLING AT: Haywards Heath (11:37)Wivelsfield (11:42) Plumpton (11:49) Lewes (11:56) Polegate (12:09) Eastbourne (12:17) Hampden Park (12:27) Pevensey & Westham (12:32) Normans Bay (12:37) Cooden Beach (12:42) Collington (12:45) Bexhill (12:48) St Leonards Warrior Square (12:55) Hastings (12:58) Ore (13:02) Southern (8 coaches) |
7 | On time |
| 11:29 | Reading CALLING AT: Redhill (11:37)Reigate (11:44) Betchworth (11:49) Dorking Deepdene (11:53) Dorking West (11:57) Shalford (12:10) Guildford (12:15) North Camp (12:31) Blackwater (12:37) Wokingham (12:46) Reading (12:57) Great Western Railway |
2 | On time |
| 11:31 | Brighton CALLING AT: Haywards Heath (11:41)Brighton (11:57) Gatwick Express (8 coaches) |
6 | On time |