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:46 | Horsham CALLING AT: Three Bridges (23:50)Crawley (23:55) Ifield (23:58) Littlehaven (00:04) Horsham (00:07) Thameslink (12 coaches) |
5 | 23:49 |
| 23:48 | London Victoria CALLING AT: Redhill (23:58)East Croydon (00:13) Clapham Junction (00:28) London Victoria (00:36) Southern (8 coaches) |
4 | On time |
| 23:51 | Bedford CALLING AT: East Croydon (00:16)London Blackfriars (00:42) London St Pancras (Intl) (00:50) Kentish Town (00:55) West Hampstead Thameslink (00:59) Cricklewood (01:01) Brent Cross West (01:04) Hendon (01:06) Mill Hill Broadway (01:09) Elstree & Borehamwood (01:13) Radlett (01:18) St Albans (01:24) Harpenden (01:31) Luton Airport Parkway (01:36) Luton (01:40) Leagrave (01:45) Harlington (01:49) Flitwick (01:53) Bedford (02:07) Thameslink (12 coaches) |
4 | On time |
| 00:04 | Horsham CALLING AT: Three Bridges (00:08)Crawley (00:13) Ifield (00:15) Littlehaven (00:21) Horsham (00:25) Southern (12 coaches) |
6 | On time |
| 00:08 | Worthing CALLING AT: Haywards Heath (00:19)Burgess Hill (00:24) Hassocks (00:28) Preston Park (00:35) Hove (00:38) Portslade (00:42) Southwick (00:45) Shoreham-by-Sea (00:48) Lancing (00:52) Worthing (00:56) Southern (4 coaches) |
6 | 00:10 |
| 00:15 | 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 (8 coaches) |
4 | On time |
| 00:20 | Three Bridges CALLING AT: Three Bridges (00:24)Thameslink |
6 | 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:01) Thameslink (12 coaches) |
6 | On time |
| 00:24 | Reading CALLING AT: Redhill (00:33)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 |
5 | On time |
| 00:27 | Brighton CALLING AT: Three Bridges (00:32)Balcombe (00:38) Haywards Heath (00:43) Wivelsfield (00:48) Burgess Hill (00:51) Hassocks (00:55) Preston Park (01:02) Brighton (01:08) Southern (4 coaches) |
6 | On time |