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:56 Eastbourne

CALLING AT:

Haywards Heath (17:07)
Wivelsfield (17:12)
Cooksbridge (17:21)
Lewes (17:26)
Polegate (17:39)
Hampden Park (17:47)
Eastbourne (17:51)

Southern (8 coaches)

7 16:59
16:59 Reading

CALLING AT:

Redhill (17:07)
Reigate (17:14)
Dorking Deepdene (17:22)
Guildford (17:41)
Ash (17:51)
North Camp (17:56)
Farnborough North (18:00)
Blackwater (18:04)
Sandhurst (18:08)
Crowthorne (18:12)
Wokingham (18:18)
Reading (18:27)

Great Western Railway

2 On time
17:01 Brighton

CALLING AT:

Haywards Heath (17:11)
Brighton (17:27)

Gatwick Express (8 coaches)

6 On time
17:02 Bedford

CALLING AT:

Horley (17:05)
Salfords (17:09)
Earlswood (Surrey) (17:12)
Redhill (17:16)
Purley (17:26)
South Croydon (17:30)
East Croydon (17:33)
Norwood Junction (17:37)
London Bridge (17:50)
London Blackfriars (17:56)
City Thameslink (17:58)
Farringdon (18:01)
London St Pancras (Intl) (18:05)
St Albans (18:24)
Harpenden (18:31)
Luton Airport Parkway (18:36)
Luton (18:40)
Leagrave (18:45)
Harlington (18:50)
Flitwick (18:54)
Bedford (19:09)

Thameslink (12 coaches)

1 On time
17:02 London Victoria

CALLING AT:

East Croydon (17:18)
Clapham Junction (17:28)
London Victoria (17:36)

Southern (8 coaches)

5 On time
17:05 Brighton

CALLING AT:

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

Thameslink (12 coaches)

7 On time
17:06 Bedford

CALLING AT:

East Croydon (17:21)
London Bridge (17:35)
London Blackfriars (17:41)
City Thameslink (17:43)
Farringdon (17:46)
London St Pancras (Intl) (17:50)
West Hampstead Thameslink (17:59)
St Albans (18:11)
Harpenden (18:17)
Luton Airport Parkway (18:23)
Luton (18:27)
Leagrave (18:31)
Harlington (18:36)
Flitwick (18:40)
Bedford (18:54)

Thameslink (12 coaches)

4 On time
17:06 Three Bridges

CALLING AT:

Three Bridges (17:10)

Thameslink (8 coaches)

3 17:12
17:09 Portsmouth Harbour and Bognor Regis

CALLING AT:

Three Bridges (17:14)
Crawley (17:18)
Horsham (17:27)
Barnham (17:59)
Chichester (18:07)
Southbourne (18:15)
Emsworth (18:18)
Havant (18:24)
Hilsea (18:31)
Fratton (18:35)
Portsmouth & Southsea (18:38)
Portsmouth Harbour (18:48)

Train divides at Horsham

CALLING AT:

Christs Hospital (17:39)
Billingshurst (17:45)
Pulborough (17:52)
Amberley (17:58)
Arundel (18:02)
Ford (18:08)
Barnham (18:13)
Bognor Regis (18:21)

Southern (8 coaches)

6 On time
17:10 London Victoria

CALLING AT:

London Victoria (17:42)

Gatwick Express (12 coaches)

5 On time