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
18:05 Brighton

CALLING AT:

Three Bridges (18:09)
Balcombe (18:16)
Haywards Heath (18:21)
Wivelsfield (18:26)
Burgess Hill (18:28)
Hassocks (18:32)
Preston Park (18:38)
Brighton (18:43)

Thameslink (12 coaches)

7 18:12
18:12 London Victoria

CALLING AT:

London Victoria (18:42)

Gatwick Express (8 coaches)

5 On time
18:15 London Victoria

CALLING AT:

East Croydon (18:29)
Clapham Junction (18:39)
London Victoria (18:46)

Southern (12 coaches)

4 On time
18:18 Ore

CALLING AT:

Haywards Heath (18:28)
Wivelsfield (18:34)
Plumpton (18:41)
Cooksbridge (18:45)
Lewes (18:50)
Polegate (19:03)
Eastbourne (19:11)
Hampden Park (19:21)
Pevensey & Westham (19:26)
Normans Bay (19:31)
Cooden Beach (19:35)
Collington (19:38)
Bexhill (19:41)
St Leonards Warrior Square (19:49)
Hastings (19:53)
Ore (19:57)

Southern (8 coaches)

6 On time
18:22 Brighton

CALLING AT:

Three Bridges (18:26)
Haywards Heath (18:36)
Burgess Hill (18:42)
Brighton (18:53)

Thameslink (12 coaches)

7 On time
18:31 London Victoria

CALLING AT:

East Croydon (18:45)
Clapham Junction (18:56)
London Victoria (19:03)

Southern (12 coaches)

4 18:41
18:32 Brighton

CALLING AT:

Three Bridges (18:36)
Haywards Heath (18:46)
Burgess Hill (18:52)
Hassocks (18:55)
Brighton (19:05)

Southern (12 coaches)

6 On time
18:34 London Bridge

CALLING AT:

Horley (18:37)
Redhill (18:44)
Merstham (18:49)
Coulsdon South (18:54)
Purley (18:57)
East Croydon (19:03)
Norwood Junction (19:07)
London Bridge (19:23)

Thameslink

1 On time
18:35 Brighton

CALLING AT:

Three Bridges (18:39)
Balcombe (18:46)
Haywards Heath (18:51)
Wivelsfield (18:56)
Burgess Hill (18:58)
Hassocks (19:02)
Preston Park (19:08)
Brighton (19:13)

Thameslink (8 coaches)

7 On time
18:36 London Bridge

CALLING AT:

East Croydon (18:51)
London Bridge (19:08)

Thameslink (12 coaches)

4 On time