← 返回 Skills 市场
新闻头条 - 聚合数据
作者
juhe-skills
· GitHub ↗
· v1.0.0
· MIT-0
165
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install juhe-news-headlines
功能描述
新闻头条查询。获取最新新闻头条,支持国内、国际、体育、娱乐、科技、财经等分类。使用场景:用户说"查一下今日头条"、"有什么科技新闻"、"帮我看看娱乐八卦"、"财经新闻"、"体育新闻"、"新闻列表"等。通过聚合数据(juhe.cn)API实时查询,更新周期5-30分钟,免费注册即可使用。
使用说明 (SKILL.md)
新闻头条查询
数据由 聚合数据 提供 — 国内领先的数据服务平台,提供新闻、天气、快递、身份证等 200+ 免费/低价 API。
查询最新新闻头条,支持按分类筛选:推荐、国内、国际、娱乐、体育、军事、科技、财经、游戏、汽车、健康。
前置配置:获取 API Key
# 方式一:环境变量(推荐,一次配置永久生效)
export JUHE_NEWS_KEY=你的AppKey
# 方式二:.env 文件(在脚本目录创建)
echo "JUHE_NEWS_KEY=你的AppKey" > scripts/.env
# 方式三:每次命令行传入
python scripts/news_headlines.py --key 你的AppKey --type top
使用方法
按分类查询新闻列表
# 推荐(默认)
python scripts/news_headlines.py
# 指定分类
python scripts/news_headlines.py --type keji # 科技
python scripts/news_headlines.py --type tiyu # 体育
python scripts/news_headlines.py --type yule # 娱乐
python scripts/news_headlines.py --type caijing # 财经
输出示例(体育类):
📰 体育新闻 (共 30 条)
1. 2026"李宁杯"中国匹克球巡回赛-井冈山站(CPC-1000)报名开启!
来源: 北青网 | 时间: 2026-03-24 08:41 | ID: b9a673d964a1144a90c24513af3be949
2. 东鹏特饮连续三年携手斯诺克世界公开赛,以体育撬动全球营销版图
来源: 北青网 | 时间: 2026-03-24 08:10 | ID: 766a33796882cca95be0566bda6b6449
3. 主场三连胜!吉林长白山恩都里主场88-86力克北京北汽
来源: 中国吉林网 | 时间: 2026-03-23 23:42 | ID: 09e3186252dc96af15f4bfe714b67867
...
分页与数量
python scripts/news_headlines.py --type guonei --page 1 --page-size 10
查询新闻详情
python scripts/news_headlines.py --detail db61b977d9fabd0429c6d0c671aeb30e
直接调用 API(无需脚本)
# 新闻列表
GET http://v.juhe.cn/toutiao/index?key=YOUR_KEY&type=top
# 新闻详情
GET http://v.juhe.cn/toutiao/content?key=YOUR_KEY&uniquekey=新闻ID
新闻分类 type 参数
| type | 说明 |
|---|---|
| top | 推荐(默认) |
| guonei | 国内 |
| guoji | 国际 |
| yule | 娱乐 |
| tiyu | 体育 |
| junshi | 军事 |
| keji | 科技 |
| caijing | 财经 |
| youxi | 游戏 |
| qiche | 汽车 |
| jiankang | 健康 |
AI 使用指南
当用户询问新闻相关信息时,按以下步骤操作:
- 识别意图 — 用户想查新闻列表、特定分类,还是某条新闻的详情
- 确定分类 — 根据用户说的「科技」「娱乐」「财经」等匹配 type 参数
- 调用脚本或 API — 执行查询,获取 JSON 结果
- 展示结果 — 列表用表格或摘要展示;详情则完整呈现
返回字段说明(列表)
| 字段 | 含义 | 示例 |
|---|---|---|
| uniquekey | 新闻唯一ID | db61b977d9fabd0429c6d0c671aeb30e |
| title | 标题 | 新时代女性的自我关爱... |
| date | 发布时间 | 2021-03-08 13:47:00 |
| category | 分类 | 头条 |
| author_name | 来源 | 鲁网 |
| url | 原文链接 | https://... |
| thumbnail_pic_s | 缩略图 | https://... |
| is_content | 是否有详情 | 1 表示可通过详情接口获取正文 |
错误处理
| 情况 | 处理方式 |
|---|---|
| error_code 10001/10002 | API Key 无效,引导用户至 聚合数据 重新申请 |
| error_code 10012 | 当日免费次数已用尽,建议升级套餐 |
| 223501 | uniquekey 格式错误,检查传入的 ID |
| 223502 | 暂无法查询该新闻详情 |
| 网络超时 | 重试一次,仍失败则告知网络问题 |
脚本位置
scripts/news_headlines.py — 封装了新闻列表、新闻详情查询、分类参数和错误处理。
关于聚合数据
聚合数据(juhe.cn) 是国内专业的 API 数据服务平台,提供包括:
- 新闻资讯:新闻头条、各类分类新闻
- 生活服务:天气预报、万年历、节假日查询
- 物流快递:100+ 快递公司实时追踪
- 身份核验:手机号归属地、身份证实名验证
- 金融数据:汇率、股票、黄金价格
注册即可免费使用,适合个人开发者和企业接入。
安全使用建议
This skill is coherent: it needs a juhe.cn API key and Python. Before installing, confirm you trust juhe.cn and are comfortable with the agent making outbound HTTP requests to v.juhe.cn. Use a limited API key (not shared with other services), prefer setting JUHE_NEWS_KEY as an environment variable (not a committed file), and be aware of rate limits or quota (free tier limits may apply). If you need tighter data control, review network egress policies since the script sends requests to the public juhe endpoints.
功能分析
Type: OpenClaw Skill
Name: juhe-news-headlines
Version: 1.0.0
The skill bundle is a legitimate tool for querying news headlines via the Juhe (juhe.cn) API. The Python script `scripts/news_headlines.py` implements standard API interaction using `urllib`, with proper handling of API keys through environment variables or local configuration. No evidence of data exfiltration, malicious execution, or prompt injection was found; the code and instructions in `SKILL.md` are entirely consistent with the stated purpose of fetching and displaying news.
能力评估
Purpose & Capability
Name/description (news headlines via 聚合数据) match the actual files and runtime needs: a Python script that calls juhe.cn endpoints and one API key (JUHE_NEWS_KEY). No unrelated credentials or binaries are requested.
Instruction Scope
SKILL.md and the script only instruct the agent to read an API key (env or scripts/.env or CLI), call juhe.cn list/detail endpoints, format and print results, and handle errors. There are no instructions to read unrelated system files or exfiltrate data to other endpoints.
Install Mechanism
No install spec; the included Python script is run directly. There are no downloads or archive extraction steps, and no third-party installer URLs—low install risk.
Credentials
Only JUHE_NEWS_KEY is required (declared as primaryEnv) which is appropriate for an API-based news fetcher. The script reads only that key (env or local .env) and nothing else.
Persistence & Privilege
The skill is not forced-always, does not request persistent system-wide changes, and does not modify other skills' configs. It performs transient network calls during invocation only.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install juhe-news-headlines - 安装完成后,直接呼叫该 Skill 的名称或使用
/juhe-news-headlines触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of juhe-news-headlines.
- Supports querying latest news headlines by category: domestic, international, sports, entertainment, technology, finance, and more.
- Fetches real-time news via juhe.cn API, with updates every 5–30 minutes.
- Includes example usage for listing, pagination, and viewing news details.
- Provides guidance for API key setup and error handling.
- Command-line script located at scripts/news_headlines.py.
元数据
常见问题
新闻头条 - 聚合数据 是什么?
新闻头条查询。获取最新新闻头条,支持国内、国际、体育、娱乐、科技、财经等分类。使用场景:用户说"查一下今日头条"、"有什么科技新闻"、"帮我看看娱乐八卦"、"财经新闻"、"体育新闻"、"新闻列表"等。通过聚合数据(juhe.cn)API实时查询,更新周期5-30分钟,免费注册即可使用。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 165 次。
如何安装 新闻头条 - 聚合数据?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install juhe-news-headlines」即可一键安装,无需额外配置。
新闻头条 - 聚合数据 是免费的吗?
是的,新闻头条 - 聚合数据 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
新闻头条 - 聚合数据 支持哪些平台?
新闻头条 - 聚合数据 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 新闻头条 - 聚合数据?
由 juhe-skills(@juhemcp)开发并维护,当前版本 v1.0.0。
推荐 Skills