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

↓ Output (cached 60s)


<!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:"&nbsp;"),$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
16:15 Brighton

CALLING AT:

Three Bridges (16:19)
Haywards Heath (16:29)
Burgess Hill (16:35)
Brighton (16:48)

Thameslink (12 coaches)

7 16:18
16:16 Cambridge

CALLING AT:

East Croydon (16:31)
London Bridge (16:45)
London Blackfriars (16:51)
City Thameslink (16:53)
Farringdon (16:56)
London St Pancras (Intl) (17:00)
Finsbury Park (17:07)
Stevenage (17:28)
Hitchin (17:34)
Letchworth Garden City (17:39)
Baldock (17:43)
Ashwell & Morden (17:48)
Royston (17:52)
Cambridge South (18:05)
Cambridge (18:09)

Thameslink (12 coaches)

4 16:18
16:19 Peterborough

CALLING AT:

Horley (16:21)
Redhill (16:29)
Merstham (16:33)
Coulsdon South (16:38)
East Croydon (16:45)
London Bridge (17:00)
London Blackfriars (17:06)
City Thameslink (17:08)
Farringdon (17:11)
London St Pancras (Intl) (17:15)
Finsbury Park (17:22)
Stevenage (17:43)
Hitchin (17:49)
Arlesey (17:55)
Biggleswade (18:00)
Sandy (18:05)
St Neots (18:12)
Huntingdon (18:19)
Peterborough (18:36)

Thameslink (12 coaches)

1 16:21
16:22 Littlehampton

CALLING AT:

Haywards Heath (16:33)
Burgess Hill (16:39)
Hassocks (16:43)
Preston Park (16:50)
Hove (16:54)
Portslade (16:57)
Shoreham-by-Sea (17:02)
Lancing (17:07)
Worthing (17:11)
West Worthing (17:14)
Durrington-on-Sea (17:16)
Goring-by-Sea (17:19)
Angmering (17:24)
Littlehampton (17:34)

Southern (8 coaches)

6 On time
16:26 London Victoria

CALLING AT:

East Croydon (16:41)
Clapham Junction (16:51)
London Victoria (16:58)

Southern (8 coaches)

4 On time
16:26 Ore

CALLING AT:

Haywards Heath (16:37)
Wivelsfield (16:42)
Plumpton (16:49)
Lewes (16:56)
Polegate (17:09)
Eastbourne (17:19)
Hampden Park (17:29)
Pevensey & Westham (17:34)
Pevensey Bay (17:36)
Normans Bay (17:40)
Cooden Beach (17:44)
Collington (17:48)
Bexhill (17:51)
St Leonards Warrior Square (17:58)
Hastings (18:01)
Ore (18:05)

Southern (8 coaches)

7 On time
16:29 Reading

CALLING AT:

Redhill (16:37)
Reigate (16:44)
Betchworth (16:49)
Dorking Deepdene (16:53)
Dorking West (16:56)
Shalford (17:09)
Guildford (17:14)
Ash (17:24)
North Camp (17:29)
Farnborough North (17:33)
Blackwater (17:38)
Sandhurst (17:42)
Crowthorne (17:46)
Wokingham (17:52)
Reading (18:02)

Great Western Railway (3 coaches)

2 On time
16:31 Brighton

CALLING AT:

Haywards Heath (16:42)
Brighton (16:57)

Gatwick Express (8 coaches)

6 On time
16:32 Bedford

CALLING AT:

Horley (16:35)
Salfords (16:39)
Earlswood (Surrey) (16:42)
Redhill (16:46)
Purley (16:56)
South Croydon (17:00)
East Croydon (17:03)
Norwood Junction (17:07)
London Bridge (17:20)
London Blackfriars (17:26)
City Thameslink (17:28)
Farringdon (17:31)
London St Pancras (Intl) (17:35)
St Albans (17:54)
Harpenden (18:00)
Luton (18:07)
Leagrave (18:11)
Bedford (18:27)

Thameslink (8 coaches)

1 On time
16:32 London Victoria

CALLING AT:

East Croydon (16:48)
Clapham Junction (16:58)
London Victoria (17:08)

Southern (12 coaches)

5 On time