---
title: "汇率接口：实时、换算与历史汇率 | Narwhal API"
description: "汇率接口通过 REST 和 MCP 提供当前汇率、货币换算和历史汇率（FX）操作。页面详细列出各个操作的请求参数、响应字段和调用示例，方便你快速接入到自己的应用中。"
url: "https://narwhalapi.com/zh/docs/api/fx"
---

# FX 汇率接口参考

通过 REST 和 MCP 获取当前汇率、进行货币换算和查询历史数据。

All four operations are live. They use one Narwhal key and the same credit.

## 四项操作

| 操作 | REST 路径 | MCP 工具 |
| --- | --- | --- |
| [当前汇率](https://narwhalapi.com/zh/docs/api/fx/rates.md) | `/v1/fx/rates/{base}` | `fx_get_rates` |
| [货币换算](https://narwhalapi.com/zh/docs/api/fx/conversion.md) | `/v1/fx/convert` | `fx_convert_currency` |
| [历史汇率](https://narwhalapi.com/zh/docs/api/fx/history.md) | `/v1/fx/rates/{base}/observations` | `fx_get_rate_history` |
| [价格柱](https://narwhalapi.com/zh/docs/api/fx/history.md#bars) | `/v1/fx/rates/{base}/bars` | `fx_get_rate_bars` |

## 通用规则

- 每单位基准货币可兑换的报价货币数量等于返回的汇率。
- 汇率和金额以十进制字符串表示。
- 当前汇率保留各自的时间戳和过期状态。
- REST 和 MCP 使用相同的数据和额度。
- 错误采用 Narwhal 通用的错误响应格式。

## 覆盖范围

当前汇率查询接受支持范围内的现行流通 ISO 4217 货币。历史数据的起始日期因货币而异，并保留实际存在的数据缺口。

[查看外汇覆盖范围](https://narwhalapi.com/zh/coverage.md#fx) · [阅读方法说明](https://narwhalapi.com/zh/methodology/fx.md) · [汇率 API](https://narwhalapi.com/zh/api/fx.md)

## 从免费密钥开始

每月赠送 10 美元免费额度，无需绑卡。每月 10 美元免费额度，无需绑卡。

[获取免费 API 密钥](https://narwhalapi.com/zh/signup)

此页面对你有帮助吗?
