← 返回 Skills 市场
juhemcp

Exchange Rate - 全球货币汇率换算

作者 juhe-skills · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
168
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install juhe-exchange-rate
功能描述
全球汇率查询与货币换算。根据货币代码查询实时汇率、换算金额。使用场景:用户说"查一下汇率"、"美元兑人民币"、"100美元等于多少人民币"、"USD兑换CNY"、"汇率多少"等。通过聚合数据(juhe.cn)API 实时查询,支持 120+ 种货币,数据仅供参考。
使用说明 (SKILL.md)

全球汇率查询换算

数据由 聚合数据 提供 — 根据货币代码查询汇率和换算,支持全球 120+ 个国家和地区货币。数据来源于网络,仅供参考,交易时以银行柜台成交价为准。

根据 官方文档,API 80 提供两个接口:货币列表实时汇率查询换算


前置配置:获取 API Key

  1. 前往 聚合数据官网 免费注册账号
  2. 进入 全球汇率查询换算 API 页面,点击「申请使用」
  3. 审核通过后在「我的API」中获取 AppKey
  4. 配置 Key(三选一):
# 方式一:环境变量(推荐)
export JUHE_EXCHANGE_KEY=你的AppKey

# 方式二:.env 文件
echo "JUHE_EXCHANGE_KEY=你的AppKey" > scripts/.env

# 方式三:命令行传入
python scripts/exchange_rate.py --key 你的AppKey --from USD --to CNY

计费说明:该接口为订阅付费,具体免费额度以聚合数据后台为准。


使用方法

查询两种货币的汇率并换算

# 查询 USD 兑 CNY 汇率
python scripts/exchange_rate.py --from USD --to CNY

# 换算 100 美元等于多少人民币
python scripts/exchange_rate.py --from USD --to CNY --amount 100

查询支持的货币列表

python scripts/exchange_rate.py --list

直接调用 API(无需脚本)

官方文档仅包含以下两个接口:

# 1. 货币列表
GET http://op.juhe.cn/onebox/exchange/list?key=YOUR_KEY

# 2. 实时汇率查询换算
GET http://op.juhe.cn/onebox/exchange/currency?key=YOUR_KEY&from=USD&to=CNY

输出示例

人民币对美元汇率

$ python scripts/exchange_rate.py --from CNY --to USD
💱 CNY → USD
   汇率: 1 CNY = 0.145055 USD
   更新: 2026-03-24 10:36:37

{
  "success": true,
  "data": {
    "currencyF": "CNY",
    "currencyF_Name": "人民币",
    "currencyT": "USD",
    "currencyT_Name": "美元",
    "currencyFD": "1",
    "exchange": "0.14505500",
    "result": "0.14505500",
    "updateTime": "2026-03-24 10:36:37"
  },
  "rate": 0.145055,
  "updateTime": "2026-03-24 10:36:37"
}

美元兑人民币并换算金额

$ python scripts/exchange_rate.py --from USD --to CNY --amount 100
💱 USD → CNY
   汇率: 1 USD = 6.894 CNY
   更新: 2026-03-24 10:36:37
   换算: 100.0 USD = 689.4 CNY

{
  "success": true,
  "data": {
    "currencyF": "USD",
    "currencyF_Name": "美元",
    "currencyT": "CNY",
    "currencyT_Name": "人民币",
    "currencyFD": "1",
    "exchange": "6.89400000",
    "result": "6.89400000",
    "updateTime": "2026-03-24 10:36:37"
  },
  "rate": 6.894,
  "updateTime": "2026-03-24 10:36:37"
}

常用货币代码

代码 货币
CNY 人民币
USD 美元
EUR 欧元
JPY 日元
GBP 英镑
HKD 港币
AUD 澳元
CAD 加元
KRW 韩元
SGD 新加坡元

AI 使用指南

当用户询问汇率或货币换算时,按以下步骤操作:

  1. 识别意图 — 查两种货币汇率、换算金额,或查货币列表
  2. 提取货币代码 — 从用户消息提取(如「美元」→ USD,「人民币」→ CNY)
  3. 提取金额 — 若有「100 美元」「5000 日元」等,提取数值
  4. 调用脚本或 API — 执行查询
  5. 展示结果 — 清晰呈现汇率和换算结果

错误处理

情况 处理方式
208001 货币兑换名称不能为空,需提供 from 和 to
208002/208004/208006 查询不到汇率,检查货币代码是否正确
208005 不存在的货币种类
10001/10002 API Key 无效,引导用户至 聚合数据 重新申请
10012 请求超过次数限制,建议升级套餐

脚本位置

scripts/exchange_rate.py — 封装货币列表、实时汇率换算和错误处理。


关于聚合数据

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

  • 金融数据:汇率、油价、股票、黄金
  • 生活服务:天气、新闻、快递
  • 身份核验:手机归属地、身份证验证

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

安全使用建议
This skill appears to do exactly what it claims (query Juhe exchange-rate APIs) and only needs your Juhe API key and Python. Before installing, consider: (1) Prefer setting JUHE_EXCHANGE_KEY as an environment variable rather than passing via --key (command-line args can be visible to other users/processes). (2) The script calls Juhe over plain HTTP (the code uses http://op.juhe.cn), so your API key is sent unencrypted — if possible switch the endpoints to HTTPS or confirm Juhe supports HTTPS; otherwise avoid using this on untrusted networks. (3) If you store the key in scripts/.env, protect that file with restrictive filesystem permissions. (4) Be aware of Juhe account quotas and potential billing. If you want an extra safety step, inspect or modify the script to use HTTPS and to avoid placing the key in the URL (e.g., send it in a header) or to mask it in logs.
功能分析
Type: OpenClaw Skill Name: juhe-exchange-rate Version: 1.0.0 The skill bundle provides a legitimate tool for querying currency exchange rates via the Juhe Data (juhe.cn) API. The Python script (scripts/exchange_rate.py) uses standard libraries to perform HTTP requests and correctly handles API keys through environment variables or local configuration. The instructions in SKILL.md are well-structured for an AI agent and contain no evidence of prompt injection or malicious intent.
能力评估
Purpose & Capability
Name and description (querying and converting exchange rates via Juhe) match the requested resources: python3 and a single JUHE_EXCHANGE_KEY API key. The script and SKILL.md only reference Juhe API endpoints and functionality described in the docs.
Instruction Scope
SKILL.md and the script stick to the stated purpose (list currencies / query conversion). However, the implementation uses HTTP endpoints (http://op.juhe.cn) and sends the API key in the query string, which exposes the key in plaintext on the network. The SKILL.md also suggests passing the key via command-line (--key), which can leak to process listings. These are operational security concerns, not evidence of malicious intent.
Install Mechanism
No install specification; the skill is instruction + a small Python script. Nothing is downloaded or installed automatically, and no unusual packages or external installers are used.
Credentials
Only a single credential (JUHE_EXCHANGE_KEY) is required and is appropriate for the Juhe API. The skill offers three ways to supply it (env var, scripts/.env file, or CLI). Prefer environment variables over CLI or a disk file; storing the key in scripts/.env or passing via --key increases exposure risk (on-disk or via process list).
Persistence & Privilege
The skill does not request persistent or elevated privileges, does not set always:true, and does not modify other skills or global agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install juhe-exchange-rate
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /juhe-exchange-rate 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- 首次发布 juhe-exchange-rate 汇率查询与货币换算技能 - 支持通过货币代码查询实时汇率,换算金额,覆盖 120+ 种货币 - 提供命令行脚本和API调用方式 - 内置详细用法说明、常见错误处理与示例输出 - 需配置聚合数据(juhe.cn)API Key - 适用于需要全球汇率参考和货币换算的用户场景
元数据
Slug juhe-exchange-rate
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Exchange Rate - 全球货币汇率换算 是什么?

全球汇率查询与货币换算。根据货币代码查询实时汇率、换算金额。使用场景:用户说"查一下汇率"、"美元兑人民币"、"100美元等于多少人民币"、"USD兑换CNY"、"汇率多少"等。通过聚合数据(juhe.cn)API 实时查询,支持 120+ 种货币,数据仅供参考。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 168 次。

如何安装 Exchange Rate - 全球货币汇率换算?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install juhe-exchange-rate」即可一键安装,无需额外配置。

Exchange Rate - 全球货币汇率换算 是免费的吗?

是的,Exchange Rate - 全球货币汇率换算 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Exchange Rate - 全球货币汇率换算 支持哪些平台?

Exchange Rate - 全球货币汇率换算 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Exchange Rate - 全球货币汇率换算?

由 juhe-skills(@juhemcp)开发并维护,当前版本 v1.0.0。

💬 留言讨论