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