货币实时汇率
GET
无需 Key
运行中
接口简介
面向开发者的货币汇率服务接口,主打实时汇率查询与多类型货币转换能力,覆盖法定货币与加密货币两大类别,接口设计轻量化、调用逻辑简单,适配个人开发测试、小型商业应用等多样化场景的汇率数据需求。
接口地址
https://api.lolimi.cn/API/exchange/api请求示例
测试访问https://api.lolimi.cn/API/exchange/api?from=USD&to=CNY&amount=100返回预览
JSON{
"code": 200,
"msg": "成功",
"data": {
"currency_update_time": "2026-01-04 16:17:15",
"from": "CNY",
"to": "USD",
"amount": 6,
"converted_result": 0.8579
},
"time": "2026-01-04 16:19:16",
"timestamp": 1767514756,
"author": "桑帛云API:https:\/\/api.lolimi.cn",
"exec_time": "2ms"
}
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| key | string | 是 | 控制台key |
| from | string | 是 | 原货币代码 |
| to | string | 是 | 目标货币代码 |
| amount | string | 是 | 换算金额(默认为1) |
返回参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| code | int | 状态码 |
| msg | string | 获取状态 |
| data | object | 数组 |
| data.from | string | 原货币 |
| data.to | string | 目标货币 |
| data.amount | string | 原货币余额 |
| data.converted_result | string | 目标货币金额 |
参数配置
登录获取 KeyResponseWaiting...
<?php
$url = "https://api.lolimi.cn/API/exchange/api";
$params = array (
'key' => 'value',
'from' => 'value',
'to' => 'value',
'amount' => 'value',
);
$url .= '?' . http_build_query($params);
$res = file_get_contents($url);
echo $res;