# List shared packages

```http
GET /api/public/v1/contributor-network/items
```

**Scope**: `contributor-network.read`.

Lists active Lean Kernel Challenge packages in the Contributor Network. Send both discriminator filters so every returned item has the package summary shape documented here.

Withdrawn, hidden, deleted, or force-revoked items are not returned. The collection omits the complete Workspace; [get one package](./get-contributor-package.md) when its immutable source is needed.

## Query parameters

| Parameter | Type, requirement, default, and meaning |
| :--- | :--- |
| `competitionId` | **Required string.** Use `lean-kernel-challenge`. |
| `kind` | **Required string.** Use `lean-kernel-package`. |
| `problemId` | **Optional string.** Exact, case-sensitive Problem ID. |
| `search` | **Optional string.** Case-insensitive substring matched against the package title and public author display name. |
| `publicCode` | **Optional string.** Exact, case-sensitive public-code filter. |
| `sort` | **Optional string.** `newest` (default) or `earliest`. |
| `cursor` | **Optional string.** Opaque cursor from the preceding `nextCursor`. |
| `limit` | **Optional integer.** Page size from `1` through `100`; defaults to `25`. |

`search` does not inspect remarks, Workspace paths or source text. When `publicCode` is present, the response contains at most one item and `nextCursor` is `null`.

## Example request

```bash
export SAIR_API_BASE="https://api.sair.foundation/api/public/v1"

curl \
  "$SAIR_API_BASE/contributor-network/items?competitionId=lean-kernel-challenge&kind=lean-kernel-package&problemId=fib&limit=25" \
  -H "Authorization: Bearer $SAIR_API_KEY"
```

## Response fields

| Field | Type | Description |
| :--- | :--- | :--- |
| `items` | [`ContributorLeanKernelPackageSummary[]`](#summary-fields) | Package summaries. |
| `nextCursor` | `string \| null` | Cursor for the next page, or `null` after the final page. |

### Summary fields

| Field | Type | Description |
| :--- | :--- | :--- |
| `id` | string | Stable Contributor Network item ID. |
| `publicCode` | string | Immutable public sharing code. |
| `competitionId` | string | `lean-kernel-challenge`. |
| `kind` | string | `lean-kernel-package`. |
| `title` | string | Solution name snapshotted for publication. |
| `remark` | `string \| null` | Optional publication note. |
| `author.sairId` | string | Public SAIR account ID. |
| `author.displayName` | string | Public author display name. |
| `track` | null | Present for the generic Contributor Network contract; always `null` for this kind. |
| `modelId` | null | Present for the generic Contributor Network contract; always `null` for this kind. |
| `problemId` | string | Problem bound to the package. |
| `approvedRevision` | string | Problem workspace revision. |
| `solutionRevision` | integer | Exact private Solution revision published. |
| `executionSnapshotId` | `string \| null` | Immutable Playground snapshot identifier when recorded. |
| `templateVersion` | string | Development-template version. |
| `toolchainVersion` | string | Lean toolchain version. |
| `manifestVersion` | string | Canonical Workspace-manifest version. |
| `workspaceSha256` | string | SHA-256 of the canonical Workspace manifest. |
| `workspaceSizeBytes` | integer | Total UTF-8 source bytes. |
| `packageFilename` | string | Server-selected download filename. |
| `packageFileCount` | integer | Number of files in the package snapshot. |
| `packageSizeBytes` | integer | Download representation byte length. |
| `packageSha256` | string | SHA-256 of the exact download bytes. |
| `downloadUrl` | string | API-origin-relative package download URL. |
| `artifactExcerpt` | `string \| null` | Short source excerpt generated for collection display. |
| `favoriteCount` | integer | Current favorite count. |
| `viewerHasFavorited` | boolean | Whether the calling account favorited this item. |
| `publishedAt` | string | ISO 8601 UTC publication time. |

The response does not currently include avatar, comment-count, or child-count fields.

## Example response

```json
{
  "ok": true,
  "data": {
    "items": [
      {
        "id": "cn_8fc20f8a7a3c4bd99506b5d51a6c905e",
        "publicCode": "LKC01-000017",
        "competitionId": "lean-kernel-challenge",
        "kind": "lean-kernel-package",
        "title": "baseline",
        "remark": "Reusable Fibonacci proof package.",
        "author": {
          "sairId": "U-9f7e1c00",
          "displayName": "alice"
        },
        "track": null,
        "modelId": null,
        "problemId": "fib",
        "approvedRevision": "7a0abb4a80d635740a91aed1894f714dfbb82edd",
        "solutionRevision": 2,
        "executionSnapshotId": "snapshot-17",
        "templateVersion": "7a0abb4a80d635740a91aed1894f714dfbb82edd",
        "toolchainVersion": "leanprover/lean4:v4.33.1",
        "manifestVersion": "lean-kernel-user-workspace-v1",
        "workspaceSha256": "7d5307e5c809eeb01a95cf0ca6da2d452b5f94bd78e2a2fbc0ea706210e58ea8",
        "workspaceSizeBytes": 241,
        "packageFilename": "baseline.zip",
        "packageFileCount": 2,
        "packageSizeBytes": 432,
        "packageSha256": "5c376eac90aa2d027dddadbd707cfdf105095926336953ae30aecba377b1ef06",
        "downloadUrl": "/api/public/v1/contributor-network/items/cn_8fc20f8a7a3c4bd99506b5d51a6c905e/download",
        "artifactExcerpt": "import Spec\nimport Submission.Helpers…",
        "favoriteCount": 4,
        "viewerHasFavorited": false,
        "publishedAt": "2026-08-31T09:00:00Z"
      }
    ],
    "nextCursor": null
  }
}
```

An empty match returns `items: []` and `nextCursor: null` with `200 OK`. Successful responses use `Content-Type: application/json`.

## Errors

| HTTP | Code | When |
| :---: | :--- | :--- |
| `400` | `MALFORMED_BODY` | `cursor` is invalid or `limit` is outside its allowed range. |
| `422` | `RESOURCE_FIELD_INVALID` | `kind`, `track`, `sort`, or a non-null `problemId` is invalid. |

See [Errors](../../../errors.md) for authentication, scope, and rate-limit errors.
