Source: https://seerepo.com/docs/api-docs
Markdown source: https://seerepo.com/docs/api-docs.md
Description: The repo's wiki, written by SeeRepo from what it read: its tree, and each page with its sources.

# Get the documentation

`GET https://seerepo.com/api/v1/repos/:repo/docs` and `GET https://seerepo.com/api/v1/repos/:repo/docs/:page`

Returns the Documentation folder as it reads in the app. The first gives the wiki's tree: each page's key, title and level, and the commit recorded by the documentation scan. The second gives one page: its markdown, where each claim ends with the file and lines it comes from, the outline of its sections, its sources with the part of the map that holds each file and its link to GitHub at the commit that wrote the page, and the diagram SeeRepo drew from the map. Every page is written first from what SeeRepo read, without AI; the prose of a page with a plan comes later and replaces its opening.

## Request

| Parameter | Where | Description |
|---|---|---|
| `repo` | path | The repo's id, or owner/name with %2F. |
| `page` | path | A page's key from the tree: `1` is the project, `2` a world, `2.3` a world inside it. |

```sh
curl "https://seerepo.com/api/v1/repos/6ad79fd8e89233277ded17c9/docs/2" \
  -H "Authorization: Bearer $SEEREPO_KEY"
```

## Response

The tree:

| Field | Type | Description |
|---|---|---|
| `data.repo` | object | The repo: its id and its name. |
| `data.sha` | string\|null | The commit recorded by the documentation scan. Null until its first writing. |
| `data.at` | string\|null | When it was last written. |
| `data.pages[]` | object | Each page in order: its `key`, `title`, `level` (1 or 2), `parent`, `factsAt` (when what it says last changed, null if that was before SeeRepo kept this), `locked` (true for the pages a free repo opens with a plan) and `phrase` (what its module does, in the map's sentence; null for the project, the glossary and a locked page). |

A page:

| Field | Type | Description |
|---|---|---|
| `data.key`, `data.title`, `data.level`, `data.parent` | | Where the page is in the tree. |
| `data.world` | string\|null | The world of the map it tells. Null for the project and the glossary. |
| `data.body` | string | The page in markdown. Each claim ends with `[path from-to]`. |
| `data.outline[]` | object | Each section's `id`, `level` and `title`, in order. |
| `data.sources[]` | object | Each file the page cites: its `path`, `from`, `to`, its `url` on GitHub at the commit that wrote the page, and its `part` in the map (`world` and `id`), or null. |
| `data.diagram` | string\|null | The page's diagram in Mermaid, drawn by SeeRepo from the map's connections. |
| `data.lang` | string | The chapter's recorded language. |
| `data.by` | string | `facts` while the page is written from what SeeRepo read alone; else the model that wrote its prose. |
| `data.sha`, `data.at` | | The chapter's source commit and document writing time (not the commit date). Unchanged chapters can retain an earlier version. |
| `data.changes[]` | object | What the page's shape gained and lost each time what it says changed, newest first, ten at most. Each one: `at`, `sha` (the commit of that reading), `parts` (`added`, each with its `name` and its `part` in the map, or null; `removed`, the names), `connections` (`added` and `removed`, as numbers), and `pages`, `data`, `services` and `modules` (`added` and `removed`, the names). A list of names holds five at most, with the rest counted in `addedMore` and `removedMore`. `touched` is true when what it says changed and its shape didn't. Empty until that happens after SeeRepo started keeping it, and on a free repo. |

### Example

```json
{
  "status": "success",
  "data": {
    "key": "2",
    "title": "Billing",
    "level": 1,
    "parent": null,
    "world": "/billing",
    "body": "# Billing\n\nCharges people [app/api/pay/route.ts 1-25]. It has 3 parts; open to anyone through `/pricing` [app/pricing/page.tsx 3-3].\n\n## Its parts\n- **/pricing** — Shows the plans [app/pricing/page.tsx 1-40]\n",
    "outline": [{ "id": "parts", "level": 2, "title": "Its parts" }],
    "sources": [{ "path": "app/pricing/page.tsx", "from": 1, "to": 40, "url": "https://github.com/acme/shop/blob/abc1234/app/pricing/page.tsx#L1-L40", "part": { "world": "/billing", "id": "app/pricing/page.tsx" } }],
    "diagram": "flowchart LR\n  n0([\"Visitors\"])\n  n1[\"/pricing\"]\n  n0 -->|enters| n1",
    "lang": "en",
    "by": "facts",
    "sha": "abc1234",
    "at": "2026-10-22T05:40:39.836Z",
    "changes": [{ "at": "2026-10-22T05:40:39.836Z", "sha": "abc1234", "parts": { "added": [{ "name": "/pricing", "part": { "world": "/billing", "id": "app/pricing/page.tsx" } }], "addedMore": 0, "removed": [], "removedMore": 0 }, "connections": { "added": 1, "removed": 0 }, "pages": { "added": ["/pricing"], "addedMore": 0, "removed": [], "removedMore": 0 }, "data": { "added": [], "addedMore": 0, "removed": [], "removedMore": 0 }, "services": { "added": [], "addedMore": 0, "removed": [], "removedMore": 0 }, "modules": { "added": [], "addedMore": 0, "removed": [], "removedMore": 0 }, "touched": false }]
  }
}
```

A free repo gets the whole tree and the project's page; any other page is a `not_found`, as in the app.

## Authentication

An API key as `Authorization: Bearer sr_…`. See [Authentication](/docs/api#authentication).
