历史上的今天

history-todayPOST
POSThttps://v1.apizero.cn/api/history-today

概述

查询某一天历史上发生过的大事,也可以按关键词搜索,或用事件 id 看正文。 不传月份和日期时,按北京时间的今天返回。需要 API Key。不登录不能调用。登录后每天 1 万次。黄金会员每天 4 万次,钻石会员每天 9 万次,企业会员每天 86 万次。

调用约定

  • 网关 · https://v1.apizero.cn
  • 鉴权 · Authorization: Bearer <API Key>
  • 回包 · JSON {code, msg, data}。成功看 code === 0,不要只看 HTTP 200。
/aidocs/history-today/raw.md
打开 Markdown

鉴权

需要 API Key(Authorization: Bearer <key>,或请求头 X-Api-Key)。不登录不能调用。登录后每天 1 万次。黄金会员每天 4 万次,钻石会员每天 9 万次,企业会员每天 86 万次。list 不传 month、day 时按北京时间当天查询。

获取 API Key

请求头

Authorizationstring必填

必填鉴权。推荐:Bearer <API Key>。兼容请求头 X-API-Key,以及 Query api_key / apikey / key(key 仅当值为 sk_live_/sk_test_/sk_stag_ 形态时生效)。付费接口需携带有效 Key。

Content-Typestring选填

JSON 请求体。Query 传参同样可用

请求参数

POST · APPLICATION/JSON

action(操作)string选填

list 查某一天的大事(默认);detail 查单条正文,需传 id;search 按关键词搜索,需传 word

例list

monthint选填

月份 1–12,仅 list 使用。不传则为北京时间当月

例10

dayint选填

日期 1–31,仅 list 使用。不传则为北京时间当天。2 月 29 日可以查

例14

idstring选填

事件 id,action=detail 时必填。取 list 或 search 结果里的 id

例3880d80653ba11eb90470c42a1415493

wordstring选填

搜索词,1–40 个字,action=search 时必填

例证券交易所

page(页码)int选填

页码,仅 search 使用,默认 1

例1

{
  "action": "list",
  "month": 10,
  "day": 14,
  "id": "3880d80653ba11eb90470c42a1415493",
  "word": "证券交易所",
  "page": 1
}

返回结果

顶层固定为 code / msg / data。下表一般是 data 内字段。 code · msg · data · tips · request_id

actionstring

本次操作:list / detail / search

monthnumber

查询月份。仅 list

daynumber

查询日期。仅 list

wordstring

搜索词。仅 search

pagenumber

页码。仅 search

countnumber

本页条数。list 与 search

itemsarray

事件列表。list 与 search

idstring

事件 id,传给 detail

titlestring

标题

yearstring

年份

monthstring

月份

daystring

日期

datestring

完整日期,如 1990年11月26日

descstring

摘要

idstring

事件 id。仅 detail

titlestring

标题。仅 detail

yearstring

年份。仅 detail

contentstring

正文。仅 detail

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

返回示例

{
  "code": 0,
  "msg": "成功",
  "data": {
    "action": "list",
    "month": 11,
    "day": 26,
    "count": 1,
    "items": [
      {
        "id": "3880d80653ba11eb90470c42a1415493",
        "title": "上海证券交易所开业",
        "year": "1990",
        "month": "11",
        "day": "26",
        "date": "1990年11月26日",
        "desc": "上海证券交易所正式开业。"
      }
    ]
  },
  "tips": "极数本源 · https://apizero.cn"
}

请求示例

示例都是服务端写法。Python / JavaScript 各有常规写法和官方库。

curl -sS -X POST "https://v1.apizero.cn/api/history-today" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "list",
  "month": "10",
  "day": "14",
  "id": "3880d80653ba11eb90470c42a1415493",
  "word": "证券交易所",
  "page": "1"
}'

错误码

先看业务 code。HTTP 也可能不是 200。

0200

成功

4000400

参数错误

4011401

API Key 无效

4013403

API Key 已暂停

4014403

当前 IP 不在 Key 白名单

4015401

此接口需要 API Key

4022402

余额不足

4029429

调用过快(QPS)

4030429

今日免费额度已用完

4040503

接口已下线

4041404

接口不存在

5000500

服务器内部错误

5020502

上游暂时不可用

5021502

上游返回格式异常

5030502

暂无可用节点

调用限制

计费模式
VIP
QPS 限制
QPS 3
登录免费额度
10000 次(已认证)
匿名每日额度
无
黄金会员
每天 40,000 次 · QPS 10
钻石会员
每天 90,000 次 · QPS 30
企业会员
每天 860,000 次 · QPS 120

购买套餐、看评价请走商城详情。 购买 / 调试

更新日志

  • 1.0.02026-10-14

    上架历史上的今天:按日期查大事、按 id 看正文、按关键词搜索

免责声明

事件内容供回顾和素材使用,具体史实请以公开史料为准。