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:08 | Brighton CALLING AT: Three Bridges (14:12)Balcombe (14:19) Haywards Heath (14:24) Wivelsfield (14:29) Burgess Hill (14:31) Hassocks (14:35) Preston Park (14:41) Brighton (14:45) Thameslink (12 coaches) |
7 | 14:12 |
| 14:11 | Three Bridges CALLING AT: Three Bridges (14:16)Thameslink (8 coaches) |
3 | 14:17 |
| 14:13 | London Victoria CALLING AT: London Victoria (14:50)Gatwick Express (8 coaches) |
5 | 14:18 |
| 14:16 | Brighton CALLING AT: Three Bridges (14:20)Haywards Heath (14:29) Burgess Hill (14:36) Hassocks (14:40) Brighton (14:49) Southern (8 coaches) |
6 | 14:24 |
| 14:16 | London Victoria CALLING AT: East Croydon (14:35)Clapham Junction (14:48) London Victoria (14:55) Southern (8 coaches) |
4 | On time |
| 14:23 | Havant and Bognor Regis CALLING AT: Three Bridges (14:28)Crawley (14:32) Horsham (14:41) Christs Hospital (14:45) Billingshurst (14:51) Pulborough (14:58) Amberley (15:04) Arundel (15:08) Ford (15:14) Barnham (15:19) Chichester (15:30) Southbourne (15:38) Emsworth (15:41) Havant (15:44) Train divides at Barnham CALLING AT: Bognor Regis (15:35)Southern (12 coaches) |
3 | 14:31 |
| 14:26 | London Victoria CALLING AT: East Croydon (14:43)Clapham Junction (14:56) London Victoria (15:03) Southern (8 coaches) |
4 | 14:28 |
| 14:26 | Reading CALLING AT: Redhill (14:34)Reigate (14:41) Dorking Deepdene (14:49) Guildford (15:07) Ash (15:17) North Camp (15:22) Farnborough North (15:26) Blackwater (15:30) Sandhurst (15:34) Crowthorne (15:38) Wokingham (15:44) Reading (15:53) Great Western Railway |
1 | On time |
| 14:29 | Brighton CALLING AT: Haywards Heath (14:39)Wivelsfield (14:44) Burgess Hill (14:46) Brighton (14:59) Southern (8 coaches) |
6 | 14:34 |
| 14:31 | Bedford CALLING AT: Horley (14:33)Redhill (14:41) Merstham (14:45) Coulsdon South (14:50) Purley (14:54) East Croydon (14:59) Norwood Junction (15:03) London Bridge (15:18) London Blackfriars (15:26) Farringdon (15:31) London St Pancras (Intl) (15:35) West Hampstead Thameslink (15:44) St Albans (15:57) Harpenden (16:03) Luton Airport Parkway (16:09) Luton (16:13) Leagrave (16:17) Harlington (16:22) Flitwick (16:26) Bedford (16:40) Thameslink (8 coaches) |
2 | On time |