请求信息
请使用编码后的真实地址发起调用
https://api.chuliangnet.com/API/exchange-rate.php
https://api.chuliangnet.com<?php
$ch = curl_init("https://v1.apizero.cn/api/exchange-rate");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-Api-Key: sk_live_xxxxxxxxxxxxxx",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
请求参数
按文档填写参数后即可联调
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| money | string | 必填 | 要转换的金额,必须 > 0;缺省 1 |
| form | string | 必填 | 源货币代码(ISO 4217 三字母),如 CNY、USD、EUR;缺省 CNY |
| to | string | 必填 | 目标货币代码(ISO 4217 三字母),如 USD、JPY;缺省 USD |
| action | string | 必填 | 传 "currencies" 直接返回 26 种支持货币列表 |
在线调试
填写参数后点击测试,示例代码会同步更新
此处将显示接口返回结果...
示例代码
参数改动会自动同步到示例,可直接复制到本地调试
curl -G "https://api.chuliangnet.com/API/exchange-rate.php" \ --data-urlencode "money=xxx" \ --data-urlencode "form=xxx" \ --data-urlencode "to=xxx" \ --data-urlencode "action=xxx"
<?php
$method = 'GET';
$url = 'https://api.chuliangnet.com/API/exchange-rate.php';
$params = [
'money' => 'xxx',
'form' => 'xxx',
'to' => 'xxx',
'action' => 'xxx'
];
$query = http_build_query($params);
$target = $query !== '' ? $url . '?' . $query : $url;
$ch = curl_init($target);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
curl_close($ch);
import requests
url = "https://api.chuliangnet.com/API/exchange-rate.php"
params = {
"money": "xxx",
"form": "xxx",
"to": "xxx",
"action": "xxx"
}
resp = requests.get(url, params=params, timeout=10)
print(resp.status_code)
print(resp.text)
const params = {
money: "xxx",
form: "xxx",
to: "xxx",
action: "xxx"
};
const query = new URLSearchParams(params).toString();
fetch('https://api.chuliangnet.com/API/exchange-rate.php' + (query ? '?' + query : ''))
.then(r => r.text())
.then(console.log);
响应示例
{
"code": 0,
"msg": "成功",
"data": {
"money": 1,
"from": "CNY",
"from_name": "人民币",
"to": "USD",
"to_name": "美元",
"rate": 0.146405,
"result": 0.1464,
"update_time": "2026-05-06 13:00:02"
},
"request_id": "abc123def456"
}