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 |
|---|---|---|---|
| 10:35 | Three Bridges CALLING AT: Three Bridges (10:40)Thameslink (12 coaches) |
3 | 10:53 |
| 10:45 | Brighton CALLING AT: Three Bridges (10:49)Haywards Heath (10:59) Burgess Hill (11:05) Brighton (11:18) Thameslink (12 coaches) |
7 | 10:49 |
| 10:46 | Cambridge CALLING AT: East Croydon (11:01)London Bridge (11:15) London Blackfriars (11:21) City Thameslink (11:23) Farringdon (11:26) London St Pancras (Intl) (11:30) Finsbury Park (11:37) Stevenage (11:58) Hitchin (12:04) Letchworth Garden City (12:09) Baldock (12:13) Ashwell & Morden (12:18) Royston (12:22) Cambridge (12:39) Thameslink (12 coaches) |
4 | On time |
| 10:47 | Horsham CALLING AT: Three Bridges (10:52)Crawley (10:57) Ifield (11:00) Littlehaven (11:06) Horsham (11:10) Thameslink (12 coaches) |
3 | 11:03 |
| 10:49 | Peterborough CALLING AT: Horley (10:51)Redhill (10:59) Merstham (11:03) Coulsdon South (11:08) East Croydon (11:15) London Bridge (11:30) London Blackfriars (11:36) City Thameslink (11:38) Farringdon (11:41) London St Pancras (Intl) (11:45) Finsbury Park (11:52) Stevenage (12:14) Hitchin (12:21) Arlesey (12:27) Biggleswade (12:32) Sandy (12:36) St Neots (12:43) Huntingdon (12:51) Peterborough (13:08) Thameslink (12 coaches) |
1 | 11:03 |
| 10:52 | Littlehampton CALLING AT: Haywards Heath (11:03)Burgess Hill (11:09) Hassocks (11:13) Preston Park (11:20) Hove (11:23) Portslade (11:27) Shoreham-by-Sea (11:32) Lancing (11:36) Worthing (11:41) West Worthing (11:43) Durrington-on-Sea (11:46) Goring-by-Sea (11:49) Angmering (11:54) Littlehampton (12:04) Southern (8 coaches) |
6 | 10:53 |
| 10:55 | Three Bridges CALLING AT: Three Bridges (11:00)Thameslink (12 coaches) |
3 | 11:02 |
| 10:56 | London Victoria CALLING AT: East Croydon (11:11)Clapham Junction (11:21) London Victoria (11:28) Southern (8 coaches) |
4 | On time |
| 10:57 | Eastbourne CALLING AT: Haywards Heath (11:08)Wivelsfield (11:12) Cooksbridge (11:21) Lewes (11:26) Polegate (11:39) Hampden Park (11:47) Eastbourne (11:51) Southern (8 coaches) |
7 | On time |
| 10:59 | Reading CALLING AT: Redhill (11:07)Reigate (11:14) Dorking Deepdene (11:22) Guildford (11:41) Ash (11:51) North Camp (11:56) Farnborough North (12:00) Blackwater (12:04) Sandhurst (12:08) Crowthorne (12:12) Wokingham (12:18) Reading (12:27) Great Western Railway (3 coaches) |
2 | On time |