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 |
|---|---|---|---|
| 20:32 | London Victoria CALLING AT: East Croydon (20:48)Clapham Junction (20:58) London Victoria (21:05) Southern (12 coaches) |
5 | 20:36 |
| 20:35 | Brighton CALLING AT: Three Bridges (20:39)Balcombe (20:46) Haywards Heath (20:51) Wivelsfield (20:56) Burgess Hill (20:58) Hassocks (21:02) Preston Park (21:08) Brighton (21:13) Thameslink (12 coaches) |
7 | On time |
| 20:35 | Three Bridges CALLING AT: Three Bridges (20:40)Thameslink (12 coaches) |
3 | 20:37 |
| 20:36 | Bedford CALLING AT: East Croydon (20:51)London Bridge (21:05) London Blackfriars (21:11) City Thameslink (21:13) Farringdon (21:16) London St Pancras (Intl) (21:20) West Hampstead Thameslink (21:29) St Albans (21:41) Harpenden (21:47) Luton Airport Parkway (21:53) Luton (21:57) Leagrave (22:01) Harlington (22:06) Flitwick (22:10) Bedford (22:24) Thameslink (12 coaches) |
4 | 20:41 |
| 20:39 | Portsmouth Harbour and Bognor Regis CALLING AT: Three Bridges (20:44)Crawley (20:48) Horsham (20:57) Barnham (21:29) Chichester (21:37) Fishbourne (West Sussex) (21:41) Bosham (21:44) Nutbourne (21:48) Southbourne (21:51) Emsworth (21:54) Warblington (21:57) Havant (21:59) Hilsea (22:06) Fratton (22:10) Portsmouth & Southsea (22:14) Portsmouth Harbour (22:18) Train divides at Horsham CALLING AT: Christs Hospital (21:09)Billingshurst (21:15) Pulborough (21:22) Amberley (21:28) Arundel (21:32) Ford (21:38) Barnham (21:43) Bognor Regis (21:51) Southern (8 coaches) |
6 | On time |
| 20:40 | London Victoria CALLING AT: London Victoria (21:09)Gatwick Express (8 coaches) |
5 | On time |
| 20:43 | London Victoria CALLING AT: East Croydon (20:58)Clapham Junction (21:07) London Victoria (21:15) Southern (12 coaches) |
2 | On time |
| 20:45 | Brighton | Cancelled | |
| 20:46 | Cambridge CALLING AT: East Croydon (21:01)London Bridge (21:15) London Blackfriars (21:21) City Thameslink (21:23) Farringdon (21:26) London St Pancras (Intl) (21:30) Finsbury Park (21:37) Stevenage (21:58) Hitchin (22:04) Letchworth Garden City (22:09) Baldock (22:13) Ashwell & Morden (22:18) Royston (22:22) Cambridge (22:39) Thameslink (12 coaches) |
4 | On time |
| 20:47 | Horsham CALLING AT: Three Bridges (20:52)Crawley (20:57) Ifield (21:00) Littlehaven (21:06) Horsham (21:10) Thameslink (12 coaches) |
3 | On time |