# Get leaderboard

```http
GET /api/public/v1/competitions/lean-kernel-challenge/leaderboard
```

**Scope**: none. No authentication is required.

Returns the currently published frozen leaderboard snapshot. The public response contains one `ranked` array per Problem; it does not expose an intermediate `cohorts` array.

## Query parameters

| Parameter | Type, requirement, and meaning |
| :--- | :--- |
| `problem` | **Optional for `official`; required for performance views.** Exact Problem ID. When omitted from the official view, all available Problems can be returned. |
| `rankBy` | **Optional string.** `official` (default), `instructions`, or `peak_memory`. Supply it at most once. |
| `fullyQualified` | **Optional official-view filter.** `1`, `true`, or `yes` keeps entries that completed every planned Case. It is ignored and reported as false for both performance views. |

## Response fields

| Field | Type and meaning |
| :--- | :--- |
| `problems` | Record keyed by Problem ID. |
| `problems[problem].ranked` | Array of [`LeaderboardEntry`](#leaderboard-entry) objects in authoritative server order. |
| `problems[problem].missingPeakMemoryCount` | Optional non-negative integer. Present for `peak_memory`; counts visible entries without a recorded peak measurement. |
| `meta.configuredUpdateTimeUtc` | Configured UTC update time, such as `10:30`. |
| `meta.boardType` | Optional board type, currently `temporary` or `final`. |
| `meta.contractVersion` | Optional frozen competition contract version. |
| `meta.excludedCount` | Number of entries excluded from the published snapshot. |
| `meta.unresolvedCount` | Number of unresolved entries. |
| `meta.editionStatus` | Optional snapshot-edition status. |
| `meta.rankBy` | Effective ranking view. |
| `meta.published` | Whether public leaderboard publication is enabled. |
| `meta.publishedAt` | Publication timestamp or `null`. |
| `meta.batchId` | Optional completed evaluation day. |
| `meta.dataCutoffAt` | Optional submission boundary for that snapshot. |
| `meta.fullyQualified` | `true` only when the official-view filter was applied; otherwise omitted. |

When publication is disabled, `problems` is empty and `meta.published` is false. Snapshot-specific optional metadata can be absent until a completed snapshot exists.

### Leaderboard entry

| Field | Type and meaning |
| :--- | :--- |
| `rank` | Positive integer; preserve the server's competition rank and row order. |
| `submissionId` | Decimal string identifying the evaluated submission. It does not grant source access. |
| `entrantKind` | `"team"` or `"individual"`. |
| `teamId` | Team ID or `null` for an individual. |
| `teamNumber` | Current public Team Number or `null`. |
| `teamName` | Current public display label for the entrant. |
| `teamDetails` | Public shared team-member projection or `null`. |
| `individual` | Public individual projection, or `null` for a team. |
| `points` | Problem points. |
| `groupPoints` | Integer array in official comparison order. |
| `caseProfile` | Integer array in official comparison order. |
| `coverage.completed` | Successfully completed Cases. |
| `coverage.planned` | Planned Cases. |
| `rankingWork` | Decimal integer string used by official comparison. |
| `correctnessWork` | Decimal integer string for correctness replay work. |
| `curveWork` | Decimal integer string for target-Case replay work. |
| `totalWork` | Decimal integer string combining recorded work. |
| `peakMemoryBytes` | Optional positive integer; worst recorded replay peak RSS in bytes. |

Keep work counts as strings or arbitrary-precision integers. Missing measurements are not zero.

For an individual, `individual` has `publicId`, `name`, and `avatarUrl`. For a team, `teamDetails.members` contains only fields the team currently permits the leaderboard to expose; do not infer omitted names, avatars, or email addresses.

## Example request

```bash
curl \
  "https://api.sair.foundation/api/public/v1/competitions/lean-kernel-challenge/leaderboard?problem=fib&fullyQualified=1&rankBy=official"
```

## Example response

```json
{
  "ok": true,
  "data": {
    "problems": {
      "fib": {
        "ranked": [
          {
            "rank": 1,
            "submissionId": "7",
            "entrantKind": "team",
            "teamId": "teamv2_example",
            "teamNumber": "LKC01-T00003",
            "teamName": "Kernel Explorers",
            "teamDetails": {
              "members": [
                {
                  "name": "Public Member",
                  "email": "member@example.com"
                }
              ]
            },
            "individual": null,
            "points": 100,
            "groupPoints": [45, 25, 15, 10, 5],
            "caseProfile": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
            "coverage": {
              "completed": 10,
              "planned": 10
            },
            "rankingWork": "83040617477",
            "correctnessWork": "260614258",
            "curveWork": "83040617477",
            "totalWork": "83301231735",
            "peakMemoryBytes": 3233177600
          }
        ]
      }
    },
    "meta": {
      "configuredUpdateTimeUtc": "10:30",
      "boardType": "temporary",
      "contractVersion": "7a0abb4a80d635740a91aed1894f714dfbb82edd",
      "excludedCount": 0,
      "unresolvedCount": 0,
      "editionStatus": "ready",
      "rankBy": "official",
      "published": true,
      "publishedAt": "2026-08-30T04:00:00Z",
      "batchId": "2026-09-01",
      "dataCutoffAt": "2026-09-01T01:00:00Z",
      "fullyQualified": true
    }
  }
}
```

## Ranking and caching

`official` preserves the frozen official policy. `instructions` and `peak_memory` are separate performance views supplied by the server; they require one Problem and do not redefine official placement. Peak-memory responses retain the complete ranked array and report missing measurements separately.

Successful responses use `Content-Type: application/json` and `Cache-Control: no-store`. Eligibility and public identity projections are checked again when the response is built.

Use [Get leaderboard entry](./get-leaderboard-entry.md) to read the per-group, per-Case, and per-replay measurements for one row.

## Errors

| HTTP | Code | When |
| :---: | :--- | :--- |
| `400` | `INVALID_REQUEST` | `rankBy` is invalid or repeated, or a performance view omits `problem`. |
| `404` | `DISCOVERY_NOT_LAUNCHED` | Public discovery is not open. |
| `404` | `NOT_FOUND` | The Competition is unavailable. |
| `502` | `PLATFORM_UNAVAILABLE` | Publication, eligibility, or public identity cannot be read. |
| `503` | `SERVICE_UNAVAILABLE` | The evaluation service is unavailable or returns an invalid snapshot. |

See [Errors](../../../errors.md) for the standard error envelope.
