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:00 | Bedford CALLING AT: Horley (16:03)Salfords (16:07) Earlswood (Surrey) (16:10) Redhill (16:14) Merstham (16:19) Coulsdon South (16:24) Purley (16:27) East Croydon (16:33) Norwood Junction (16:37) London Bridge (16:50) London Blackfriars (16:56) Farringdon (17:01) London St Pancras (Intl) (17:05) West Hampstead Thameslink (17:14) St Albans (17:27) Harpenden (17:33) Luton Airport Parkway (17:39) Luton (17:43) Leagrave (17:47) Harlington (17:52) Flitwick (17:56) Bedford (18:10) Thameslink (12 coaches) |
1 | 16:21 |
| 16:15 | Portsmouth Harbour and Bognor Regis CALLING AT: Three Bridges (16:19)Crawley (16:23) Horsham (16:32) Christs Hospital (16:37) Billingshurst (16:43) Pulborough (16:49) Amberley (16:55) Arundel (17:00) Ford (17:06) Barnham (17:10) Chichester (17:21) Southbourne (17:29) Emsworth (17:32) Havant (17:36) Fratton (17:46) Portsmouth & Southsea (17:50) Portsmouth Harbour (17:54) Train divides at Barnham CALLING AT: Bognor Regis (17:24)Southern (12 coaches) |
3 | 16:16 |
| 16:15 | London Victoria CALLING AT: East Croydon (16:29)Clapham Junction (16:39) London Victoria (16:46) Southern (12 coaches) |
4 | On time |
| 16:20 | Ore CALLING AT: Haywards Heath (16:30)Wivelsfield (16:35) Plumpton (16:42) Cooksbridge (16:46) Lewes (16:51) Polegate (17:04) Eastbourne (17:12) Hampden Park (17:21) Pevensey & Westham (17:26) Normans Bay (17:31) Cooden Beach (17:36) Collington (17:39) Bexhill (17:41) St Leonards Warrior Square (17:49) Hastings (17:53) Ore (17:57) Southern (8 coaches) |
6 | On time |
| 16:23 | Brighton CALLING AT: Three Bridges (16:27)Haywards Heath (16:37) Burgess Hill (16:43) Brighton (16:54) Thameslink (12 coaches) |
7 | 16:25 |
| 16:26 | Reading CALLING AT: Redhill (16:34)Reigate (16:41) Dorking Deepdene (16:49) Guildford (17:07) Ash (17:17) North Camp (17:22) Farnborough North (17:26) Blackwater (17:30) Sandhurst (17:34) Crowthorne (17:38) Wokingham (17:44) Reading (17:53) Great Western Railway |
2 | On time |
| 16:29 | London Victoria CALLING AT: East Croydon (16:43)Clapham Junction (16:54) London Victoria (17:03) Southern (8 coaches) |
4 | On time |
| 16:32 | Brighton CALLING AT: Three Bridges (16:36)Haywards Heath (16:46) Burgess Hill (16:52) Hassocks (16:55) Brighton (17:05) Southern (12 coaches) |
6 | On time |
| 16:34 | Bedford CALLING AT: Horley (16:37)Salfords (16:39) Earlswood (Surrey) (16:41) Redhill (16:44) Merstham (16:49) Coulsdon South (16:54) Purley (16:57) East Croydon (17:03) Norwood Junction (17:07) London Bridge (17:20) London Blackfriars (17:26) Farringdon (17:31) London St Pancras (Intl) (17:35) West Hampstead Thameslink (17:44) St Albans (17:57) Harpenden (18:03) Luton Airport Parkway (18:09) Luton (18:13) Leagrave (18:17) Harlington (18:22) Flitwick (18:26) Bedford (18:40) Thameslink (12 coaches) |
1 | On time |
| 16:35 | Brighton CALLING AT: Three Bridges (16:39)Balcombe (16:46) Haywards Heath (16:51) Wivelsfield (16:56) Burgess Hill (16:58) Hassocks (17:02) Preston Park (17:08) Brighton (17:13) Thameslink (12 coaches) |
7 | On time |