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 |
|---|---|---|---|
| 04:58 | Brighton CALLING AT: Three Bridges (05:03)Haywards Heath (05:13) Brighton (05:32) Thameslink (8 coaches) |
2 | On time |
| 05:19 | Bedford CALLING AT: Redhill (05:28)East Croydon (05:40) London Bridge (05:54) London Blackfriars (06:01) City Thameslink (06:03) Farringdon (06:06) London St Pancras (Intl) (06:10) West Hampstead Thameslink (06:19) St Albans (06:35) Harpenden (06:42) Luton Airport Parkway (06:48) Luton (06:52) Leagrave (06:57) Harlington (07:02) Flitwick (07:06) Bedford (07:20) Thameslink (12 coaches) |
1 | On time |
| 05:28 | London Victoria CALLING AT: Horley (05:30)Redhill (05:39) Merstham (05:45) Coulsdon South (05:50) Purley (05:53) East Croydon (06:00) Clapham Junction (06:10) London Victoria (06:19) Southern (8 coaches) |
1 | On time |
| 05:32 | Bedford CALLING AT: Horley (05:34)Salfords (05:38) Earlswood (Surrey) (05:42) Redhill (05:46) Purley (05:56) South Croydon (06:00) East Croydon (06:03) Norwood Junction (06:07) London Bridge (06:20) London Blackfriars (06:26) City Thameslink (06:28) Farringdon (06:31) London St Pancras (Intl) (06:35) St Albans (06:54) Harpenden (07:01) Luton Airport Parkway (07:06) Luton (07:10) Leagrave (07:15) Harlington (07:20) Flitwick (07:24) Bedford (07:39) Thameslink (12 coaches) |
1 | On time |
| 05:32 | Brighton CALLING AT: Three Bridges (05:37)Balcombe (05:46) Haywards Heath (05:51) Wivelsfield (05:55) Burgess Hill (05:57) Hassocks (06:01) Preston Park (06:07) Brighton (06:11) Thameslink (12 coaches) |
3 | On time |
| 05:39 | London Victoria CALLING AT: London Victoria (06:12)Gatwick Express (8 coaches) |
1 | On time |
| 05:46 | Finsbury Park CALLING AT: East Croydon (06:01)London Bridge (06:15) London Blackfriars (06:21) City Thameslink (06:23) Farringdon (06:26) London St Pancras (Intl) (06:30) Finsbury Park (06:37) Thameslink (12 coaches) |
4 | On time |
| 05:49 | Peterborough CALLING AT: Horley (05:51)Redhill (05:59) Merstham (06:03) Coulsdon South (06:08) East Croydon (06:15) London Bridge (06:30) London Blackfriars (06:36) City Thameslink (06:38) Farringdon (06:41) London St Pancras (Intl) (06:45) Finsbury Park (06:52) Stevenage (07:13) Hitchin (07:20) Arlesey (07:26) Biggleswade (07:31) Sandy (07:35) St Neots (07:42) Huntingdon (07:50) Peterborough (08:07) Thameslink (12 coaches) |
1 | On time |
| 05:50 | London Victoria CALLING AT: East Croydon (06:04)Clapham Junction (06:14) London Victoria (06:23) Southern (8 coaches) |
4 | On time |
| 05:51 | Brighton CALLING AT: Three Bridges (05:55)Haywards Heath (06:05) Wivelsfield (06:10) Burgess Hill (06:12) Hassocks (06:15) Preston Park (06:22) Brighton (06:26) Thameslink (12 coaches) |
7 | On time |