桑帛云API

货币实时汇率

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"
}

请求参数

参数名类型必填描述
keystring控制台key
fromstring原货币代码
tostring目标货币代码
amountstring换算金额(默认为1)

返回参数

参数名类型描述
codeint状态码
msgstring获取状态
dataobject数组
data.fromstring原货币
data.tostring目标货币
data.amountstring原货币余额
data.converted_resultstring目标货币金额

参数配置

登录获取 Key
<?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;
概览
文档
调试
代码
已复制到剪贴板