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