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