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:54 Littlehampton

CALLING AT:

Haywards Heath (19:05)
Burgess Hill (19:10)
Hassocks (19:14)
Preston Park (19:21)
Hove (19:24)
Portslade (19:28)
Shoreham-by-Sea (19:32)
Lancing (19:37)
Worthing (19:41)
West Worthing (19:43)
Durrington-on-Sea (19:46)
Goring-by-Sea (19:48)
Angmering (19:52)
Littlehampton (20:01)

Southern (8 coaches)

6 19:00
18:58 London Victoria

CALLING AT:

East Croydon (19:20)
Clapham Junction (19:32)
London Victoria (19:39)

Southern (8 coaches)

4 19:00
19:00 Bedford

CALLING AT:

Horley (19:03)
Salfords (19:07)
Earlswood (Surrey) (19:10)
Redhill (19:14)
Merstham (19:19)
Coulsdon South (19:24)
Purley (19:30)
East Croydon (19:36)
Norwood Junction (19:40)
London Bridge (19:52)
London Blackfriars (19:57)
Farringdon (20:02)
London St Pancras (Intl) (20:06)
West Hampstead Thameslink (20:14)
St Albans (20:28)
Harpenden (20:34)
Luton Airport Parkway (20:39)
Luton (20:43)
Leagrave (20:48)
Harlington (20:53)
Flitwick (20:57)
Bedford (21:10)

Thameslink (8 coaches)

1 On time
19:05 Bedford

CALLING AT:

East Croydon (19:23)
London Bridge (19:36)
London Blackfriars (19:42)
Farringdon (19:46)
London St Pancras (Intl) (19:51)
West Hampstead Thameslink (20:01)
St Albans (20:21)
Harpenden (20:28)
Luton Airport Parkway (20:34)
Luton (20:38)
Leagrave (20:42)
Harlington (20:47)
Flitwick (20:51)
Bedford (21:03)

Thameslink (12 coaches)

4 19:07
19:10 Brighton

CALLING AT:

Three Bridges (19:14)
Balcombe (19:21)
Haywards Heath (19:26)
Wivelsfield (19:30)
Burgess Hill (19:32)
Hassocks (19:36)
Preston Park (19:42)
Brighton (19:46)

Thameslink (12 coaches)

7 On time
19:10 Three Bridges

CALLING AT:

Three Bridges (19:15)

Thameslink (8 coaches)

3 19:13
19:12 London Victoria

CALLING AT:

London Victoria (19:46)

Gatwick Express (12 coaches)

5 On time
19:13 Brighton

CALLING AT:

Three Bridges (19:18)
Haywards Heath (19:29)
Burgess Hill (19:37)
Hassocks (19:41)
Brighton (19:51)

Southern (8 coaches)

6 On time
19:14 London Victoria

CALLING AT:

East Croydon (19:32)
Clapham Junction (19:43)
London Victoria (19:50)

Southern (8 coaches)

4 On time
19:19 Portsmouth Harbour and Bognor Regis

CALLING AT:

Three Bridges (19:23)
Crawley (19:27)
Horsham (19:36)
Christs Hospital (19:41)
Billingshurst (19:47)
Pulborough (19:53)
Amberley (19:59)
Arundel (20:04)
Ford (20:09)
Barnham (20:13)
Chichester (20:24)
Southbourne (20:32)
Emsworth (20:35)
Havant (20:38)
Fratton (20:47)
Portsmouth & Southsea (20:51)
Portsmouth Harbour (20:55)

Train divides at Barnham

CALLING AT:

Bognor Regis (20:26)

Southern (12 coaches)

3 On time