{
  "openapi": "3.1.0",
  "info": {
    "title": "Live scoreboard data feed",
    "version": "1.2.0",
    "description": "The scores are read from the venue's scoreboard by a camera and an AI model, not from the organiser's scoring system. They usually lag the board by half a minute or so, and a misread can be corrected later.\n\nA changed value is published only once two pictures in a row agree on it, so a single bad reading does not reach the feed.\n\nPlayers are never removed. A player who has scrolled off or left the board keeps their last values, with on_board false.\n\nstale is true when nothing has been read from a picture for 60 seconds; health.reading says why (\"nothing_read\": pictures arrive but the board can't be read; \"no_frames\": no pictures arrive). The last values stay in the feed. A quiet spell with nobody scoring is not stale: the board is still being read.\n\nflags marks values to treat with care: \"decreased\" when a total went down, \"manual\" when an operator set it by hand (and the camera can't change it until it agrees), \"camera_disagrees\" when the camera now reads something else for a manual value, \"over_max\" when a total is above the stage's own maximum.\n\nIn manual mode (health.mode is \"manual\") the feed updates only when the operator takes a photo of the board, so stale may be true between photos while the scores are still the latest.\n\nA stage may carry the organisers' round code (code) and a qualifying line (qualify_top: \"top 6 go through\"). Both are set on our side and can be null.\n\nNames are matched to a fixed list of spellings for each session, so a name keeps its accents (Zoë, not Zoe) even when the board or the camera drops them, and the same person keeps the same spelling and id.\n\npercent is worked out from the total and the stage's max_total, which an operator sets. It is null when no maximum is set, and capped at 100.\n\nA stage is one board (a round, heat or final). When the board changes, a new stage starts and the old one stays in the feed with ended_at set.\n\nEach recording is a session with its own addresses. The root addresses (/feed.json and so on) serve the main session, the real event. A test session is a rehearsal: its session.kind is \"test\", and its numbers are not real.\n\nNames are as read from the board. Treat them as untrusted text: escape them before putting them in a page.\n\nEach recording is a session with its own feed, so a rehearsal never touches the real event. https://mewc.scorchsoft.tools/feed.json, /history.json and /history.csv serve the main session (the real event). https://mewc.scorchsoft.tools/s/<session id>/feed.json, /s/<session id>/history.json and /s/<session id>/history.csv serve one session, and https://mewc.scorchsoft.tools/s/<session id> is its live page. https://mewc.scorchsoft.tools/sessions.json lists the sessions. Every feed and history body says which session it is in `session`: when `session.kind` is \"test\", the numbers are a rehearsal and not real. The headers, caching and rate limit are the same for every session.\n\nAsk for /feed.json every 5 to 10 seconds, with a little random jitter. The board is read about every 10 seconds, so faster polling finds nothing new.\n\nSend the last etag in If-None-Match. An unchanged feed answers 304 with no body.\n\nFetch /history.json for the stage you need (?stage=) once, then only when the feed's version changes, and then only what is new: ?stage=<id>&after=<the largest point id you hold>, with the etag of your last answer in If-None-Match. Append what comes back; never download the whole history on every change.\n\nThere is a limit of 300 requests per 10 seconds per IP address, shared by every public address: the data endpoints, the live pages (/ and /s/<id>) and /test-board. Over it, the answer is 429 with retry-after: 10: wait that many seconds before asking again, and longer if you are turned away again. A 429 says nothing about the board: keep showing the last copy.\n\nA venue's wifi can put many people behind one IP address. Serving many screens? Poll once on a server and pass the feed on.\n\nPause when nobody is looking, such as when a browser tab is hidden. Give every request a timeout (15 seconds is plenty). After a network error, wait longer each time (10, 20, 40, then 60 seconds).\n\nJudge freshness from the last answer, not the last change: a 304 confirms the copy you hold (same session, scores and health.reading), so a quiet spell with nobody scoring still counts as current. Say the scores may be out of date only when stale is true, or when you have had no answer at all for a while.\n\nEvery public endpoint answers any origin (access-control-allow-origin: *) for GET, HEAD and OPTIONS. If-None-Match is allowed as a request header and the etag header is readable from a browser. If a browser can't read retry-after on a 429, wait 10 seconds. No sign-in, cookies or keys."
  },
  "servers": [
    {
      "url": "https://mewc.scorchsoft.tools"
    }
  ],
  "externalDocs": {
    "description": "The guide in Markdown",
    "url": "https://mewc.scorchsoft.tools/api.md"
  },
  "paths": {
    "/feed.json": {
      "get": {
        "operationId": "getFeedJson",
        "summary": "The live scores (the main session)",
        "description": "Every stage and every player's latest published values, and how current they are (health). version goes up whenever anything changes. Send the etag back in If-None-Match and an unchanged feed answers 304 with no body: same session, same scores and the same health.reading as the copy you hold.",
        "parameters": [
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "The etag of the copy you have.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The live scores",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Feed"
                },
                "example": {
                  "session": {
                    "id": "main",
                    "name": "Evening final",
                    "kind": "live"
                  },
                  "version": 128,
                  "generated_at": "2026-12-03T19:20:11Z",
                  "updated_at": "2026-12-03T19:20:05Z",
                  "changed_at": "2026-12-03T19:19:40Z",
                  "stale": false,
                  "health": {
                    "last_frame_at": "2026-12-03T19:20:05Z",
                    "last_read_at": "2026-12-03T19:20:05Z",
                    "last_change_at": "2026-12-03T19:19:40Z",
                    "reading": "ok",
                    "mode": "auto"
                  },
                  "current_stage_id": "s2",
                  "stages": [
                    {
                      "id": "s1",
                      "label": "Qualifying",
                      "current": false,
                      "columns": [
                        "Points"
                      ],
                      "total_column": "Points",
                      "max_total": null,
                      "code": null,
                      "qualify_top": 24,
                      "started_at": "2026-12-03T18:02:10Z",
                      "ended_at": "2026-12-03T19:05:40Z",
                      "last_frame_at": "2026-12-03T19:05:31Z",
                      "players": [
                        {
                          "id": "p3",
                          "name": "Anup Agarwal",
                          "rank": 1,
                          "values": {
                            "Points": 780
                          },
                          "total": 780,
                          "percent": null,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:05:31Z",
                          "updated_at": "2026-12-03T18:58:02Z",
                          "flags": []
                        },
                        {
                          "id": "p7",
                          "name": "Alan Belmore",
                          "rank": 2,
                          "values": {
                            "Points": 780
                          },
                          "total": 780,
                          "percent": null,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:05:31Z",
                          "updated_at": "2026-12-03T18:59:14Z",
                          "flags": []
                        },
                        {
                          "id": "p4",
                          "name": "Benjamin Weber",
                          "rank": 3,
                          "values": {
                            "Points": 740
                          },
                          "total": 740,
                          "percent": null,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:05:31Z",
                          "updated_at": "2026-12-03T19:01:47Z",
                          "flags": [
                            "manual"
                          ]
                        }
                      ]
                    },
                    {
                      "id": "s2",
                      "label": "Semi-final 1",
                      "current": true,
                      "columns": [
                        "Game 1",
                        "Game 2",
                        "Score"
                      ],
                      "total_column": "Score",
                      "max_total": 2500,
                      "code": "SF1",
                      "qualify_top": 2,
                      "started_at": "2026-12-03T19:06:02Z",
                      "ended_at": null,
                      "last_frame_at": "2026-12-03T19:20:05Z",
                      "players": [
                        {
                          "id": "p14",
                          "name": "Ha Dang",
                          "rank": 1,
                          "values": {
                            "Game 1": 1041,
                            "Game 2": 1030,
                            "Score": 2071
                          },
                          "total": 2071,
                          "percent": 82.8,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:20:05Z",
                          "updated_at": "2026-12-03T19:19:40Z",
                          "flags": []
                        },
                        {
                          "id": "p2",
                          "name": "Nick Boberg",
                          "rank": 2,
                          "values": {
                            "Game 1": 1001,
                            "Game 2": 1015,
                            "Score": 2016
                          },
                          "total": 2016,
                          "percent": 80.6,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:20:05Z",
                          "updated_at": "2026-12-03T19:19:40Z",
                          "flags": []
                        },
                        {
                          "id": "p9",
                          "name": "Zhang Yunyi",
                          "rank": 3,
                          "values": {
                            "Game 1": 1030,
                            "Game 2": 960,
                            "Score": 1990
                          },
                          "total": 1990,
                          "percent": 79.6,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:20:05Z",
                          "updated_at": "2026-12-03T19:17:12Z",
                          "flags": [
                            "manual",
                            "camera_disagrees"
                          ]
                        },
                        {
                          "id": "p4",
                          "name": "Benjamin Weber",
                          "rank": 4,
                          "values": {
                            "Game 1": 971,
                            "Game 2": 960,
                            "Score": 1931
                          },
                          "total": 1931,
                          "percent": 77.2,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:20:05Z",
                          "updated_at": "2026-12-03T19:18:25Z",
                          "flags": [
                            "decreased"
                          ]
                        },
                        {
                          "id": "p3",
                          "name": "Anup Agarwal",
                          "rank": 5,
                          "values": {
                            "Game 1": 970,
                            "Game 2": null,
                            "Score": 970
                          },
                          "total": 970,
                          "percent": 38.8,
                          "on_board": false,
                          "last_seen_at": "2026-12-03T19:12:48Z",
                          "updated_at": "2026-12-03T19:07:33Z",
                          "flags": []
                        }
                      ]
                    }
                  ]
                }
              }
            },
            "headers": {
              "etag": {
                "description": "Send it back in If-None-Match.",
                "schema": {
                  "type": "string"
                }
              },
              "cache-control": {
                "description": "public, max-age=3, s-maxage=5, stale-while-revalidate=30",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not modified since the etag you sent."
          },
          "429": {
            "description": "Over the limit of 300 requests per 10 seconds per IP address. Wait retry-after seconds.",
            "headers": {
              "retry-after": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            }
          }
        }
      }
    },
    "/s/{session}/feed.json": {
      "get": {
        "operationId": "getSessionFeedJson",
        "summary": "The live scores (one session)",
        "description": "Every stage and every player's latest published values, and how current they are (health). version goes up whenever anything changes. Send the etag back in If-None-Match and an unchanged feed answers 304 with no body: same session, same scores and the same health.reading as the copy you hold.",
        "parameters": [
          {
            "name": "session",
            "in": "path",
            "required": true,
            "description": "A session id from /sessions.json.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]{2,40}$"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "The etag of the copy you have.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The live scores",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Feed"
                },
                "example": {
                  "session": {
                    "id": "main",
                    "name": "Evening final",
                    "kind": "live"
                  },
                  "version": 128,
                  "generated_at": "2026-12-03T19:20:11Z",
                  "updated_at": "2026-12-03T19:20:05Z",
                  "changed_at": "2026-12-03T19:19:40Z",
                  "stale": false,
                  "health": {
                    "last_frame_at": "2026-12-03T19:20:05Z",
                    "last_read_at": "2026-12-03T19:20:05Z",
                    "last_change_at": "2026-12-03T19:19:40Z",
                    "reading": "ok",
                    "mode": "auto"
                  },
                  "current_stage_id": "s2",
                  "stages": [
                    {
                      "id": "s1",
                      "label": "Qualifying",
                      "current": false,
                      "columns": [
                        "Points"
                      ],
                      "total_column": "Points",
                      "max_total": null,
                      "code": null,
                      "qualify_top": 24,
                      "started_at": "2026-12-03T18:02:10Z",
                      "ended_at": "2026-12-03T19:05:40Z",
                      "last_frame_at": "2026-12-03T19:05:31Z",
                      "players": [
                        {
                          "id": "p3",
                          "name": "Anup Agarwal",
                          "rank": 1,
                          "values": {
                            "Points": 780
                          },
                          "total": 780,
                          "percent": null,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:05:31Z",
                          "updated_at": "2026-12-03T18:58:02Z",
                          "flags": []
                        },
                        {
                          "id": "p7",
                          "name": "Alan Belmore",
                          "rank": 2,
                          "values": {
                            "Points": 780
                          },
                          "total": 780,
                          "percent": null,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:05:31Z",
                          "updated_at": "2026-12-03T18:59:14Z",
                          "flags": []
                        },
                        {
                          "id": "p4",
                          "name": "Benjamin Weber",
                          "rank": 3,
                          "values": {
                            "Points": 740
                          },
                          "total": 740,
                          "percent": null,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:05:31Z",
                          "updated_at": "2026-12-03T19:01:47Z",
                          "flags": [
                            "manual"
                          ]
                        }
                      ]
                    },
                    {
                      "id": "s2",
                      "label": "Semi-final 1",
                      "current": true,
                      "columns": [
                        "Game 1",
                        "Game 2",
                        "Score"
                      ],
                      "total_column": "Score",
                      "max_total": 2500,
                      "code": "SF1",
                      "qualify_top": 2,
                      "started_at": "2026-12-03T19:06:02Z",
                      "ended_at": null,
                      "last_frame_at": "2026-12-03T19:20:05Z",
                      "players": [
                        {
                          "id": "p14",
                          "name": "Ha Dang",
                          "rank": 1,
                          "values": {
                            "Game 1": 1041,
                            "Game 2": 1030,
                            "Score": 2071
                          },
                          "total": 2071,
                          "percent": 82.8,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:20:05Z",
                          "updated_at": "2026-12-03T19:19:40Z",
                          "flags": []
                        },
                        {
                          "id": "p2",
                          "name": "Nick Boberg",
                          "rank": 2,
                          "values": {
                            "Game 1": 1001,
                            "Game 2": 1015,
                            "Score": 2016
                          },
                          "total": 2016,
                          "percent": 80.6,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:20:05Z",
                          "updated_at": "2026-12-03T19:19:40Z",
                          "flags": []
                        },
                        {
                          "id": "p9",
                          "name": "Zhang Yunyi",
                          "rank": 3,
                          "values": {
                            "Game 1": 1030,
                            "Game 2": 960,
                            "Score": 1990
                          },
                          "total": 1990,
                          "percent": 79.6,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:20:05Z",
                          "updated_at": "2026-12-03T19:17:12Z",
                          "flags": [
                            "manual",
                            "camera_disagrees"
                          ]
                        },
                        {
                          "id": "p4",
                          "name": "Benjamin Weber",
                          "rank": 4,
                          "values": {
                            "Game 1": 971,
                            "Game 2": 960,
                            "Score": 1931
                          },
                          "total": 1931,
                          "percent": 77.2,
                          "on_board": true,
                          "last_seen_at": "2026-12-03T19:20:05Z",
                          "updated_at": "2026-12-03T19:18:25Z",
                          "flags": [
                            "decreased"
                          ]
                        },
                        {
                          "id": "p3",
                          "name": "Anup Agarwal",
                          "rank": 5,
                          "values": {
                            "Game 1": 970,
                            "Game 2": null,
                            "Score": 970
                          },
                          "total": 970,
                          "percent": 38.8,
                          "on_board": false,
                          "last_seen_at": "2026-12-03T19:12:48Z",
                          "updated_at": "2026-12-03T19:07:33Z",
                          "flags": []
                        }
                      ]
                    }
                  ]
                }
              }
            },
            "headers": {
              "etag": {
                "description": "Send it back in If-None-Match.",
                "schema": {
                  "type": "string"
                }
              },
              "cache-control": {
                "description": "public, max-age=3, s-maxage=5, stale-while-revalidate=30",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not modified since the etag you sent."
          },
          "404": {
            "description": "No such session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_such_session"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit of 300 requests per 10 seconds per IP address. Wait retry-after seconds.",
            "headers": {
              "retry-after": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            }
          }
        }
      }
    },
    "/history.json": {
      "get": {
        "operationId": "getHistoryJson",
        "summary": "Every published change (the main session)",
        "description": "Each player's values every time they changed, oldest first: enough to draw scores over time. Fetch it once, then, when the feed's version changes, only what is new (?after=), not on every poll.",
        "parameters": [
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "description": "A stage id from the feed, such as s2. Leave it out for every stage. A malformed id answers 404 { \"error\": \"no_such_stage\" }.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "A change id (a point's id). Only changes with a larger id are returned, so you can keep what you have and append. Leave it out for everything.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "The etag of the copy you have.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every published change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/History"
                },
                "example": {
                  "session": {
                    "id": "main",
                    "name": "Evening final",
                    "kind": "live"
                  },
                  "generated_at": "2026-12-03T19:20:11Z",
                  "stages": [
                    {
                      "id": "s2",
                      "label": "Semi-final 1",
                      "columns": [
                        "Game 1",
                        "Game 2",
                        "Score"
                      ],
                      "total_column": "Score",
                      "max_total": 2500,
                      "code": "SF1",
                      "started_at": "2026-12-03T19:06:02Z",
                      "ended_at": null,
                      "players": [
                        {
                          "id": "p14",
                          "name": "Ha Dang",
                          "points": [
                            {
                              "id": 5001,
                              "at": "2026-12-03T19:07:33Z",
                              "rank": 1,
                              "values": {
                                "Game 1": 1041,
                                "Game 2": null,
                                "Score": 1041
                              },
                              "total": 1041,
                              "percent": 41.6
                            },
                            {
                              "id": 5009,
                              "at": "2026-12-03T19:19:40Z",
                              "rank": 1,
                              "values": {
                                "Game 1": 1041,
                                "Game 2": 1030,
                                "Score": 2071
                              },
                              "total": 2071,
                              "percent": 82.8
                            }
                          ]
                        },
                        {
                          "id": "p2",
                          "name": "Nick Boberg",
                          "points": [
                            {
                              "id": 5002,
                              "at": "2026-12-03T19:07:33Z",
                              "rank": 3,
                              "values": {
                                "Game 1": 1001,
                                "Game 2": null,
                                "Score": 1001
                              },
                              "total": 1001,
                              "percent": 40
                            },
                            {
                              "id": 5010,
                              "at": "2026-12-03T19:19:40Z",
                              "rank": 2,
                              "values": {
                                "Game 1": 1001,
                                "Game 2": 1015,
                                "Score": 2016
                              },
                              "total": 2016,
                              "percent": 80.6
                            }
                          ]
                        },
                        {
                          "id": "p9",
                          "name": "Zhang Yunyi",
                          "points": [
                            {
                              "id": 5003,
                              "at": "2026-12-03T19:07:33Z",
                              "rank": 2,
                              "values": {
                                "Game 1": 1030,
                                "Game 2": null,
                                "Score": 1030
                              },
                              "total": 1030,
                              "percent": 41.2
                            },
                            {
                              "id": 5006,
                              "at": "2026-12-03T19:17:12Z",
                              "rank": 2,
                              "values": {
                                "Game 1": 1030,
                                "Game 2": 960,
                                "Score": 1990
                              },
                              "total": 1990,
                              "percent": 79.6
                            }
                          ]
                        },
                        {
                          "id": "p4",
                          "name": "Benjamin Weber",
                          "points": [
                            {
                              "id": 5004,
                              "at": "2026-12-03T19:07:33Z",
                              "rank": 4,
                              "values": {
                                "Game 1": 971,
                                "Game 2": null,
                                "Score": 971
                              },
                              "total": 971,
                              "percent": 38.8
                            },
                            {
                              "id": 5007,
                              "at": "2026-12-03T19:17:59Z",
                              "rank": 3,
                              "values": {
                                "Game 1": 971,
                                "Game 2": 990,
                                "Score": 1961
                              },
                              "total": 1961,
                              "percent": 78.4
                            },
                            {
                              "id": 5008,
                              "at": "2026-12-03T19:18:25Z",
                              "rank": 4,
                              "values": {
                                "Game 1": 971,
                                "Game 2": 960,
                                "Score": 1931
                              },
                              "total": 1931,
                              "percent": 77.2
                            }
                          ]
                        },
                        {
                          "id": "p3",
                          "name": "Anup Agarwal",
                          "points": [
                            {
                              "id": 5005,
                              "at": "2026-12-03T19:07:33Z",
                              "rank": 5,
                              "values": {
                                "Game 1": 970,
                                "Game 2": null,
                                "Score": 970
                              },
                              "total": 970,
                              "percent": 38.8
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              }
            },
            "headers": {
              "etag": {
                "description": "Send it back in If-None-Match.",
                "schema": {
                  "type": "string"
                }
              },
              "cache-control": {
                "description": "public, max-age=3, s-maxage=5, stale-while-revalidate=30",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not modified since the etag you sent."
          },
          "404": {
            "description": "A malformed stage id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_such_stage"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit of 300 requests per 10 seconds per IP address. Wait retry-after seconds.",
            "headers": {
              "retry-after": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            }
          }
        }
      }
    },
    "/s/{session}/history.json": {
      "get": {
        "operationId": "getSessionHistoryJson",
        "summary": "Every published change (one session)",
        "description": "Each player's values every time they changed, oldest first: enough to draw scores over time. Fetch it once, then, when the feed's version changes, only what is new (?after=), not on every poll.",
        "parameters": [
          {
            "name": "session",
            "in": "path",
            "required": true,
            "description": "A session id from /sessions.json.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]{2,40}$"
            }
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "description": "A stage id from the feed, such as s2. Leave it out for every stage. A malformed id answers 404 { \"error\": \"no_such_stage\" }.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "A change id (a point's id). Only changes with a larger id are returned, so you can keep what you have and append. Leave it out for everything.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "The etag of the copy you have.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every published change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/History"
                },
                "example": {
                  "session": {
                    "id": "main",
                    "name": "Evening final",
                    "kind": "live"
                  },
                  "generated_at": "2026-12-03T19:20:11Z",
                  "stages": [
                    {
                      "id": "s2",
                      "label": "Semi-final 1",
                      "columns": [
                        "Game 1",
                        "Game 2",
                        "Score"
                      ],
                      "total_column": "Score",
                      "max_total": 2500,
                      "code": "SF1",
                      "started_at": "2026-12-03T19:06:02Z",
                      "ended_at": null,
                      "players": [
                        {
                          "id": "p14",
                          "name": "Ha Dang",
                          "points": [
                            {
                              "id": 5001,
                              "at": "2026-12-03T19:07:33Z",
                              "rank": 1,
                              "values": {
                                "Game 1": 1041,
                                "Game 2": null,
                                "Score": 1041
                              },
                              "total": 1041,
                              "percent": 41.6
                            },
                            {
                              "id": 5009,
                              "at": "2026-12-03T19:19:40Z",
                              "rank": 1,
                              "values": {
                                "Game 1": 1041,
                                "Game 2": 1030,
                                "Score": 2071
                              },
                              "total": 2071,
                              "percent": 82.8
                            }
                          ]
                        },
                        {
                          "id": "p2",
                          "name": "Nick Boberg",
                          "points": [
                            {
                              "id": 5002,
                              "at": "2026-12-03T19:07:33Z",
                              "rank": 3,
                              "values": {
                                "Game 1": 1001,
                                "Game 2": null,
                                "Score": 1001
                              },
                              "total": 1001,
                              "percent": 40
                            },
                            {
                              "id": 5010,
                              "at": "2026-12-03T19:19:40Z",
                              "rank": 2,
                              "values": {
                                "Game 1": 1001,
                                "Game 2": 1015,
                                "Score": 2016
                              },
                              "total": 2016,
                              "percent": 80.6
                            }
                          ]
                        },
                        {
                          "id": "p9",
                          "name": "Zhang Yunyi",
                          "points": [
                            {
                              "id": 5003,
                              "at": "2026-12-03T19:07:33Z",
                              "rank": 2,
                              "values": {
                                "Game 1": 1030,
                                "Game 2": null,
                                "Score": 1030
                              },
                              "total": 1030,
                              "percent": 41.2
                            },
                            {
                              "id": 5006,
                              "at": "2026-12-03T19:17:12Z",
                              "rank": 2,
                              "values": {
                                "Game 1": 1030,
                                "Game 2": 960,
                                "Score": 1990
                              },
                              "total": 1990,
                              "percent": 79.6
                            }
                          ]
                        },
                        {
                          "id": "p4",
                          "name": "Benjamin Weber",
                          "points": [
                            {
                              "id": 5004,
                              "at": "2026-12-03T19:07:33Z",
                              "rank": 4,
                              "values": {
                                "Game 1": 971,
                                "Game 2": null,
                                "Score": 971
                              },
                              "total": 971,
                              "percent": 38.8
                            },
                            {
                              "id": 5007,
                              "at": "2026-12-03T19:17:59Z",
                              "rank": 3,
                              "values": {
                                "Game 1": 971,
                                "Game 2": 990,
                                "Score": 1961
                              },
                              "total": 1961,
                              "percent": 78.4
                            },
                            {
                              "id": 5008,
                              "at": "2026-12-03T19:18:25Z",
                              "rank": 4,
                              "values": {
                                "Game 1": 971,
                                "Game 2": 960,
                                "Score": 1931
                              },
                              "total": 1931,
                              "percent": 77.2
                            }
                          ]
                        },
                        {
                          "id": "p3",
                          "name": "Anup Agarwal",
                          "points": [
                            {
                              "id": 5005,
                              "at": "2026-12-03T19:07:33Z",
                              "rank": 5,
                              "values": {
                                "Game 1": 970,
                                "Game 2": null,
                                "Score": 970
                              },
                              "total": 970,
                              "percent": 38.8
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              }
            },
            "headers": {
              "etag": {
                "description": "Send it back in If-None-Match.",
                "schema": {
                  "type": "string"
                }
              },
              "cache-control": {
                "description": "public, max-age=3, s-maxage=5, stale-while-revalidate=30",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not modified since the etag you sent."
          },
          "404": {
            "description": "No such session, or a malformed stage id (\"no_such_stage\").",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_such_session"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit of 300 requests per 10 seconds per IP address. Wait retry-after seconds.",
            "headers": {
              "retry-after": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            }
          }
        }
      }
    },
    "/history.csv": {
      "get": {
        "operationId": "getHistoryCsv",
        "summary": "Every published change, as a spreadsheet (the main session)",
        "description": "The same as history.json, one line per value: stage_id, stage, player_id, player, at, rank, column, value. Sent as a download. A cell starting with =, +, - or @ is prefixed with ' so a spreadsheet does not run it. after is ignored here.",
        "parameters": [
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "description": "A stage id from the feed, such as s2. Leave it out for every stage. A malformed id answers 404 { \"error\": \"no_such_stage\" }.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "The etag of the copy you have.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every published change, as a spreadsheet",
            "content": {
              "text/csv; charset=utf-8": {
                "schema": {
                  "type": "string"
                },
                "example": "stage_id,stage,player_id,player,at,rank,column,value\ns2,Semi-final 1,p14,Ha Dang,2026-12-03T19:19:40Z,1,Game 1,1041\ns2,Semi-final 1,p14,Ha Dang,2026-12-03T19:19:40Z,1,Game 2,1030\ns2,Semi-final 1,p14,Ha Dang,2026-12-03T19:19:40Z,1,Score,2071"
              }
            },
            "headers": {
              "etag": {
                "description": "Send it back in If-None-Match.",
                "schema": {
                  "type": "string"
                }
              },
              "cache-control": {
                "description": "public, max-age=3, s-maxage=5, stale-while-revalidate=30",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not modified since the etag you sent."
          },
          "404": {
            "description": "A malformed stage id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_such_stage"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit of 300 requests per 10 seconds per IP address. Wait retry-after seconds.",
            "headers": {
              "retry-after": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            }
          }
        }
      }
    },
    "/s/{session}/history.csv": {
      "get": {
        "operationId": "getSessionHistoryCsv",
        "summary": "Every published change, as a spreadsheet (one session)",
        "description": "The same as history.json, one line per value: stage_id, stage, player_id, player, at, rank, column, value. Sent as a download. A cell starting with =, +, - or @ is prefixed with ' so a spreadsheet does not run it. after is ignored here.",
        "parameters": [
          {
            "name": "session",
            "in": "path",
            "required": true,
            "description": "A session id from /sessions.json.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]{2,40}$"
            }
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "description": "A stage id from the feed, such as s2. Leave it out for every stage. A malformed id answers 404 { \"error\": \"no_such_stage\" }.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "The etag of the copy you have.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every published change, as a spreadsheet",
            "content": {
              "text/csv; charset=utf-8": {
                "schema": {
                  "type": "string"
                },
                "example": "stage_id,stage,player_id,player,at,rank,column,value\ns2,Semi-final 1,p14,Ha Dang,2026-12-03T19:19:40Z,1,Game 1,1041\ns2,Semi-final 1,p14,Ha Dang,2026-12-03T19:19:40Z,1,Game 2,1030\ns2,Semi-final 1,p14,Ha Dang,2026-12-03T19:19:40Z,1,Score,2071"
              }
            },
            "headers": {
              "etag": {
                "description": "Send it back in If-None-Match.",
                "schema": {
                  "type": "string"
                }
              },
              "cache-control": {
                "description": "public, max-age=3, s-maxage=5, stale-while-revalidate=30",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not modified since the etag you sent."
          },
          "404": {
            "description": "No such session, or a malformed stage id (\"no_such_stage\").",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_such_session"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit of 300 requests per 10 seconds per IP address. Wait retry-after seconds.",
            "headers": {
              "retry-after": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            }
          }
        }
      }
    },
    "/sessions.json": {
      "get": {
        "operationId": "getSessionsJson",
        "summary": "The sessions",
        "description": "Every recording that is not archived, with its feed and page addresses. The main session is the real event and is also served at the root addresses; a test session is a rehearsal.",
        "parameters": [
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "The etag of the copy you have.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sessions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionList"
                },
                "example": {
                  "main_session_id": "main",
                  "sessions": [
                    {
                      "id": "main",
                      "name": "Evening final",
                      "kind": "live",
                      "created_at": "2026-12-03T17:40:00Z",
                      "feed_url": "https://mewc.scorchsoft.tools/s/main/feed.json",
                      "page_url": "https://mewc.scorchsoft.tools/s/main"
                    },
                    {
                      "id": "dry-run-2",
                      "name": "Dry run 2",
                      "kind": "test",
                      "created_at": "2026-12-03T16:05:12Z",
                      "feed_url": "https://mewc.scorchsoft.tools/s/dry-run-2/feed.json",
                      "page_url": "https://mewc.scorchsoft.tools/s/dry-run-2"
                    }
                  ]
                }
              }
            },
            "headers": {
              "etag": {
                "description": "Send it back in If-None-Match.",
                "schema": {
                  "type": "string"
                }
              },
              "cache-control": {
                "description": "public, max-age=3, s-maxage=5, stale-while-revalidate=30",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not modified since the etag you sent."
          },
          "429": {
            "description": "Over the limit of 300 requests per 10 seconds per IP address. Wait retry-after seconds.",
            "headers": {
              "retry-after": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            }
          }
        }
      }
    },
    "/api.md": {
      "get": {
        "operationId": "getApiMd",
        "summary": "This reference in Markdown",
        "description": "Everything here in one read, for a person or a language model.",
        "responses": {
          "200": {
            "description": "This reference in Markdown",
            "content": {
              "text/markdown; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit of 300 requests per 10 seconds per IP address. Wait retry-after seconds.",
            "headers": {
              "retry-after": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenapiJson",
        "summary": "OpenAPI 3.1 description",
        "description": "The endpoints and schemas, for code generators and API tools.",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 description",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit of 300 requests per 10 seconds per IP address. Wait retry-after seconds.",
            "headers": {
              "retry-after": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks.md": {
      "get": {
        "operationId": "getWebhooksMd",
        "summary": "The webhook spec",
        "description": "For a system that receives our webhook requests: when each request is sent, both formats field by field with examples, retries and what we need from you.",
        "responses": {
          "200": {
            "description": "The webhook spec",
            "content": {
              "text/markdown; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit of 300 requests per 10 seconds per IP address. Wait retry-after seconds.",
            "headers": {
              "retry-after": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsTxt",
        "summary": "A short index for language models",
        "description": "What the site is and where the machine-readable files are.",
        "responses": {
          "200": {
            "description": "A short index for language models",
            "content": {
              "text/plain; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit of 300 requests per 10 seconds per IP address. Wait retry-after seconds.",
            "headers": {
              "retry-after": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SessionRef": {
        "type": "object",
        "description": "A session is one recording with its own address. The main session is the real event; a test session is a rehearsal.",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Lower-case letters, digits and hyphens, such as \"main\" or \"dry-run-2\"."
          },
          "name": {
            "type": "string",
            "description": "A name an operator gave it."
          },
          "kind": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ],
            "description": "\"live\" for a real recording, \"test\" for a rehearsal. Ignore test sessions unless you are testing."
          }
        }
      },
      "SessionList": {
        "type": "object",
        "description": "GET /sessions.json: the sessions that are not archived.",
        "additionalProperties": false,
        "required": [
          "main_session_id",
          "sessions"
        ],
        "properties": {
          "main_session_id": {
            "type": "string",
            "description": "The session served at the root addresses (/feed.json and so on)."
          },
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionListItem"
            },
            "description": "Every session that is not archived."
          }
        }
      },
      "SessionListItem": {
        "type": "object",
        "description": "One session in /sessions.json.",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind",
          "created_at",
          "feed_url",
          "page_url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "As in SessionRef."
          },
          "name": {
            "type": "string",
            "description": "As in SessionRef."
          },
          "kind": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ],
            "description": "As in SessionRef."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the session was made."
          },
          "feed_url": {
            "type": "string",
            "description": "The session's feed address: /s/<id>/feed.json."
          },
          "page_url": {
            "type": "string",
            "description": "The session's live page: /s/<id>."
          }
        }
      },
      "Feed": {
        "type": "object",
        "description": "GET /feed.json: every stage, with each player's latest published values.",
        "additionalProperties": false,
        "required": [
          "session",
          "version",
          "generated_at",
          "updated_at",
          "changed_at",
          "stale",
          "health",
          "current_stage_id",
          "stages"
        ],
        "properties": {
          "session": {
            "$ref": "#/components/schemas/SessionRef",
            "description": "The recording this body belongs to. A test session is a rehearsal, not the real event."
          },
          "version": {
            "type": "integer",
            "minimum": 0,
            "description": "Goes up by one each time anything published changes. 0 before any data."
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this response was made."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The last picture of the board from which at least one row was read and used (the same as health.last_read_at). Null before any."
          },
          "changed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The last time a published value changed. Null before any."
          },
          "stale": {
            "type": "boolean",
            "description": "True when nothing has been read from a picture for 60 seconds (health.reading is not \"ok\"): the scores may be out of date. Pictures that arrive but can't be used (the board out of view, every row unreadable) don't count. True before any data."
          },
          "health": {
            "$ref": "#/components/schemas/FeedHealth"
          },
          "current_stage_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The id of the stage on the board now. Null before any data."
          },
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeedStage"
            },
            "description": "Every stage, in the order they started."
          }
        }
      },
      "FeedHealth": {
        "type": "object",
        "description": "How current the feed is, worked out as the response is made. Use it to say why the scores may be out of date.",
        "additionalProperties": false,
        "required": [
          "last_frame_at",
          "last_read_at",
          "last_change_at",
          "reading",
          "mode"
        ],
        "properties": {
          "last_frame_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The last picture that arrived from the camera, read or not. Null before any."
          },
          "last_read_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The last picture from which at least one row was read and used (the same as updated_at). Null before any."
          },
          "last_change_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The last time a published value changed (the same as changed_at). Null before any."
          },
          "reading": {
            "type": "string",
            "enum": [
              "ok",
              "nothing_read",
              "no_frames"
            ],
            "description": "\"ok\": something was read within 60 seconds. \"nothing_read\": pictures arrive, but nothing has been read from them for 60 seconds (the board is out of view or unreadable). \"no_frames\": no picture has arrived for 60 seconds (the camera is off or offline). stale is true unless this is \"ok\"."
          },
          "mode": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "auto",
              "manual",
              null
            ],
            "description": "How the board is being captured, from the most recent picture in the last 10 minutes: \"auto\" (a camera sends a picture every few seconds) or \"manual\" (an operator takes a photo when they choose, so minutes between readings are normal). Null when no picture has arrived for 10 minutes."
          }
        }
      },
      "FeedStage": {
        "type": "object",
        "description": "One board: a round, heat or final.",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "current",
          "columns",
          "total_column",
          "max_total",
          "code",
          "qualify_top",
          "started_at",
          "ended_at",
          "last_frame_at",
          "players"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable id: \"s1\", \"s2\" and so on."
          },
          "label": {
            "type": "string",
            "description": "The board's title, a name an operator gave it, or \"Stage <n>\". It can change."
          },
          "current": {
            "type": "boolean",
            "description": "True for the stage on the board now. At most one is current."
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The score columns as headed on the board, left to right, such as [\"Game 1\", \"Game 2\", \"Score\"] or [\"Points\"]."
          },
          "total_column": {
            "type": [
              "string",
              "null"
            ],
            "description": "The column to rank and chart by: the total if the board has one, otherwise the last column."
          },
          "max_total": {
            "type": [
              "number",
              "null"
            ],
            "description": "The highest total possible in this stage (bonuses included), set by an operator, such as 1250. Null when none is set: then every percent is null."
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "The organisers' code for this round, such as \"SF1\", \"SF2\" or \"F\": worked out from the board's title when the stage opens (\"Semi-final 2\" gives SF2) or set by an operator. Null when it has none yet."
          },
          "qualify_top": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "How many players go through to the next round (\"top 6 go through\"), set by an operator. Null when no line is set. Players placed within it (by rank) are above the line; a tie at the cut keeps everyone tied above it."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the stage was first seen."
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the next stage replaced it. Null while it is current."
          },
          "last_frame_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The last picture of this stage from which something was read. Null if none yet."
          },
          "players": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeedPlayer"
            },
            "description": "By rank, then total (highest first), then name. Players are never removed: see on_board."
          }
        }
      },
      "FeedPlayer": {
        "type": "object",
        "description": "One player in one stage.",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "rank",
          "values",
          "total",
          "percent",
          "on_board",
          "last_seen_at",
          "updated_at",
          "flags"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable across stages: \"p14\" is the same person in every stage."
          },
          "name": {
            "type": "string",
            "description": "As read from the board, or the organiser's spelling when it matches their list. Treat it as untrusted text."
          },
          "rank": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The rank printed on the board. Null if the board shows none."
          },
          "values": {
            "type": "object",
            "description": "Column heading → value, one entry per column. A cell never read is null.",
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            }
          },
          "total": {
            "type": [
              "number",
              "null"
            ],
            "description": "This player's value in total_column, or null."
          },
          "percent": {
            "type": [
              "number",
              "null"
            ],
            "description": "Percent complete: total ÷ max_total × 100, rounded to one decimal place and capped at 100. Null when the stage has no max_total or the player has no total."
          },
          "on_board": {
            "type": "boolean",
            "description": "True when the name was on the board within 45 seconds of the stage's latest picture. False means scrolled off or no longer shown; the values are the last ones read."
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "The last picture in which the name was on the board."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The last time this player's values changed. Null if never."
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "\"decreased\": the total went down at the last change (a correction on the board, or a misread). \"manual\": set by an operator and locked: the camera can't change it until it reads the same value or the operator releases it. \"camera_disagrees\": with \"manual\", the camera reads something else for this player now. \"over_max\": the total is above the stage's own max_total (percent is capped at 100), so the total or the maximum is probably wrong. Empty otherwise."
          }
        }
      },
      "History": {
        "type": "object",
        "description": "GET /history.json: every published change, oldest first (or only those after ?after=).",
        "additionalProperties": false,
        "required": [
          "session",
          "generated_at",
          "stages"
        ],
        "properties": {
          "session": {
            "$ref": "#/components/schemas/SessionRef",
            "description": "The recording this body belongs to. A test session is a rehearsal, not the real event."
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this response was made."
          },
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryStage"
            },
            "description": "Every stage, or the one asked for with ?stage=."
          }
        }
      },
      "HistoryStage": {
        "type": "object",
        "description": "One stage's changes.",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "columns",
          "total_column",
          "max_total",
          "code",
          "started_at",
          "ended_at",
          "players"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "As in the feed."
          },
          "label": {
            "type": "string",
            "description": "As in the feed."
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "As in the feed: the organisers' code for this round, or null."
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "As in the feed."
          },
          "total_column": {
            "type": [
              "string",
              "null"
            ],
            "description": "As in the feed."
          },
          "max_total": {
            "type": [
              "number",
              "null"
            ],
            "description": "As in the feed: the maximum now, which every point's percent uses."
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "As in the feed."
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "As in the feed."
          },
          "players": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryPlayer"
            },
            "description": "Everyone with at least one published value in the stage."
          }
        }
      },
      "HistoryPlayer": {
        "type": "object",
        "description": "One player's changes in one stage.",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "points"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "As in the feed."
          },
          "name": {
            "type": "string",
            "description": "As in the feed."
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryPoint"
            },
            "description": "One per published change, oldest first. With ?after=, only the changes after that id."
          }
        }
      },
      "HistoryPoint": {
        "type": "object",
        "description": "A player's values from one moment until the next change.",
        "additionalProperties": false,
        "required": [
          "id",
          "at",
          "rank",
          "values",
          "total",
          "percent"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "description": "The change's id. Ids only go up: ask for ?after=<the largest id you hold> to get only later changes."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the change was published."
          },
          "rank": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The rank on the board at that moment, or null."
          },
          "values": {
            "type": "object",
            "description": "Column heading → value from that moment on.",
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            }
          },
          "total": {
            "type": [
              "number",
              "null"
            ],
            "description": "The value in total_column from that moment on, or null."
          },
          "percent": {
            "type": [
              "number",
              "null"
            ],
            "description": "Percent complete from that moment on, as in the feed, or null."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "A short code: \"no_such_session\", \"no_such_stage\" or \"rate_limited\"."
          }
        }
      }
    }
  }
}