cURL
curl "https://api.ruseo.cn/api/currency_rate?from=CNY&to=USD%2CEUR%2CJPY&amount=100"
查询全球150+货币实时汇率,支持任意货币对换算,数据源欧洲央行,每日更新
https://api.ruseo.cn/api/currency_rate
接口调用前需要确认的核心配置。
/api/currency_ratecurrency_rate必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
from |
否 | string | 基准货币代码(3位字母) | CNY |
to |
否 | string | 目标货币代码(逗号分隔) | USD,EUR,JPY |
amount |
否 | number | 换算金额 | 100 |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/currency_rate?from=CNY&to=USD%2CEUR%2CJPY&amount=100
curl "https://api.ruseo.cn/api/currency_rate?from=CNY&to=USD%2CEUR%2CJPY&amount=100"
$url = 'https://api.ruseo.cn/api/currency_rate?from=CNY&to=USD%2CEUR%2CJPY&amount=100';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/currency_rate?from=CNY&to=USD%2CEUR%2CJPY&amount=100')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "currency_rate",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
data.base |
string | 基准货币 | CNY |
data.rates |
object | 汇率表 | {"USD":0.14,"EUR":0.13} |
data.converted |
object | 换算结果(传amount时) | {"USD":14.0} |
data.data_updated |
string | 数据更新时间 | 2026-05-19 00:02:31 UTC |
点击左侧“发送请求”查看结果...