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 |
|---|---|---|---|
| 07:52 | Littlehampton CALLING AT: Haywards Heath (08:02)Burgess Hill (08:09) Hassocks (08:13) Preston Park (08:20) Hove (08:23) Portslade (08:27) Shoreham-by-Sea (08:31) Lancing (08:36) Worthing (08:40) West Worthing (08:42) Durrington-on-Sea (08:45) Goring-by-Sea (08:48) Angmering (08:52) Littlehampton (09:02) Southern (8 coaches) |
7 | 07:55 |
| 07:56 | Eastbourne CALLING AT: Haywards Heath (08:07)Wivelsfield (08:12) Cooksbridge (08:21) Lewes (08:26) Polegate (08:39) Hampden Park (08:45) Eastbourne (08:49) Southern (8 coaches) |
6 | 07:58 |
| 07:56 | London Victoria CALLING AT: East Croydon (08:11)Clapham Junction (08:21) London Victoria (08:28) Southern (8 coaches) |
4 | On time |
| 07:59 | Reading CALLING AT: Redhill (08:09)Reigate (08:16) Dorking Deepdene (08:24) Shalford (08:37) Guildford (08:43) Ash (08:53) North Camp (08:58) Farnborough North (09:02) Blackwater (09:07) Sandhurst (09:11) Crowthorne (09:15) Wokingham (09:21) Reading (09:30) Great Western Railway |
1 | On time |
| 08:01 | Brighton CALLING AT: Haywards Heath (08:11)Brighton (08:27) Gatwick Express (8 coaches) |
6 | On time |
| 08:02 | Bedford CALLING AT: Horley (08:05)Salfords (08:09) Earlswood (Surrey) (08:12) Redhill (08:16) Purley (08:26) South Croydon (08:30) East Croydon (08:33) Norwood Junction (08:37) London Bridge (08:50) London Blackfriars (08:56) City Thameslink (08:58) Farringdon (09:01) London St Pancras (Intl) (09:05) St Albans (09:24) Harpenden (09:31) Luton Airport Parkway (09:36) Luton (09:40) Leagrave (09:45) Harlington (09:50) Flitwick (09:54) Bedford (10:09) Thameslink (12 coaches) |
1 | 08:03 |
| 08:02 | London Victoria CALLING AT: East Croydon (08:18)Clapham Junction (08:28) London Victoria (08:36) Southern (8 coaches) |
5 | On time |
| 08:05 | Brighton CALLING AT: Three Bridges (08:09)Balcombe (08:16) Haywards Heath (08:21) Wivelsfield (08:26) Burgess Hill (08:28) Hassocks (08:32) Preston Park (08:38) Brighton (08:43) Thameslink (12 coaches) |
7 | On time |
| 08:05 | Three Bridges CALLING AT: Three Bridges (08:10)Thameslink (12 coaches) |
3 | 08:07 |
| 08:06 | Bedford CALLING AT: East Croydon (08:21)London Bridge (08:35) London Blackfriars (08:41) City Thameslink (08:43) Farringdon (08:46) London St Pancras (Intl) (08:50) West Hampstead Thameslink (08:59) St Albans (09:11) Harpenden (09:17) Luton Airport Parkway (09:23) Luton (09:27) Leagrave (09:31) Harlington (09:36) Flitwick (09:40) Bedford (09:54) Thameslink (12 coaches) |
4 | On time |