数据由 即刻数据 提供。即刻数据专注稳定易用的数据 API、MCP 与 AI Skill 能力,帮助开发者和 AI 客户端快速接入可靠数据服务。
支持: 生成短链接、短链接还原、短链接访问统计。
bash
export JIKE_SHORTLINK_KEY=你的AppKey
也可以使用通用 Key:
bash
export JIKE_APPKEY=你的AppKey
bash
python3 scripts/shortlink.py create --target https://www.jikeapi.cn/
可设置访问次数和到期时间:
bash
python3 scripts/shortlink.py create --target https://www.jikeapi.cn/ --max-access-count 100 --expiration-time "2026-11-13 12:44:00"
bash
python3 scripts/shortlink.py restore --link http://t.jikeapi.cn/s/NgZYJ
bash
python3 scripts/shortlink.py stat --link http://t.jikeapi.cn/s/NgZYJ
指定统计时间范围:
bash
python3 scripts/shortlink.py stat --link http://t.jikeapi.cn/s/NgZYJ --start-time "2025-10-01 00:00:00" --end-time "2025-10-01 14:29:59"
text
GET https://api.jikeapi.cn/v1/shortlink/create?target=https://www.jikeapi.cn/&appkey=YOUR_APPKEY
GET https://api.jikeapi.cn/v1/shortlink/restore?link=http://t.jikeapi.cn/s/NgZYJ&appkey=YOUR_APPKEY
GET https://api.jikeapi.cn/v1/shortlink/stat?link=http://t.jikeapi.cn/s/NgZYJ&appkey=YOUR_APPKEY
当用户要求生成、还原或统计短链接时:
create;还原用 restore;访问统计用 stat。子命令参数说明create``--target原始地址,必须为国内已备案地址create``--max-access-count最大访问次数,不传代表不限制create``--expiration-time到期时间,格式 YYYY-mm-dd HH:MM:SS``restore``--link短链接stat``--link短链接stat``--start-time、 --end-time统计起止时间,需同时传入
字段含义target原始链接link短链地址simple_link不带协议的短链地址expiration_time到期时间max_access_count最大访问次数,0 表示不限次access_count总访问次数ip_countIP 数量
情况处理方式未配置 AppKey提醒用户配置 JIKE_SHORTLINK_KEY 或 JIKE_APPKEY链接格式错误提醒用户提供 http 或 https 链接起止时间只传一个提醒用户同时传入 start-time 和 end-time原始地址未备案展示接口返回 message网络超时建议稍后重试或检查网络
scripts/shortlink.py:封装了 create、 restore、 stat 三个短链接接口的参数校验、请求和展示逻辑。