使用指南

历史上的今天

所属分类:生活工具
接口状态:正常
调用次数:0次
收费类型: 免费(每日上限10000次)
密匙要求:

接口简介

获取当前日期在历史上的重要事件,包括生日、逝世、重大事件等。

接口信息

请求方式: GET

接口地址:

https://api.dlck.cn/api/today.php

请求参数说明

参数名 参数类型 是否必填 参数说明
encoding String 输出格式(json/text/markdown,默认json)
api_key 字符串 需要密匙的必填项,无需密匙则不必填

调用测试

请求参数:

响应结果:

等待测试...

响应示例

成功响应(200):

{ "code": 200, "msg": "成功", "data": { "date": "12-13", "month": 12, "day": 13, "month_name": "十二月", "items": [ { "title": "南京大屠杀死难者国家公祭日", "year": "1937", "description": "1937年12月13日,侵华日军攻占南京,开始长达6周的南京大屠杀...", "event_type": "event", "link": "https:\/\/baike.baidu.com\/item\/南京大屠杀" }, { "title": "哥白尼诞生", "year": "1473", "description": "尼古拉·哥白尼,波兰天文学家,日心说创立者...", "event_type": "birth", "link": "https:\/\/baike.baidu.com\/item\/哥白尼" } ], "metadata": { "source": "百度百科", "total_items": 15, "date": "2023-12-13", "api_url": "https:\/\/baike.baidu.com\/cms\/home\/eventsOnHistory\/", "cache_status": "fresh", "updated_at": "2023-12-13 10:30:00" } } }

使用示例

获取今日历史事件(默认JSON格式) https://api.dlck.cn/api/today.php 获取今日历史事件(文本格式) https://api.dlck.cn/api/today.php?encoding=text 获取今日历史事件(Markdown格式) https://api.dlck.cn/api/today.php?encoding=markdown