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 |
|---|---|---|---|
| 23:59 | Haywards Heath CALLING AT: Three Bridges (00:04)Balcombe (00:11) Haywards Heath (00:16) Thameslink (12 coaches) |
3 | 00:12 |
| 00:13 | Three Bridges CALLING AT: Three Bridges (00:18)Thameslink |
3 | 00:18 |
| 00:16 | Bedford CALLING AT: Redhill (00:25)East Croydon (00:39) London Blackfriars (01:06) London St Pancras (Intl) (01:13) West Hampstead Thameslink (01:24) Brent Cross West (01:27) St Albans (01:41) Harpenden (01:48) Luton Airport Parkway (01:53) Luton (01:57) Leagrave (02:02) Harlington (02:06) Flitwick (02:10) Bedford (02:24) Thameslink (12 coaches) |
1 | 00:22 |
| 00:20 | Haywards Heath CALLING AT: Three Bridges (00:24)Balcombe (00:31) Haywards Heath (00:36) Thameslink (8 coaches) |
3 | On time |
| 00:24 | Brighton CALLING AT: Three Bridges (00:28)Balcombe (00:35) Haywards Heath (00:40) Wivelsfield (00:45) Burgess Hill (00:47) Hassocks (00:50) Preston Park (00:57) Brighton (01:08) Southern (4 coaches) |
3 | On time |
| 00:24 | Reading CALLING AT: Redhill (00:32)Reigate (00:42) Dorking Deepdene (00:50) Guildford (01:10) North Camp (01:22) Blackwater (01:29) Wokingham (01:38) Reading (01:47) Great Western Railway |
2 | On time |
| 00:31 | Three Bridges CALLING AT: Three Bridges (00:36)Thameslink |
3 | 00:33 |
| 00:44 | Bedford CALLING AT: Horley (00:46)Redhill (00:54) Purley (01:03) East Croydon (01:09) London Blackfriars (01:36) London St Pancras (Intl) (01:43) Kentish Town (01:48) West Hampstead Thameslink (01:52) Cricklewood (01:55) Brent Cross West (01:58) Hendon (02:00) Mill Hill Broadway (02:03) Elstree & Borehamwood (02:07) Radlett (02:11) St Albans (02:17) Harpenden (02:24) Luton Airport Parkway (02:29) Luton (02:33) Leagrave (02:38) Harlington (02:43) Flitwick (02:47) Bedford (03:01) Thameslink (12 coaches) |
1 | 00:48 |
| 00:49 | Haywards Heath CALLING AT: Three Bridges (00:54)Haywards Heath (01:04) Thameslink (12 coaches) |
3 | On time |
| 01:04 | Three Bridges CALLING AT: Three Bridges (01:09)Southern (4 coaches) |
2 | On time |