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
22:51 Worthing

CALLING AT:

Three Bridges (22:55)
Haywards Heath (23:05)
Burgess Hill (23:13)
Hassocks (23:16)
Preston Park (23:23)
Hove (23:27)
Portslade (23:30)
Southwick (23:33)
Shoreham-by-Sea (23:37)
Lancing (23:41)
Worthing (23:45)

Southern (8 coaches)

6 23:15
23:12 London Victoria

CALLING AT:

London Victoria (23:43)

Gatwick Express (8 coaches)

5 On time
23:15 London Victoria

CALLING AT:

Redhill (23:24)
East Croydon (23:36)
Clapham Junction (23:47)
London Victoria (23:54)

Southern (12 coaches)

4 On time
23:16 Brighton

CALLING AT:

Three Bridges (23:20)
Balcombe (23:27)
Haywards Heath (23:32)
Wivelsfield (23:36)
Burgess Hill (23:38)
Hassocks (23:42)
Preston Park (23:48)
Brighton (23:52)

Thameslink

7 23:20
23:20 Eastbourne

CALLING AT:

Three Bridges (23:24)
Haywards Heath (23:34)
Wivelsfield (23:39)
Plumpton (23:46)
Cooksbridge (23:51)
Lewes (23:56)
Berwick (Sussex) (00:07)
Polegate (00:12)
Hampden Park (00:17)
Eastbourne (00:22)

Southern (8 coaches)

6 On time
23:23 Bedford

CALLING AT:

East Croydon (23:39)
London Blackfriars (00:06)
Farringdon (00:10)
London St Pancras (Intl) (00:15)
Kentish Town (00:20)
West Hampstead Thameslink (00:24)
Cricklewood (00:27)
Brent Cross West (00:30)
Hendon (00:32)
Mill Hill Broadway (00:35)
Elstree & Borehamwood (00:39)
Radlett (00:43)
St Albans (00:49)
Harpenden (00:56)
Luton Airport Parkway (01:02)
Luton (01:06)
Leagrave (01:11)
Harlington (01:15)
Flitwick (01:19)
Bedford (01:33)

Thameslink (12 coaches)

4 On time
23:28 Brighton   Cancelled
23:45 London Victoria

CALLING AT:

Redhill (23:54)
East Croydon (00:09)
Clapham Junction (00:23)
London Victoria (00:31)

Southern (8 coaches)

2 On time
23:48 Brighton

CALLING AT:

Three Bridges (23:52)
Balcombe (23:59)
Haywards Heath (00:04)
Wivelsfield (00:08)
Burgess Hill (00:10)
Hassocks (00:14)
Preston Park (00:20)
Brighton (00:24)

Thameslink (8 coaches)

7 On time
23:50 Three Bridges

CALLING AT:

Three Bridges (23:55)

Thameslink (12 coaches)

3 On time