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 |
|---|---|---|---|
| 16:53 | Cambridge CALLING AT: East Croydon (17:07)London Bridge (17:23) London Blackfriars (17:30) Farringdon (17:35) London St Pancras (Intl) (17:39) Finsbury Park (17:46) Stevenage (18:08) Hitchin (18:15) Letchworth Garden City (18:21) Baldock (18:24) Ashwell & Morden (18:29) Royston (18:33) Cambridge (18:50) Thameslink (12 coaches) |
4 | 17:04 |
| 17:04 | Brighton CALLING AT: Three Bridges (17:08)Haywards Heath (17:18) Wivelsfield (17:22) Burgess Hill (17:24) Hassocks (17:28) Preston Park (17:35) Hove (17:38) Brighton (17:48) Southern (12 coaches) |
6 | 17:08 |
| 17:06 | Mill Hill Broadway CALLING AT: East Croydon (17:21)London Bridge (17:36) London Blackfriars (17:42) Farringdon (17:47) London St Pancras (Intl) (17:51) West Hampstead Thameslink (18:01) Cricklewood (18:04) Brent Cross West (18:07) Hendon (18:09) Mill Hill Broadway (18:12) Thameslink (12 coaches) |
4 | On time |
| 17:08 | Haywards Heath CALLING AT: Three Bridges (17:12)Balcombe (17:19) Haywards Heath (17:25) Thameslink (8 coaches) |
7 | On time |
| 17:10 | Three Bridges CALLING AT: Three Bridges (17:15)Thameslink (8 coaches) |
3 | On time |
| 17:12 | London Victoria CALLING AT: London Victoria (17:42)Gatwick Express (8 coaches) |
5 | On time |
| 17:15 | Portsmouth Harbour and Bognor Regis CALLING AT: Three Bridges (17:19)Crawley (17:23) Horsham (17:32) Christs Hospital (17:37) Billingshurst (17:43) Pulborough (17:49) Amberley (17:55) Arundel (18:00) Ford (18:06) Barnham (18:10) Chichester (18:21) Southbourne (18:29) Emsworth (18:32) Havant (18:36) Fratton (18:47) Portsmouth & Southsea (18:51) Portsmouth Harbour (18:55) Train divides at Barnham CALLING AT: Bognor Regis (18:24)Southern (12 coaches) |
3 | 17:29 |
| 17:15 | London Victoria CALLING AT: East Croydon (17:30)Clapham Junction (17:42) London Victoria (17:49) Southern (12 coaches) |
4 | On time |
| 17:21 | Ore CALLING AT: Haywards Heath (17:32)Wivelsfield (17:36) Plumpton (17:43) Cooksbridge (17:48) Lewes (17:53) Polegate (18:05) Eastbourne (18:14) Hampden Park (18:23) Pevensey & Westham (18:28) Normans Bay (18:33) Cooden Beach (18:38) Collington (18:41) Bexhill (18:43) St Leonards Warrior Square (18:50) Hastings (18:53) Ore (18:57) Southern (8 coaches) |
6 | 17:29 |
| 17:24 | Three Bridges CALLING AT: Three Bridges (17:28)Thameslink (12 coaches) |
7 | On time |