{
 "openapi": "3.1.0",
 "info": {
  "title": "London line status (TfL): data.promptugal.news",
  "version": "v0.1.151",
  "description": "Each London Tube, Overground, Elizabeth line, DLR and tram line and its status as Transport for London publishes it (good service, delays, closures), with TfL's reason.\n\nPublisher: Transport for London (TfL), Unified API. Reuse terms: TfL's Transport Data Service terms (based on the Open Government Licence v2.0 with TfL amendments): free to copy, publish, distribute, transmit and adapt the information and to exploit it commercially and non-commercially; credit \"Powered by TfL Open Data\"; at most 500 calls a minute per feed; no implied endorsement. Not a warning service: follow IPMA and ANEPC.\n\nCode: Apache-2.0. Text: CC BY 4.0. The data keeps the terms of its own source (see each source card); nothing here relaxes them.",
  "license": {
   "name": "Apache-2.0 for code; each source keeps its own data terms",
   "identifier": "Apache-2.0"
  },
  "contact": {
   "name": "PrompTugal.news data",
   "url": "https://github.com/PrompTugal/PrompTugal__News__Data"
  }
 },
 "servers": [
  {
   "url": "https://data.promptugal.news",
   "description": "Production"
  }
 ],
 "externalDocs": {
  "description": "How to use the API",
  "url": "https://data.promptugal.news/api/"
 },
 "paths": {
  "/api/v1/tfl-status/latest.json": {
   "get": {
    "operationId": "get_tfl_status_latest",
    "tags": [
     "tfl-status"
    ],
    "summary": "London line status (TfL): the latest read",
    "description": "Each London Tube, Overground, Elizabeth line, DLR and tram line and its status as Transport for London published it at the read (severity 10 is good service), with TfL's reason. Collected once a day as the archive; the page shows the live status read in your browser from TfL.",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "source": {
           "type": "string"
          },
          "title": {
           "type": "string"
          },
          "read_at": {
           "type": "string"
          },
          "provenance": {
           "type": "object",
           "properties": {
            "source": {
             "type": "string"
            },
            "page": {
             "type": "string"
            },
            "read_at": {
             "type": "string"
            },
            "by": {
             "type": "string"
            },
            "terms": {
             "type": "string"
            },
            "api": {
             "type": "string"
            }
           },
           "required": [
            "source",
            "page",
            "read_at",
            "by",
            "terms",
            "api"
           ]
          },
          "country": {
           "type": "string"
          },
          "place": {
           "type": "string"
          },
          "about": {
           "type": "string"
          },
          "live": {
           "type": "object",
           "properties": {
            "url": {
             "type": "string"
            },
            "how": {
             "type": "string"
            }
           },
           "required": [
            "url",
            "how"
           ]
          },
          "attribution": {
           "type": "string"
          },
          "counts": {
           "type": "object",
           "properties": {
            "lines": {
             "type": "integer"
            },
            "good_service": {
             "type": "integer"
            },
            "not_good": {
             "type": "integer"
            },
            "fields_dropped_wording": {
             "type": "integer"
            }
           },
           "required": [
            "lines",
            "good_service",
            "not_good",
            "fields_dropped_wording"
           ]
          },
          "lines": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "mode": {
              "type": "string"
             },
             "statuses": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "severity": {
                 "type": "integer"
                },
                "status": {
                 "type": "string"
                },
                "reason": {
                 "type": [
                  "string",
                  "null"
                 ]
                },
                "from": {
                 "type": [
                  "string",
                  "null"
                 ]
                },
                "to": {
                 "type": [
                  "string",
                  "null"
                 ]
                }
               },
               "required": [
                "severity",
                "status",
                "reason",
                "from",
                "to"
               ]
              }
             }
            },
            "required": [
             "id",
             "name",
             "mode",
             "statuses"
            ]
           }
          }
         },
         "required": [
          "source",
          "title",
          "read_at",
          "provenance",
          "country",
          "place",
          "about",
          "live",
          "attribution",
          "counts",
          "lines"
         ],
         "x-inferred": true
        },
        "examples": {
         "example": {
          "summary": "A real file, cut to a readable size",
          "value": {
           "source": "tfl-status",
           "title": "London line status (TfL)",
           "read_at": "2026-11-21T09:20:37Z",
           "provenance": {
            "source": "https://api.tfl.gov.uk/",
            "page": "https://api-portal.tfl.gov.uk/",
            "read_at": "2026-11-21T09:20:37Z",
            "by": "sources/tfl-status/collect.mjs (code, no model; run by data.b@PrompTugal.dinis)",
            "terms": "TfL's Transport Data Service terms (based on the Open Government Licence v2.0 with TfL amendments): free to copy, publish, distribute, transmit and adapt the information and to exploit it commercially and non-commercially; credit \"Powered by TfL Open Data\"; at most 500 calls a minute per feed; no im...",
            "api": "https://api.tfl.gov.uk/Line/Mode/tube,overground,elizabeth-line,dlr,tram/Status"
           },
           "country": "GB",
           "place": "london",
           "about": "Each London Tube, Overground, Elizabeth line, DLR and tram line and its status as Transport for London published it at the read (severity 10 is good service), with TfL's reason. Collected once a day as the archive; the page shows the live status read in your browser from TfL.",
           "live": {
            "url": "https://api.tfl.gov.uk/Line/Mode/tube,overground,elizabeth-line,dlr,tram/Status",
            "how": "the page asks TfL for this address when it opens; TfL allows browser reads (CORS *)"
           },
           "attribution": "Powered by TfL Open Data",
           "counts": {
            "lines": 20,
            "good_service": 12,
            "not_good": 8,
            "fields_dropped_wording": 0
           },
           "lines": [
            {
             "id": "dlr",
             "name": "DLR",
             "mode": "dlr",
             "statuses": [
              {
               "severity": 5,
               "status": "Part Closure",
               "reason": "DOCKLANDS LIGHT RAILWAY: Saturday 21 and Sunday 22 November, no service between Canning Town and Stratford International. Please use JUBILEE LINE and local London Buses services.",
               "from": "2026-11-21T04:30:00Z",
               "to": "2026-11-23T01:29:00Z"
              }
             ]
            },
            {
             "id": "elizabeth",
             "name": "Elizabeth line",
             "mode": "elizabeth-line",
             "statuses": [
              {
               "severity": 10,
               "status": "Good Service",
               "reason": null,
               "from": null,
               "to": null
              }
             ]
            },
            {
             "id": "liberty",
             "name": "Liberty",
             "mode": "overground",
             "statuses": [
              {
               "severity": 10,
               "status": "Good Service",
               "reason": null,
               "from": null,
               "to": null
              }
             ]
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/api/v1/tfl-status/reads.json": {
   "get": {
    "operationId": "get_tfl_status_reads",
    "tags": [
     "tfl-status"
    ],
    "summary": "London line status (TfL): every read, newest first",
    "description": "Every run of sources/tfl-status/collect.mjs, newest first: each request's address, HTTP status, size, the first 16 hex of its sha256, and whether the bytes changed since the run before. The bytes and the full sha256 go to the source's vault (see card.json: latest/reads-full.json), never to git.",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "about": {
           "type": "string"
          },
          "source": {
           "type": "string"
          },
          "runs": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "at": {
              "type": "string"
             },
             "finished": {
              "type": "string"
             },
             "ok": {
              "type": "integer"
             },
             "failed": {
              "type": "integer"
             },
             "reads": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "name": {
                 "type": "string"
                },
                "url": {
                 "type": "string"
                },
                "at": {
                 "type": "string"
                },
                "status": {
                 "type": "integer"
                },
                "bytes": {
                 "type": "integer"
                },
                "sha256_prefix": {
                 "type": "string"
                },
                "changed": {
                 "type": "string"
                }
               },
               "required": [
                "name",
                "url",
                "at",
                "status",
                "bytes",
                "sha256_prefix",
                "changed"
               ]
              }
             }
            },
            "required": [
             "at",
             "finished",
             "ok",
             "failed",
             "reads"
            ]
           }
          }
         },
         "required": [
          "about",
          "source",
          "runs"
         ],
         "x-inferred": true
        },
        "examples": {
         "example": {
          "summary": "A real file, cut to a readable size",
          "value": {
           "about": "Every run of sources/tfl-status/collect.mjs, newest first: each request's address, HTTP status, size, the first 16 hex of its sha256, and whether the bytes changed since the run before. The bytes and the full sha256 go to the source's vault (see card.json: latest/reads-full.json), never to git.",
           "source": "tfl-status",
           "runs": [
            {
             "at": "2026-11-21T09:20:37Z",
             "finished": "2026-11-21T09:20:40Z",
             "ok": 1,
             "failed": 0,
             "reads": [
              {
               "name": "status",
               "url": "https://api.tfl.gov.uk/Line/Mode/tube,overground,elizabeth-line,dlr,tram/Status",
               "at": "2026-11-21T09:20:39Z",
               "status": 200,
               "bytes": 30212,
               "sha256_prefix": "b2fec6e8dc13b26a",
               "changed": "first read"
              }
             ]
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/api/v1/tfl-status/card.json": {
   "get": {
    "operationId": "get_tfl_status_card",
    "tags": [
     "tfl-status"
    ],
    "summary": "London line status (TfL): the card",
    "description": "Who publishes the source, its reuse terms, the schedule, who owns it, what runs by code, by agents and by people, and the vault.",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string"
          },
          "title": {
           "type": "string"
          },
          "what": {
           "type": "string"
          },
          "publisher": {
           "type": "string"
          },
          "owner": {
           "type": "string"
          },
          "region": {
           "type": "string"
          },
          "collector": {
           "type": "string"
          },
          "source_home": {
           "type": "string"
          },
          "reader_page": {
           "type": "string"
          },
          "schedule": {
           "type": "object",
           "properties": {
            "cadence": {
             "type": "string"
            },
            "how": {
             "type": "string"
            }
           },
           "required": [
            "cadence",
            "how"
           ]
          },
          "terms": {
           "type": "object",
           "properties": {
            "summary": {
             "type": "string"
            },
            "page": {
             "type": "string"
            },
            "read_at": {
             "type": "string"
            },
            "quote": {
             "type": "string"
            },
            "quote_lang": {
             "type": "string"
            },
            "republish": {
             "type": "string"
            },
            "commercial_use": {
             "type": "string"
            },
            "read_by": {
             "type": "string"
            }
           },
           "required": [
            "summary",
            "page",
            "read_at",
            "quote",
            "quote_lang",
            "republish",
            "commercial_use",
            "read_by"
           ]
          },
          "api": {
           "type": "object",
           "properties": {
            "latest": {
             "type": "string"
            },
            "reads": {
             "type": "string"
            },
            "card": {
             "type": "string"
            },
            "openapi": {
             "type": "string"
            },
            "page": {
             "type": "string"
            }
           },
           "required": [
            "latest",
            "reads",
            "card",
            "openapi",
            "page"
           ]
          },
          "vault": {
           "type": "null"
          },
          "split": {
           "type": "object",
           "properties": {
            "code": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "agents": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "people": {
             "type": "array",
             "items": {
              "type": "string"
             }
            }
           },
           "required": [
            "code",
            "agents",
            "people"
           ]
          },
          "cost": {
           "type": "object",
           "properties": {
            "per_run_tokens": {
             "type": "integer"
            },
            "per_run_model_cost_usd": {
             "type": "integer"
            },
            "runner": {
             "type": "string"
            },
            "build_tokens": {
             "type": "string"
            },
            "note": {
             "type": "string"
            }
           },
           "required": [
            "per_run_tokens",
            "per_run_model_cost_usd",
            "runner",
            "build_tokens",
            "note"
           ]
          },
          "since": {
           "type": "string"
          },
          "places": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "country": {
           "type": "string"
          }
         },
         "required": [
          "id",
          "title",
          "what",
          "publisher",
          "owner",
          "region",
          "collector",
          "source_home",
          "reader_page",
          "schedule",
          "terms",
          "api",
          "vault",
          "split",
          "cost",
          "since",
          "places",
          "country"
         ],
         "x-inferred": true
        },
        "examples": {
         "example": {
          "summary": "A real file, cut to a readable size",
          "value": {
           "id": "tfl-status",
           "title": "London line status (TfL)",
           "what": "Each London Tube, Overground, Elizabeth line, DLR and tram line and its status as Transport for London publishes it (good service, delays, closures), with TfL's reason.",
           "publisher": "Transport for London (TfL), Unified API",
           "owner": "data.b@PrompTugal.dinis",
           "region": "london",
           "collector": "sources/tfl-status/collect.mjs",
           "source_home": "https://api.tfl.gov.uk/",
           "reader_page": "https://api-portal.tfl.gov.uk/",
           "schedule": {
            "cadence": "daily",
            "how": "once a day at data.b@'s morning wake (when the last read is more than 23.5 hours old): one GET of api.tfl.gov.uk/Line/Mode/.../Status, no key; the page reads it live in the browser"
           },
           "terms": {
            "summary": "TfL's Transport Data Service terms (based on the Open Government Licence v2.0 with TfL amendments): free to copy, publish, distribute, transmit and adapt the information and to exploit it commercially and non-commercially; credit \"Powered by TfL Open Data\"; at most 500 calls a minute per feed; no im...",
            "page": "https://tfl.gov.uk/corporate/terms-and-conditions/transport-data-service",
            "read_at": "2026-11-18",
            "quote": "You are free to: Copy, publish, distribute and transmit the Information; Adapt the Information and Exploit the Information commercially and non-commercially",
            "quote_lang": "en",
            "republish": "yes, with the credit \"Powered by TfL Open Data\"; commercial use allowed",
            "commercial_use": "allowed",
            "read_by": "Dinis Cruz (pasted into data.b@'s session; board/team/data/briefs/2026-11-18-dinis-commercial-line-ine-tfl.md)"
           },
           "api": {
            "latest": "https://data.promptugal.news/api/v1/tfl-status/latest.json",
            "reads": "https://data.promptugal.news/api/v1/tfl-status/reads.json",
            "card": "https://data.promptugal.news/api/v1/tfl-status/card.json",
            "openapi": "https://data.promptugal.news/api/v1/tfl-status/openapi.json",
            "page": "https://data.promptugal.news/sources/tfl-status/"
           },
           "vault": null,
           "split": {
            "code": [
             "the collector reads the source once a day and keeps the archive; the page reads the live figures in the visitor's browser"
            ],
            "agents": [
             "data.b@PrompTugal.dinis wrote the collector and card on 21 November 2026, for Dinis's London demos (tier 1 of board/team/data/london-feeds.md)"
            ],
            "people": [
             "Dinis Cruz chose tier 1 on 21 November 2026, about 09:16 UTC; no person has checked the values (not reviewed)"
            ]
           },
           "cost": {
            "per_run_tokens": 0,
            "per_run_model_cost_usd": 0,
            "runner": "data.b@'s session",
            "build_tokens": "not measured",
            "note": "Code only: no model is called when the data is collected."
           },
           "since": "2026-11-21",
           "places": [
            "london"
           ],
           "country": "GB"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/api/v1/tfl-status/openapi.json": {
   "get": {
    "operationId": "get_tfl_status_openapi",
    "tags": [
     "tfl-status"
    ],
    "summary": "London line status (TfL): this document",
    "responses": {
     "200": {
      "description": "The file",
      "content": {
       "application/json": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 },
 "tags": [
  {
   "name": "tfl-status",
   "description": "Each London Tube, Overground, Elizabeth line, DLR and tram line and its status as Transport for London publishes it (good service, delays, closures), with TfL's reason."
  }
 ],
 "x-source": {
  "id": "tfl-status",
  "card": "https://data.promptugal.news/api/v1/tfl-status/card.json",
  "page": "https://data.promptugal.news/sources/tfl-status/"
 }
}
