← 每天一个高质量 API · 系列目录

每天一个高质量 API · Day 18:Open Trivia 结构化题库(free-games-trivia)

Day 18 · 2026-10-27 · 搜蚁智选 AIMALL
系列「每天一个高质量 API」第 18 篇。搜蚁智选(souyi.net.cn)是一个面向 AI Agent 的 API 发现与统一调用平台。今天聊 Open Trivia 结构化题库(free-games-trivia)。

现成的多选题:题干 + 正确答案 + 干扰项,还带分类与难度,直接拿来做评测集。

这个 API 能做什么

/api.php?amount=1 返回一道随机题:type(multiple 多选 / boolean 判断)、difficulty(easy / medium / hard)、category、question、correct_answer、incorrect_answers[]。题库 4000+ 题、24 个分类。

为什么 AI Agent 需要它

怎么用

方式一:直连上游(免费、无需 Key)

curl "https://opentdb.com/api.php?amount=1"

方式二:经搜蚁智选一键调用(带 Key,统一计费 / 限流 / 可观测)

curl -X POST https://souyi.net.cn/api/v1/ai/request \
  -H "X-API-Key: YOUR_AIMALL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"asset_id":"free-games-trivia","call_data":{}}'
这些免费 API 的上游本身免密;经搜蚁智选代理后,多个数据源可以聚合到同一个 Agent 工作流里,统一走 X-API-Key + 统一计费、限流与可观测,省去每个上游单独接一遍。

返回示例

{
  "response_code": 0,
  "results": [
    {
      "type": "multiple",
      "difficulty": "easy",
      "category": "Entertainment: Books",
      "question": "How many Harry Potter books are there?",
      "correct_answer": "7",
      "incorrect_answers": ["8", "5", "6"]
    }
  ]
}

价格

免费。上游限速 1 次 / 5 秒;response_code=0 表示成功,1 表示题目不足,2 表示参数非法。

怎么拿到 Key

注册 souyi.net.cn → 控制台一键生成 X-API-Key → 即可调用平台全部 API(含本系列 22 个)。

小结

做 Agent 评测最费时间的往往不是模型,而是出题。Open Trivia 把「题干 + 金标 + 干扰项」一次性给全,拿来就能跑。

更多免费 API 见 系列目录。

在搜蚁智选上调用这个 API →