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
13:26 London Victoria

CALLING AT:

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

Southern (8 coaches)

4 13:41
13:26 Ore

CALLING AT:

Haywards Heath (13:37)
Wivelsfield (13:42)
Plumpton (13:49)
Lewes (13:56)
Polegate (14:09)
Eastbourne (14:17)
Hampden Park (14:27)
Pevensey & Westham (14:32)
Normans Bay (14:36)
Cooden Beach (14:40)
Collington (14:44)
Bexhill (14:47)
St Leonards Warrior Square (14:55)
Hastings (14:58)
Ore (15:02)

Southern (8 coaches)

7 On time
13:29 Reading

CALLING AT:

Redhill (13:37)
Reigate (13:44)
Betchworth (13:49)
Dorking Deepdene (13:53)
Dorking West (13:57)
Shalford (14:10)
Guildford (14:15)
North Camp (14:31)
Blackwater (14:37)
Wokingham (14:46)
Reading (14:57)

Great Western Railway (3 coaches)

2 On time
13:31 Brighton

CALLING AT:

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

Gatwick Express (8 coaches)

6 On time
13:32 Bedford

CALLING AT:

Horley (13:35)
Salfords (13:39)
Earlswood (Surrey) (13:42)
Redhill (13:46)
Purley (13:56)
South Croydon (14:00)
East Croydon (14:03)
Norwood Junction (14:07)
London Bridge (14:20)
London Blackfriars (14:26)
City Thameslink (14:28)
Farringdon (14:31)
London St Pancras (Intl) (14:35)
St Albans (14:54)
Harpenden (15:01)
Luton Airport Parkway (15:06)
Luton (15:10)
Leagrave (15:15)
Harlington (15:20)
Flitwick (15:24)
Bedford (15:39)

Thameslink (8 coaches)

1 On time
13:32 London Victoria

CALLING AT:

East Croydon (13:48)
Clapham Junction (13:58)
London Victoria (14:06)

Southern (8 coaches)

5 On time
13:35 Brighton

CALLING AT:

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

Thameslink (12 coaches)

7 On time
13:35 Three Bridges

CALLING AT:

Three Bridges (13:40)

Thameslink (12 coaches)

3 13:45
13:36 Bedford

CALLING AT:

East Croydon (13:51)
London Bridge (14:05)
London Blackfriars (14:11)
City Thameslink (14:13)
Farringdon (14:16)
London St Pancras (Intl) (14:20)
West Hampstead Thameslink (14:29)
St Albans (14:41)
Harpenden (14:47)
Luton Airport Parkway (14:53)
Luton (14:57)
Leagrave (15:01)
Harlington (15:06)
Flitwick (15:10)
Bedford (15:24)

Thameslink (12 coaches)

4 13:41
13:39 Portsmouth Harbour and Bognor Regis

CALLING AT:

Three Bridges (13:44)
Crawley (13:48)
Horsham (13:57)
Barnham (14:29)
Chichester (14:37)
Fishbourne (West Sussex) (14:41)
Bosham (14:44)
Nutbourne (14:48)
Southbourne (14:51)
Emsworth (14:55)
Warblington (14:58)
Havant (15:00)
Hilsea (15:08)
Fratton (15:12)
Portsmouth & Southsea (15:16)
Portsmouth Harbour (15:20)

Train divides at Horsham

CALLING AT:

Christs Hospital (14:10)
Billingshurst (14:16)
Pulborough (14:23)
Amberley (14:29)
Arundel (14:33)
Ford (14:40)
Barnham (14:44)
Bognor Regis (14:51)

Southern (8 coaches)

6 On time