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 |
|---|---|---|---|
| 18:22 | Littlehampton CALLING AT: Haywards Heath (18:32)Burgess Hill (18:39) Hassocks (18:43) Preston Park (18:51) Hove (18:57) Portslade (19:01) Shoreham-by-Sea (19:06) Lancing (19:10) Worthing (19:15) West Worthing (19:17) Durrington-on-Sea (19:20) Goring-by-Sea (19:23) Angmering (19:27) Littlehampton (19:37) Southern (12 coaches) |
6 | 18:32 |
| 18:25 | London Victoria CALLING AT: East Croydon (18:40)Clapham Junction (18:50) London Victoria (18:57) Southern (8 coaches) |
4 | 18:44 |
| 18:31 | Brighton CALLING AT: Haywards Heath (18:41)Burgess Hill (18:48) Hassocks (18:52) Preston Park (18:59) Brighton (19:04) Gatwick Express (8 coaches) |
6 | 18:34 |
| 18:32 | Luton CALLING AT: Horley (18:35)Salfords (18:39) Earlswood (Surrey) (18:42) Redhill (18:46) Purley (18:56) South Croydon (19:00) East Croydon (19:03) Norwood Junction (19:07) London Bridge (19:20) London Blackfriars (19:26) City Thameslink (19:28) Farringdon (19:31) London St Pancras (Intl) (19:35) West Hampstead Thameslink (19:44) St Albans (19:57) Harpenden (20:03) Luton Airport Parkway (20:08) Luton (20:13) Thameslink (12 coaches) |
1 | On time |
| 18:33 | London Victoria CALLING AT: East Croydon (18:48)Clapham Junction (18:58) London Victoria (19:06) Southern (8 coaches) |
5 | 18:37 |
| 18:36 | Bedford CALLING AT: East Croydon (18:51)London Bridge (19:05) London Blackfriars (19:11) City Thameslink (19:13) Farringdon (19:16) London St Pancras (Intl) (19:20) St Albans (19:39) Harpenden (19:45) Luton (19:51) Flitwick (20:02) Bedford (20:15) Thameslink (12 coaches) |
4 | On time |
| 18:36 | Brighton CALLING AT: Three Bridges (18:40)Balcombe (18:47) Haywards Heath (18:52) Wivelsfield (18:57) Burgess Hill (18:59) Hassocks (19:03) Preston Park (19:10) Brighton (19:15) Thameslink (12 coaches) |
6 | 18:40 |
| 18:39 | Havant and Bognor Regis CALLING AT: Three Bridges (18:44)Crawley (18:48) Ifield (18:51) Littlehaven (18:57) Horsham (19:01) Barnham (19:34) Chichester (19:42) Fishbourne (West Sussex) (19:46) Bosham (19:49) Nutbourne (19:53) Southbourne (19:55) Emsworth (19:58) Warblington (20:01) Havant (20:03) Train divides at Horsham CALLING AT: Christs Hospital (19:12)Billingshurst (19:18) Pulborough (19:25) Amberley (19:32) Arundel (19:37) Ford (19:43) Barnham (19:48) Bognor Regis (19:55) Southern (12 coaches) |
7 | On time |
| 18:40 | London Victoria CALLING AT: London Victoria (19:11)Gatwick Express (8 coaches) |
5 | 18:46 |
| 18:41 | Three Bridges CALLING AT: Three Bridges (18:46)Thameslink (12 coaches) |
3 | 18:48 |