一言 API · 语录服务

基于静态语料库,提供随机或指定条目的 JSON / 纯文本 接口。

请求参数

参数说明可选值默认
type返回格式json, textjson
line指定行号(从 0 开始)整数随机
modetype=text 时生效zh(中文)
en(英文)
both(原始混合)
both

示例与交互

点击下方按钮可实时请求,或在新窗口查看返回结果。

1. JSON · 随机行

GET /api/quote?type=json
{
  "code": 200,
  "line": 5,
  "original": "生命的意义在于创造意义本身。",
  "zh": "生命的意义在于创造意义本身。",
  "en": "",
  "time": "2026-07-01T10:30:00Z"
}

2. JSON · 指定行号(第 11 条)

GET /api/quote?type=json&line=10
{
  "code": 200,
  "line": 10,
  "original": "人是唯一会脸红的动物,也是唯一需要脸红的动物。 Man is the only animal that blushes. Or needs to.",
  "zh": "人是唯一会脸红的动物,也是唯一需要脸红的动物。",
  "en": "Man is the only animal that blushes. Or needs to.",
  "time": "2026-07-01T10:30:00Z"
}

3. 纯文本 · 随机行 · 仅中文

GET /api/quote?type=text&mode=zh
真正的勇气是知道生活的真相后依然热爱生活。

4. 纯文本 · 随机行 · 仅英文

GET /api/quote?type=text&mode=en
No man is an island, entire of itself.

5. 纯文本 · 随机行 · 原始混合

GET /api/quote?type=text&mode=both
人对人是狼。 Homo homini lupus.

6. 纯文本 · 指定行(第 11 条)· 仅中文

GET /api/quote?type=text&line=10&mode=zh
人是唯一会脸红的动物,也是唯一需要脸红的动物。

7. 纯文本 · 指定行(第 11 条)· 仅英文

GET /api/quote?type=text&line=10&mode=en
Man is the only animal that blushes. Or needs to.

8. 纯文本 · 指定行(第 11 条)· 原始混合

GET /api/quote?type=text&line=10&mode=both
人是唯一会脸红的动物,也是唯一需要脸红的动物。 Man is the only animal that blushes. Or needs to.