历史上的今天
查询历史上今天发生的重大事件,包括古代/近代/现代
GET
https://api.tinyaii.cn/v1/history/today
请求参数
该接口无需请求参数,直接调用即可返回数据。
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
| date | string | 日期 |
| month | number | 月份 |
| day | number | 日期 |
| total | number | 事件总数 |
| list | array | 事件列表 |
| list[].year | number | 年份 |
| list[].date | string | 年份文本 |
| list[].description | string | 事件描述 |
| list[].category | string | 分类(古代/近代/现代) |
返回示例
{
"code": 200,
"message": "success",
"data": {
"date": "5月15日",
"month": 5,
"day": 15,
"total": 71,
"list": [
{
"year": 1247,
"date": "1247年",
"description": "太极宗师张三丰出生",
"category": "古代"
},
{
"year": 1904,
"date": "1904年",
"description": "中国红十字会创立",
"category": "近代"
}
]
}
}
调用示例
curl "https://api.tinyaii.cn/v1/history/today" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://api.tinyaii.cn/v1/history/today", {
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
console.log(await res.json());import requests
resp = requests.get(
"https://api.tinyaii.cn/v1/history/today",
params=None,
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=10,
)
print(resp.json())把 YOUR_API_KEY 换成你的密钥即可直接运行。密钥只保存在你自己的设备上。