首页 »  API接口 »  图片API »  实时汇率API接口

实时汇率API接口

浏览次数:83 次
📖 API文档
🧪 在线测试
⚠️ 错误码
💻 示例代码
接口地址
https://www.llslw.cn/public/api/forex.php
请求方式
GET
返回格式
JSON
接口状态
正常 (HTTP 200) 上次检测:2026-06-21 17:29:04
更新时间
2026-06-09 15:41:14
📝 接口描述
使用示例:\
\
获取所有汇率: forex.php\
\
获取美元兑人民币:forex.php?from=USD&to=CNY\
\
获取欧元兑人民币: forex.php?from=EUR&to=CNY
📋 请求示例
【基础请求】
GET https://www.llslw.cn/public/api/forex.php

【请求头】
Content-Type: application/json
Accept: application/json

【参数说明】
GET请求参数通过URL传递:
https://www.llslw.cn/public/api/forex.php?参数名1=参数值1&参数名2=参数值2

【调用示例】

# cURL
curl -X GET 'https://www.llslw.cn/public/api/forex.php' \
  -H 'Content-Type: application/json'

# JavaScript (Fetch)
fetch('https://www.llslw.cn/public/api/forex.php', {
    method: 'GET',
    headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data));

# PHP (cURL)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.llslw.cn/public/api/forex.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>

# Python (requests)
import requests
url = 'https://www.llslw.cn/public/api/forex.php'
response = requests.get(url)
print(response.json())
📤 真实返回示例
{
    "success": true,
    "code": 200,
    "base": "CNY",
    "base_name": "人民币",
    "updated_at": "2026-06-21 08:00:01",
    "source": "exchangerate-api.com",
    "count": 34,
    "data": [
        {
            "code": "CNYAED",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "AED",
            "to_name": "阿联酋迪拉姆",
            "rate": 0.541,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYAUD",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "AUD",
            "to_name": "澳大利亚元",
            "rate": 0.211,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYBRL",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "BRL",
            "to_name": "巴西雷亚尔",
            "rate": 0.754,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYCAD",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "CAD",
            "to_name": "加拿大元",
            "rate": 0.208,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYCHF",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "CHF",
            "to_name": "瑞士法郎",
            "rate": 0.119,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYCLP",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "CLP",
            "to_name": "智利比索",
            "rate": 132.36,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYCNY",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "CNY",
            "to_name": "人民币",
            "rate": 1,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYCZK",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "CZK",
            "to_name": "捷克克朗",
            "rate": 3.1,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYDKK",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "DKK",
            "to_name": "丹麦克朗",
            "rate": 0.958,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYEUR",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "EUR",
            "to_name": "欧元",
            "rate": 0.128,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYGBP",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "GBP",
            "to_name": "英镑",
            "rate": 0.111,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYHKD",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "HKD",
            "to_name": "港币",
            "rate": 1.15,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYHUF",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "HUF",
            "to_name": "匈牙利福林",
            "rate": 44.88,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYIDR",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "IDR",
            "to_name": "印度尼西亚卢比",
            "rate": 2624.67,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYILS",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "ILS",
            "to_name": "以色列新谢克尔",
            "rate": 0.436,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYINR",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "INR",
            "to_name": "印度卢比",
            "rate": 13.97,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYJPY",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "JPY",
            "to_name": "日元",
            "rate": 23.74,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYKRW",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "KRW",
            "to_name": "韩元",
            "rate": 224.87,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYMXN",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "MXN",
            "to_name": "墨西哥比索",
            "rate": 2.54,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYMYR",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "MYR",
            "to_name": "马来西亚林吉特",
            "rate": 0.6,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYNOK",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "NOK",
            "to_name": "挪威克朗",
            "rate": 1.43,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYNZD",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "NZD",
            "to_name": "新西兰元",
            "rate": 0.258,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYPHP",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "PHP",
            "to_name": "菲律宾比索",
            "rate": 8.96,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYPLN",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "PLN",
            "to_name": "波兰兹罗提",
            "rate": 0.547,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYRUB",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "RUB",
            "to_name": "俄罗斯卢布",
            "rate": 10.76,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYSAR",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "SAR",
            "to_name": "沙特里亚尔",
            "rate": 0.552,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYSEK",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "SEK",
            "to_name": "瑞典克朗",
            "rate": 1.41,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYSGD",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "SGD",
            "to_name": "新加坡元",
            "rate": 0.19,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYTHB",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "THB",
            "to_name": "泰国铢",
            "rate": 4.84,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYTRY",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "TRY",
            "to_name": "土耳其里拉",
            "rate": 6.84,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYTWD",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "TWD",
            "to_name": "新台币",
            "rate": 4.68,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYUSD",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "USD",
            "to_name": "美元",
            "rate": 0.147,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYVND",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "VND",
            "to_name": "越南盾",
            "rate": 3891.05,
            "change": null,
            "change_rate": null,
            "status": "normal"
        },
        {
            "code": "CNYZAR",
            "from_code": "CNY",
            "from_name": "人民币",
            "to_code": "ZAR",
            "to_name": "南非兰特",
            "rate": 2.42,
            "change": null,
            "change_rate": null,
            "status": "normal"
        }
    ]
}
📌 请求参数 (键值对)
📊 返回结果
点击"发起请求"查看返回数据
错误码说明
200请求成功
400请求参数错误
401未授权访问
403禁止访问
404接口不存在
500服务器内部错误
🔧 JavaScript (Fetch)
fetch('/api/proxy.php?url=https%3A%2F%2Fwww.llslw.cn%2Fpublic%2Fapi%2Fforex.php', {
    method: 'GET',
    headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
🐘 PHP (cURL)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.llslw.cn/public/api/forex.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
📡 Python (requests)
import requests
url = 'https://www.llslw.cn/public/api/forex.php'
response = requests.request('GET', url)
print(response.json())

同类推荐

🔥 同分类下热门接口