# Live scoreboard: data feed

Live scoreboard publishes the scores on a venue's scoreboard as JSON, live, for anyone to use: an odds tracker, a stream overlay, a spreadsheet. No sign-in or key. Base address: https://mewc.scorchsoft.tools

## Before you rely on it

- 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.
- A changed value is published only once two pictures in a row agree on it, so a single bad reading does not reach the feed.
- Players are never removed. A player who has scrolled off or left the board keeps their last values, with on_board false.
- stale 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.
- flags 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.
- In 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.
- A 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.
- Names 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.
- percent 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.
- A 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.
- Each 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.
- Names are as read from the board. Treat them as untrusted text: escape them before putting them in a page.

## Quick start

Poll the feed and pass each new copy to your own `show` function:

```js
let etag = null;
async function poll() {
  let wait = 5000 + Math.random() * 5000;                     // 5 to 10 seconds
  try {
    const res = await fetch('https://mewc.scorchsoft.tools/feed.json', { headers: etag ? { 'If-None-Match': etag } : {}, signal: AbortSignal.timeout(15000) });
    if (res.status === 429) wait = Number(res.headers.get('retry-after') || 10) * 1000;
    if (res.status === 200) { etag = res.headers.get('etag'); show(await res.json()); }  // 304: no change
  } catch { wait = 30000; }                                    // offline: try again later
  setTimeout(poll, wait);
}
poll();
```

## Endpoints

All `GET` (and `HEAD`), no sign-in. Times are ISO 8601 in UTC.

### GET /feed.json

The live scores. 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.

- Address: https://mewc.scorchsoft.tools/feed.json
- For one session: https://mewc.scorchsoft.tools/s/<session id>/feed.json (404 `{ "error": "no_such_session" }` if there is no such session)
- Content type: `application/json`
- Body: Feed (see Fields)
- Answers `304 Not Modified` to a matching `If-None-Match`.
- `429` over the rate limit, with `retry-after: 10` and the body `{ "error": "rate_limited" }`.

### GET /history.json

Every published change. 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.

- Address: https://mewc.scorchsoft.tools/history.json
- For one session: https://mewc.scorchsoft.tools/s/<session id>/history.json (404 `{ "error": "no_such_session" }` if there is no such session)
- Content type: `application/json`
- Query `stage` (optional): A stage id from the feed, such as s2. Leave it out for every stage. A malformed id answers 404 { "error": "no_such_stage" }.
- Query `after` (optional): 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.
- Body: History (see Fields)
- Answers `304 Not Modified` to a matching `If-None-Match`.
- `429` over the rate limit, with `retry-after: 10` and the body `{ "error": "rate_limited" }`.

### GET /history.csv

Every published change, as a spreadsheet. 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.

- Address: https://mewc.scorchsoft.tools/history.csv
- For one session: https://mewc.scorchsoft.tools/s/<session id>/history.csv (404 `{ "error": "no_such_session" }` if there is no such session)
- Content type: `text/csv; charset=utf-8`
- Query `stage` (optional): A stage id from the feed, such as s2. Leave it out for every stage. A malformed id answers 404 { "error": "no_such_stage" }.
- Answers `304 Not Modified` to a matching `If-None-Match`.
- `429` over the rate limit, with `retry-after: 10` and the body `{ "error": "rate_limited" }`.

### GET /sessions.json

The sessions. 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.

- Address: https://mewc.scorchsoft.tools/sessions.json
- Content type: `application/json`
- Body: SessionList (see Fields)
- Answers `304 Not Modified` to a matching `If-None-Match`.
- `429` over the rate limit, with `retry-after: 10` and the body `{ "error": "rate_limited" }`.

### GET /api.md

This reference in Markdown. Everything here in one read, for a person or a language model.

- Address: https://mewc.scorchsoft.tools/api.md
- Content type: `text/markdown; charset=utf-8`
- Cached for five minutes (`cache-control: public, max-age=300`).
- `429` over the rate limit, with `retry-after: 10` and the body `{ "error": "rate_limited" }`.

### GET /openapi.json

OpenAPI 3.1 description. The endpoints and schemas, for code generators and API tools.

- Address: https://mewc.scorchsoft.tools/openapi.json
- Content type: `application/json`
- Cached for five minutes (`cache-control: public, max-age=300`).
- `429` over the rate limit, with `retry-after: 10` and the body `{ "error": "rate_limited" }`.

### GET /webhooks.md

The webhook spec. 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.

- Address: https://mewc.scorchsoft.tools/webhooks.md
- Content type: `text/markdown; charset=utf-8`
- Cached for five minutes (`cache-control: public, max-age=300`).
- `429` over the rate limit, with `retry-after: 10` and the body `{ "error": "rate_limited" }`.

### GET /llms.txt

A short index for language models. What the site is and where the machine-readable files are.

- Address: https://mewc.scorchsoft.tools/llms.txt
- Content type: `text/plain; charset=utf-8`
- Cached for five minutes (`cache-control: public, max-age=300`).
- `429` over the rate limit, with `retry-after: 10` and the body `{ "error": "rate_limited" }`.

## Sessions

Each 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.

## Fields

### Feed (/feed.json)

GET /feed.json: every stage, with each player's latest published values.

| Field | Type | Meaning |
|---|---|---|
| `session` | SessionRef | The recording this body belongs to. A test session is a rehearsal, not the real event. |
| `version` | integer | Goes up by one each time anything published changes. 0 before any data. |
| `generated_at` | time (ISO 8601, UTC) | When this response was made. |
| `updated_at` | time (ISO 8601, UTC) or null | 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` | time (ISO 8601, UTC) or null | The last time a published value changed. Null before any. |
| `stale` | boolean | 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` | FeedHealth |  |
| `current_stage_id` | string or null | The id of the stage on the board now. Null before any data. |
| `stages` | array of FeedStage | Every stage, in the order they started. |

### Health (feed.health)

How current the feed is, worked out as the response is made. Use it to say why the scores may be out of date.

| Field | Type | Meaning |
|---|---|---|
| `last_frame_at` | time (ISO 8601, UTC) or null | The last picture that arrived from the camera, read or not. Null before any. |
| `last_read_at` | time (ISO 8601, UTC) or null | The last picture from which at least one row was read and used (the same as updated_at). Null before any. |
| `last_change_at` | time (ISO 8601, UTC) or null | The last time a published value changed (the same as changed_at). Null before any. |
| `reading` | string | "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` | string or null | 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. |

### Stage (each of feed.stages)

One board: a round, heat or final.

| Field | Type | Meaning |
|---|---|---|
| `id` | string | Stable id: "s1", "s2" and so on. |
| `label` | string | The board's title, a name an operator gave it, or "Stage <n>". It can change. |
| `current` | boolean | True for the stage on the board now. At most one is current. |
| `columns` | array of string | The score columns as headed on the board, left to right, such as ["Game 1", "Game 2", "Score"] or ["Points"]. |
| `total_column` | string or null | The column to rank and chart by: the total if the board has one, otherwise the last column. |
| `max_total` | number or null | 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` | string or null | 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` | integer or null | 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` | time (ISO 8601, UTC) | When the stage was first seen. |
| `ended_at` | time (ISO 8601, UTC) or null | When the next stage replaced it. Null while it is current. |
| `last_frame_at` | time (ISO 8601, UTC) or null | The last picture of this stage from which something was read. Null if none yet. |
| `players` | array of FeedPlayer | By rank, then total (highest first), then name. Players are never removed: see on_board. |

### Player (each of stage.players)

One player in one stage.

| Field | Type | Meaning |
|---|---|---|
| `id` | string | Stable across stages: "p14" is the same person in every stage. |
| `name` | string | As read from the board, or the organiser's spelling when it matches their list. Treat it as untrusted text. |
| `rank` | integer or null | The rank printed on the board. Null if the board shows none. |
| `values` | object: column → number or null | Column heading → value, one entry per column. A cell never read is null. |
| `total` | number or null | This player's value in total_column, or null. |
| `percent` | number or null | 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` | boolean | 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` | time (ISO 8601, UTC) | The last picture in which the name was on the board. |
| `updated_at` | time (ISO 8601, UTC) or null | The last time this player's values changed. Null if never. |
| `flags` | array of string | "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 (/history.json)

GET /history.json: every published change, oldest first (or only those after ?after=).

| Field | Type | Meaning |
|---|---|---|
| `session` | SessionRef | The recording this body belongs to. A test session is a rehearsal, not the real event. |
| `generated_at` | time (ISO 8601, UTC) | When this response was made. |
| `stages` | array of HistoryStage | Every stage, or the one asked for with ?stage=. |

### History stage (each of history.stages)

One stage's changes.

| Field | Type | Meaning |
|---|---|---|
| `id` | string | As in the feed. |
| `label` | string | As in the feed. |
| `code` | string or null | As in the feed: the organisers' code for this round, or null. |
| `columns` | array of string | As in the feed. |
| `total_column` | string or null | As in the feed. |
| `max_total` | number or null | As in the feed: the maximum now, which every point's percent uses. |
| `started_at` | time (ISO 8601, UTC) | As in the feed. |
| `ended_at` | time (ISO 8601, UTC) or null | As in the feed. |
| `players` | array of HistoryPlayer | Everyone with at least one published value in the stage. |

### History player (each of stage.players)

One player's changes in one stage.

| Field | Type | Meaning |
|---|---|---|
| `id` | string | As in the feed. |
| `name` | string | As in the feed. |
| `points` | array of HistoryPoint | One per published change, oldest first. With ?after=, only the changes after that id. |

### Point (each of player.points)

A player's values from one moment until the next change.

| Field | Type | Meaning |
|---|---|---|
| `id` | integer | The change's id. Ids only go up: ask for ?after=<the largest id you hold> to get only later changes. |
| `at` | time (ISO 8601, UTC) | When the change was published. |
| `rank` | integer or null | The rank on the board at that moment, or null. |
| `values` | object: column → number or null | Column heading → value from that moment on. |
| `total` | number or null | The value in total_column from that moment on, or null. |
| `percent` | number or null | Percent complete from that moment on, as in the feed, or null. |

### Session (feed.session and history.session)

A session is one recording with its own address. The main session is the real event; a test session is a rehearsal.

| Field | Type | Meaning |
|---|---|---|
| `id` | string | Lower-case letters, digits and hyphens, such as "main" or "dry-run-2". |
| `name` | string | A name an operator gave it. |
| `kind` | string | "live" for a real recording, "test" for a rehearsal. Ignore test sessions unless you are testing. |

### Sessions (/sessions.json)

GET /sessions.json: the sessions that are not archived.

| Field | Type | Meaning |
|---|---|---|
| `main_session_id` | string | The session served at the root addresses (/feed.json and so on). |
| `sessions` | array of SessionListItem | Every session that is not archived. |

### Session in the list (each of sessions)

One session in /sessions.json.

| Field | Type | Meaning |
|---|---|---|
| `id` | string | As in SessionRef. |
| `name` | string | As in SessionRef. |
| `kind` | string | As in SessionRef. |
| `created_at` | time (ISO 8601, UTC) | When the session was made. |
| `feed_url` | string | The session's feed address: /s/<id>/feed.json. |
| `page_url` | string | The session's live page: /s/<id>. |

## A complete example

A feed with two stages: an earlier one that has ended, and the current one. Shortened to a few players each; a real stage can have 60 or more. Semi-final 1 has a maximum of 2,500, so each player in it has a percent, a round code (SF1) and a qualifying line after 2nd; Qualifying has neither code nor maximum. Anup Agarwal is no longer on the board in Semi-final 1, Benjamin Weber's total went down at his last change, Zhang Yunyi's value was set by an operator and the camera now reads something else, and one value in Qualifying was set by an operator.

`GET /feed.json`

```json
{
  "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": []
        }
      ]
    }
  ]
}
```

`GET /history.json?stage=s2`

```json
{
  "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
            }
          ]
        }
      ]
    }
  ]
}
```

Later, `GET /history.json?stage=s2&after=5010` answers only the changes after point 5010, in the same shape (and `304` when there are none and you sent the last etag).

`GET /sessions.json`

```json
{
  "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"
    }
  ]
}
```

`GET /history.csv?stage=s2` (first lines)

```csv
stage_id,stage,player_id,player,at,rank,column,value
s2,Semi-final 1,p14,Ha Dang,2026-12-03T19:19:40Z,1,Game 1,1041
s2,Semi-final 1,p14,Ha Dang,2026-12-03T19:19:40Z,1,Game 2,1030
s2,Semi-final 1,p14,Ha Dang,2026-12-03T19:19:40Z,1,Score,2071
```

## Polling politely

- Ask 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.
- Send the last etag in If-None-Match. An unchanged feed answers 304 with no body.
- Fetch /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.
- There 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.
- A venue's wifi can put many people behind one IP address. Serving many screens? Poll once on a server and pass the feed on.
- Pause 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).
- Judge 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.

Response headers on the data addresses (feed, history, CSV, sessions):

- `etag`, for `If-None-Match`. On /feed.json it is `"<session id>-<version>-<r>"`, where r is 0, 1 or 2 for `health.reading` ok, nothing_read or no_frames: so a 304 means the same session, the same scores and the same reading state, and a client holding another session's copy (after the main session is switched) never gets 304. On the others it is a hash of the content, for the full and the `after=` forms alike.
- `cache-control: public, max-age=3, s-maxage=5, stale-while-revalidate=30`.

## CORS

Every 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.

## Other formats

- OpenAPI 3.1: https://mewc.scorchsoft.tools/openapi.json
- Index for language models: https://mewc.scorchsoft.tools/llms.txt
- This guide as a web page: https://mewc.scorchsoft.tools/docs
