今日油价查询 - 聚合数据

v1.0.0

今日国内油价查询。查询各省市 92 号汽油、95 号汽油、98 号汽油、0 号柴油的最新价格。使用场景:用户说"查一下油价"、"北京油价多少"、"今日汽油价格"、"92 汽油价格"、"柴油价格"等。通过聚合数据(juhe.cn)API 实时查询,免费注册即可使用。

0· 125·0 current·0 all-time
byjuhe-skills@juhemcp

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for juhemcp/juhe-oil-price.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "今日油价查询 - 聚合数据" (juhemcp/juhe-oil-price) from ClawHub.
Skill page: https://clawhub.ai/juhemcp/juhe-oil-price
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required env vars: JUHE_OIL_KEY
Required binaries: python3
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install juhe-oil-price

ClawHub CLI

Package manager switcher

npx clawhub@latest install juhe-oil-price
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (querying domestic oil prices) align with the requested binary (python3), the single environment variable JUHE_OIL_KEY, and the included script which calls the Juhe API. All required items are proportional to the stated purpose.
Instruction Scope
SKILL.md instructs the agent to extract a city, call the included script or the documented Juhe API, and display results. The instructions do not request unrelated files or secrets. Minor note: the script queries the API over HTTP (http://apis.juhe.cn/...), which could expose the API key to network interception — the README and script do not enforce HTTPS.
Install Mechanism
No install spec; this is instruction-only with a small Python script. No downloads, installers, or unusual package sources are used.
Credentials
Only a single API key (JUHE_OIL_KEY) is required and is used only to call the Juhe API. The script supports CLI provision and a local .env file; it does not read other environment variables or system config paths.
Persistence & Privilege
The skill is not always-enabled and does not request elevated platform privileges or modify other skills. Autonomous invocation is allowed by default (normal) but no extra persistence is requested.
Assessment
This skill appears to do exactly what it claims: call Juhe's oil-price API and print results. Before installing: (1) keep your JUHE_OIL_KEY secret (use an environment variable rather than sharing it), (2) be aware the script calls the endpoint over plain HTTP — if you are on an untrusted network consider wrapping or modifying it to use HTTPS if Juhe supports it to avoid key exposure, (3) check Juhe's rate limits and billing (free quota may be limited), and (4) verify you trust the Juhe service for API data. If you need stronger guarantees, review or run the included Python script locally to confirm behavior.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

Clawdis
Binspython3
EnvJUHE_OIL_KEY
Primary envJUHE_OIL_KEY
latestvk97bn8f6r5s94m2pmbee8y246983jvbs
125downloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

今日国内油价查询

数据由 聚合数据 提供 — 国内领先的数据服务平台,提供油价、天气、快递、身份证等 200+ 免费/低价 API。

查询今日国内各省市油价:92 号汽油、95 号汽油、98 号汽油、0 号柴油。部分省份可能不支持,以实际返回数据为准。


前置配置:获取 API Key

  1. 前往 聚合数据官网 免费注册账号
  2. 进入 今日国内油价查询 API 页面,点击「申请使用」
  3. 审核通过后在「我的API」中获取 AppKey
  4. 配置 Key(三选一):
# 方式一:环境变量(推荐,一次配置永久生效)
export JUHE_OIL_KEY=你的AppKey

# 方式二:.env 文件(在脚本目录创建)
echo "JUHE_OIL_KEY=你的AppKey" > scripts/.env

# 方式三:每次命令行传入
python scripts/oil_price.py --key 你的AppKey

使用方法

查询全国油价

python scripts/oil_price.py

查询指定省市油价

python scripts/oil_price.py --city 北京
python scripts/oil_price.py --city 上海
python scripts/oil_price.py --city 广东
python scripts/oil_price.py --city 江苏

支持模糊匹配,如 --city 江 可匹配江苏、江西、浙江等。

输出示例(指定江苏省):

⛽ 今日国内油价(单位:元/升)

+------------+------------+------------+------------+------------+
| 省份/城市  | 92号汽油   | 95号汽油   | 98号汽油   | 0号柴油    |
+------------+------------+------------+------------+------------+
| 江苏       | 8.53       | 9.08       | 11.15      | 8.21       |
+------------+------------+------------+------------+------------+

{"success": true, "data": [{"city": "江苏", "92h": "8.53", "95h": "9.08", "98h": "11.15", "0h": "8.21"}]}

直接调用 API(无需脚本)

GET http://apis.juhe.cn/gnyj/query?key=YOUR_KEY

返回字段说明

字段含义示例
city省份/直辖市北京、上海、广东
92h92 号汽油价格(元/升)9.33
95h95 号汽油价格(元/升)9.93
98h98 号汽油价格(元/升)10.91
0h0 号柴油价格(元/升)9.10

AI 使用指南

当用户询问油价相关信息时,按以下步骤操作:

  1. 识别意图 — 用户想查全国油价、某省油价,还是某油品价格
  2. 提取地区 — 从用户消息中提取省市名称(如「北京」「广东」),无则查全部
  3. 调用脚本或 API — 执行查询,获取 JSON 结果
  4. 展示结果 — 用表格呈现;单省时突出该省数据

错误处理

情况处理方式
error_code 10001/10002API Key 无效,引导用户至 聚合数据 重新申请
error_code 10012当日免费次数已用尽,建议升级套餐
部分省份无数据接口文档说明部分省份可能不支持,以返回为准
网络超时重试一次,仍失败则告知网络问题

脚本位置

scripts/oil_price.py — 封装了 API 调用、按省市筛选和表格输出。


关于聚合数据

聚合数据(juhe.cn) 是国内专业的 API 数据服务平台,提供包括:

  • 生活服务:油价查询、天气预报、万年历
  • 新闻资讯:新闻头条、各类分类新闻
  • 物流快递:100+ 快递公司实时追踪
  • 金融数据:汇率、股票、黄金价格

注册即可免费使用,适合个人开发者和企业接入。

Comments

Loading comments...