---
title: "Source"
method: GET
path: "/api/commentary/source"
tags: ["commentary"]
---

# Source

`GET /api/commentary/source`

## Request

- Base URL: `https://fojin.app` (the document declares no server; this is the origin it was published from)
- URL: `https://fojin.app/api/commentary/source`
- Auth: none declared

这段注文在解释哪一句 —— 正查的反方向。

为什么要有它：读注疏的人最难的是不知道眼前这段在牒哪一句经/论。正查按经文
行建索引，回答不了；而对齐数据本来两端都带行号，缺的只是反向索引。

定位不靠文本匹配，靠行号：注文片段在本卷正文里的字符位置 → `text_line_anchors`
的 CBETA 行标 → 包里锚在这几行上的对齐条目。包里只存了每条注的头 400 字，
拿它做匹配会漏掉大半部书。

## Query parameters

- `text_id` integer, required: 注疏在 fojin 的书 id
- `juan` integer, required
- `chunk_index` integer, nullable: 引文块序号；与 q 二选一
- `q` string, nullable: 注文原文片段
- `limit` integer

## Response `200`

Successful Response

- CommentarySource: 这段注文在解释哪一句 —— 正查（经文→各家注）的反方向。
  - `matched` boolean, required
  - `text_id` integer, required
  - `juan` integer, required
  - `chunk_index` integer, nullable
  - `work` string, nullable
  - `work_title` string, nullable
  - `tier` string, nullable
  - `line_from` string, nullable
  - `line_to` string, nullable
  - `base_work` string, nullable
  - `base_title` string, nullable
  - `passages` CommentarySourcePassage[]
    - `base_line` string, required
    - `base_text` string, nullable
    - `note` string, required
    - `anchor` string, required
    - `score` number, required
    - `urn` string, nullable
    - `reader_url` string, nullable
  - `total` integer
  - `truncated` boolean
  - `caveats` string[]

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/fojin/apis/fojin-api-buddhist-digital-text-platform.md) · [All operations](https://skmtc.dev/fojin/apis/fojin-api-buddhist-digital-text-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/fojin/apis/fojin-api-buddhist-digital-text-platform/revisions/969714238c61?raw)
