{
  "openapi": "3.0.1",
  "info": {
    "title": "TfL Live Arrivals: London Tube, Bus & Rail Times, Line Status",
    "description": "Live arrival predictions for any London bus stop, Tube, DLR, Overground, Elizabeth line, tram or river pier from Transport for London's open API, plus current line status with disruption reasons. Find stops by name or coordinates; every row carries the expected arrival in UTC and minutes to go.",
    "version": "0.1",
    "x-build-id": "cuWOmdxmRcIu5zQM7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yadroo~tfl-live-arrivals/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yadroo-tfl-live-arrivals",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/yadroo~tfl-live-arrivals/runs": {
      "post": {
        "operationId": "runs-sync-yadroo-tfl-live-arrivals",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/yadroo~tfl-live-arrivals/run-sync": {
      "post": {
        "operationId": "run-sync-yadroo-tfl-live-arrivals",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to fetch",
            "enum": [
              "arrivals",
              "lineStatus",
              "stops"
            ],
            "type": "string",
            "description": "`arrivals` returns one row per predicted vehicle arrival at the stops (or lines) you name. `lineStatus` returns one row per line with its current service state, severity and disruption text. `stops` resolves stop ids: search by name or list every stop within a radius of a coordinate — run it once to find the ids you then feed into `arrivals`.",
            "default": "arrivals"
          },
          "stopIds": {
            "title": "Stop ids (NaPTAN)",
            "type": "array",
            "description": "NaPTAN stop ids, e.g. `940GZZLUOXC` (Oxford Circus Underground Station) or `490000173RC` (the bus stop outside it). Tube, DLR, Overground and Elizabeth line stations start with `940G`/`910G`, bus stops with `490`. Use the `stops` mode or README → Reference to look ids up. In `arrivals` mode you may combine stop ids, a name search and a coordinate radius; the results are merged and de-duplicated.",
            "items": {
              "type": "string"
            }
          },
          "stopQuery": {
            "title": "Stop or station name",
            "type": "string",
            "description": "Search stops by name, e.g. \"Oxford Circus\", \"Trafalgar Square\", \"Canary Wharf\". The best `Max stops from a search` matches are used. Combine with Transport modes to search only bus stops or only stations."
          },
          "latitude": {
            "title": "Latitude",
            "type": "number",
            "description": "Centre of a radius search, decimal degrees, e.g. 51.5074 (Trafalgar Square). Set together with Longitude to take every stop within Radius. Handy for a stop display: give the coordinates of your window and get the stops you can actually see."
          },
          "longitude": {
            "title": "Longitude",
            "type": "number",
            "description": "Centre of a radius search, decimal degrees, e.g. -0.1278. Only used together with Latitude."
          },
          "radiusMeters": {
            "title": "Radius (metres)",
            "minimum": 50,
            "maximum": 2000,
            "type": "integer",
            "description": "Radius of the coordinate search. 400 m is about a five-minute walk; a central London radius of 400 m typically holds 10–15 bus stops.",
            "default": 400
          },
          "maxStops": {
            "title": "Max stops from a search",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "How many resolved stops a name search or a radius search may expand to before arrivals are fetched. Each stop costs one extra request, so keep it small for scheduled runs. Stop ids you list yourself are always all used.",
            "default": 3
          },
          "stopTypes": {
            "title": "Stop types (radius search)",
            "type": "array",
            "description": "NaPTAN stop types the radius search may return. Empty = on-street stops and stations. Ignored when you pass stop ids or a name search.",
            "items": {
              "type": "string",
              "enum": [
                "NaptanPublicBusCoachTram",
                "NaptanMetroStation",
                "NaptanRailStation",
                "NaptanBusCoachStation",
                "NaptanFerryPort",
                "NaptanLiftCableCarStop",
                "TransportInterchange",
                "NaptanOnstreetBusCoachStopPair"
              ],
              "enumTitles": [
                "On-street bus, coach or tram stop",
                "Tube / DLR / Overground / Elizabeth line station",
                "National Rail station",
                "Bus or coach station",
                "River pier",
                "Cable car stop",
                "Transport interchange",
                "Pair of on-street stops"
              ]
            }
          },
          "transportModes": {
            "title": "Transport modes",
            "type": "array",
            "description": "Keep only these modes. In `arrivals` it filters the predictions, in `lineStatus` it selects which lines are reported, in `stops` it narrows a name search. Empty = every mode the stop or feed serves.",
            "items": {
              "type": "string",
              "enum": [
                "bus",
                "tube",
                "dlr",
                "overground",
                "elizabeth-line",
                "tram",
                "river-bus",
                "cable-car",
                "national-rail",
                "coach",
                "replacement-bus"
              ],
              "enumTitles": [
                "Bus",
                "Tube (London Underground)",
                "DLR",
                "London Overground (Lioness, Mildmay, Windrush, Weaver, Suffragette, Liberty)",
                "Elizabeth line",
                "Tram",
                "River bus and Woolwich Ferry",
                "London Cable Car",
                "National Rail (as served by TfL feeds)",
                "Coach",
                "Rail replacement bus"
              ]
            }
          },
          "lineIds": {
            "title": "Line ids",
            "type": "array",
            "description": "TfL line ids. Rail lines use words: `victoria`, `central`, `bakerloo`, `circle`, `district`, `hammersmith-city`, `jubilee`, `metropolitan`, `northern`, `piccadilly`, `waterloo-city`, `elizabeth`, `dlr`, `tram`, `lioness`, `mildmay`, `windrush`, `weaver`, `suffragette`, `liberty`, `london-cable-car`, `rb1`, `rb4`, `rb6`, `woolwich-ferry`. Bus routes use the route number as printed: `12`, `88`, `n91`. In `arrivals` mode without any stop, the whole line is followed (every stop it is approaching); with stops it filters those stops' predictions. In `lineStatus` mode it picks the lines to report. Full list in README → Reference.",
            "items": {
              "type": "string"
            }
          },
          "directionFilter": {
            "title": "Direction",
            "enum": [
              "any",
              "inbound",
              "outbound"
            ],
            "type": "string",
            "description": "Keep arrivals heading one way only. TfL labels a bus or train `inbound` towards central London and `outbound` away from it; a stop display usually needs one of the two.",
            "default": "any"
          },
          "destinationContains": {
            "title": "Destination contains",
            "type": "string",
            "description": "Keep only arrivals whose destination or `towards` text contains this, case-insensitive, e.g. \"Brixton\", \"Heathrow\", \"Marble Arch\". Use it when one platform serves several branches."
          },
          "withinMinutes": {
            "title": "Arriving within N minutes",
            "minimum": 1,
            "maximum": 180,
            "type": "integer",
            "description": "Drop predictions further away than this. TfL rarely predicts more than 30 minutes ahead, so 60 keeps everything; set 10 for a short platform display.",
            "default": 60
          },
          "perLineLimit": {
            "title": "Next N per line and direction",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Keep only the N soonest arrivals for each line and direction at each stop — the classic \"next two trains per platform\" board. 0 = keep every prediction.",
            "default": 0
          },
          "onlyDisrupted": {
            "title": "Only lines that are not running normally",
            "type": "boolean",
            "description": "`lineStatus` mode: drop lines in Good Service and keep delays, part closures, suspensions and planned closures. A quiet network then returns no rows, which is the correct answer for an alerting task.",
            "default": false
          },
          "onlyStatusChanges": {
            "title": "Only lines whose status changed",
            "type": "boolean",
            "description": "`lineStatus` mode: remember each line's severity in this actor's key-value store and output a line only when it differs from the previous run, with the previous description in `previousStatusDescription`. A scheduled task then emits exactly the changes. The first run outputs everything.",
            "default": false
          },
          "sortOrder": {
            "title": "Sort",
            "enum": [
              "soonest",
              "latest",
              "severity"
            ],
            "type": "string",
            "description": "`soonest`/`latest` order arrivals by expected time; `severity` orders line-status rows from the most severe disruption to Good Service. Stop rows are always ordered by distance, then name.",
            "default": "soonest"
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop after this many rows. A busy Tube station returns 30–40 predictions, a whole bus route up to 100.",
            "default": 50
          },
          "fields": {
            "title": "Output fields",
            "type": "array",
            "description": "Keep only these fields, in this order, e.g. [\"lineName\", \"destinationName\", \"minutesToArrival\"]. Empty = every field of the row type.",
            "items": {
              "type": "string"
            }
          },
          "appKey": {
            "title": "TfL app key (optional)",
            "type": "string",
            "description": "Optional. The API answers without any key and this actor uses no key by default. If you have your own TfL app key and want its higher request allowance, paste it here and it is sent as the `app_key` parameter."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}