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

  • A reduced hourly service is operating between Gatwick Airport and London Victoria and no trains between Horsham and Dorking (Main). More details and the full impact to your journey can be found in Status and Disruptions.
Time Destination Platform Expected
21:14 London Victoria

CALLING AT:

Dorking (21:47)
Clapham Junction (22:20)
London Victoria (22:27)

Southern (12 coaches)

3 22:20
22:08 Brighton

CALLING AT:

Three Bridges (22:12)
Balcombe (22:21)
Haywards Heath (22:26)
Wivelsfield (22:31)
Burgess Hill (22:33)
Hassocks (22:37)
Preston Park (22:43)
Brighton (22:48)

Thameslink (12 coaches)

2 On time
22:12 London Victoria

CALLING AT:

Three Bridges (22:17)
Horsham (22:28)
Dorking (22:47)
Clapham Junction (23:20)
London Victoria (23:27)

Southern (12 coaches)

3 Delayed
22:30 Portsmouth & Southsea and Bognor Regis

CALLING AT:

Crawley (22:39)
Ifield (22:43)
Littlehaven (22:49)
Horsham (22:53)
Barnham (23:29)
Chichester (23:38)
Fishbourne (West Sussex) (23:42)
Bosham (23:45)
Nutbourne (23:49)
Southbourne (23:51)
Emsworth (23:54)
Warblington (23:57)
Havant (23:59)
Fratton (00:09)
Portsmouth & Southsea (00:13)

Train divides at Horsham

CALLING AT:

Christs Hospital (23:09)
Billingshurst (23:15)
Pulborough (23:22)
Amberley (23:28)
Arundel (23:32)
Ford (23:38)
Barnham (23:43)
Bognor Regis (23:52)

Southern (12 coaches)

1 22:33