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 |
|---|---|---|---|
| 14:58 | London Victoria CALLING AT: East Croydon (15:17)Clapham Junction (15:26) London Victoria (15:33) Southern (8 coaches) |
1 | 15:06 |
| 15:02 | London Bridge CALLING AT: Horley (15:04)Salfords (15:08) Earlswood (Surrey) (15:12) Redhill (15:16) Merstham (15:26) Coulsdon South (15:31) Purley (15:35) East Croydon (15:40) London Bridge (15:56) Thameslink |
1 | 15:06 |
| 15:10 | London Bridge CALLING AT: East Croydon (15:28)London Bridge (15:42) Thameslink (12 coaches) |
1 | On time |
| 15:10 | Three Bridges CALLING AT: Three Bridges (15:15)Thameslink |
3 | 15:12 |
| 15:14 | Portsmouth Harbour and Bognor Regis CALLING AT: Three Bridges (15:19)Crawley (15:23) Horsham (15:32) Christs Hospital (15:37) Billingshurst (15:43) Pulborough (15:49) Amberley (15:55) Arundel (16:00) Ford (16:06) Barnham (16:10) Chichester (16:21) Southbourne (16:29) Emsworth (16:32) Havant (16:36) Fratton (16:46) Portsmouth & Southsea (16:50) Portsmouth Harbour (16:54) Train divides at Barnham CALLING AT: Bognor Regis (16:26)Southern (12 coaches) |
3 | 15:23 |
| 15:14 | London Victoria CALLING AT: East Croydon (15:31)Clapham Junction (15:40) London Victoria (15:47) Southern (8 coaches) |
1 | On time |
| 15:18 | Brighton CALLING AT: Three Bridges (15:23)Haywards Heath (15:33) Burgess Hill (15:38) Hassocks (15:42) Brighton (15:51) Southern (8 coaches) |
3 | On time |
| 15:18 | London Victoria CALLING AT: London Victoria (15:54)Gatwick Express (8 coaches) |
2 | On time |
| 15:25 | Ore CALLING AT: Haywards Heath (15:36)Wivelsfield (15:41) Plumpton (15:48) Cooksbridge (15:52) Lewes (15:57) Polegate (16:10) Eastbourne (16:18) Hampden Park (16:28) Pevensey & Westham (16:33) Normans Bay (16:38) Cooden Beach (16:43) Collington (16:46) Bexhill (16:48) St Leonards Warrior Square (16:55) Hastings (16:58) Ore (17:02) Southern (8 coaches) |
3 | 15:29 |
| 15:28 | London Victoria CALLING AT: East Croydon (15:47)Clapham Junction (15:57) London Victoria (16:04) Southern (8 coaches) |
1 | On time |