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
14:01 Brighton

CALLING AT:

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

Gatwick Express (8 coaches)

6 Delayed
14:09 Horsham and Bognor Regis

CALLING AT:

Three Bridges (14:14)
Crawley (14:18)
Horsham (14:27)
Barnham (14:59)
Chichester (15:07)
Fishbourne (West Sussex) (15:11)
Bosham (15:14)
Nutbourne (15:18)
Southbourne (15:22)
Emsworth (15:25)
Warblington (15:29)
Havant (15:32)
Hilsea (15:39)
Fratton (15:43)
Portsmouth & Southsea (15:47)
Portsmouth Harbour (15:51)

Southern

6 On time
14:10 London Victoria

CALLING AT:

London Victoria (14:41)

Gatwick Express (8 coaches)

5 On time
14:13 London Victoria

CALLING AT:

East Croydon (14:28)
Clapham Junction (14:37)
London Victoria (14:45)

Southern

2 On time
14:15 Brighton

CALLING AT:

Three Bridges (14:19)
Haywards Heath (14:29)
Burgess Hill (14:35)
Brighton (14:48)

Thameslink (12 coaches)

7 On time
14:16 Cambridge

CALLING AT:

East Croydon (14:31)
London Bridge (14:45)
London Blackfriars (14:51)
City Thameslink (14:53)
Farringdon (14:56)
London St Pancras (Intl) (15:00)
Finsbury Park (15:07)
Stevenage (15:28)
Hitchin (15:34)
Letchworth Garden City (15:39)
Baldock (15:43)
Ashwell & Morden (15:48)
Royston (15:52)
Cambridge South (16:05)
Cambridge (16:09)

Thameslink (12 coaches)

4 On time
14:17 Horsham

CALLING AT:

Three Bridges (14:22)
Crawley (14:27)
Ifield (14:30)
Littlehaven (14:36)
Horsham (14:40)

Thameslink (12 coaches)

3 On time
14:19 Peterborough

CALLING AT:

Horley (14:21)
Redhill (14:29)
Merstham (14:33)
Coulsdon South (14:38)
East Croydon (14:45)
London Bridge (15:00)
London Blackfriars (15:06)
City Thameslink (15:08)
Farringdon (15:11)
London St Pancras (Intl) (15:15)
Finsbury Park (15:22)
Stevenage (15:43)
Hitchin (15:50)
Arlesey (15:56)
Biggleswade (16:01)
Sandy (16:05)
St Neots (16:12)
Huntingdon (16:20)
Peterborough (16:41)

Thameslink (12 coaches)

1 14:21
14:22 Littlehampton

CALLING AT:

Haywards Heath (14:32)
Burgess Hill (14:39)
Hassocks (14:43)
Preston Park (14:50)
Hove (14:54)
Portslade (14:57)
Shoreham-by-Sea (15:02)
Lancing (15:07)
Worthing (15:11)
West Worthing (15:14)
Durrington-on-Sea (15:16)
Goring-by-Sea (15:19)
Angmering (15:24)
Littlehampton (15:34)

Southern (8 coaches)

6 On time
14:26 Ore

CALLING AT:

Haywards Heath (14:37)
Wivelsfield (14:42)
Plumpton (14:49)
Lewes (14:56)
Polegate (15:09)
Eastbourne (15:17)
Hampden Park (15:27)
Pevensey & Westham (15:32)
Pevensey Bay (15:34)
Normans Bay (15:38)
Cooden Beach (15:42)
Collington (15:46)
Bexhill (15:49)
St Leonards Warrior Square (15:57)
Hastings (16:00)
Ore (16:04)

Southern (8 coaches)

7 14:29