指定日期历史
查询指定日期历史上发生的重大事件
GET
https://api.tinyaii.cn/v1/history/date
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| month | int | 可选 | 月份(1-12),默认当月 | 5 |
| day | int | 可选 | 日期(1-31),默认当日 | 15 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
| 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/date?month=5&day=15" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://api.tinyaii.cn/v1/history/date?month=5&day=15", {
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
console.log(await res.json());import requests
resp = requests.get(
"https://api.tinyaii.cn/v1/history/date",
params={"month": "5", "day": "15"},
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=10,
)
print(resp.json())把 YOUR_API_KEY 换成你的密钥即可直接运行。密钥只保存在你自己的设备上。