六派数据-汇率查询
  • ID

    29

  • 收藏

    1

  • 使用

    7

汇率查询

人民币、美元、欧元、英镑、日元、韩元等100多种货币的实时汇率查询,提供汇率转换、单个货币对应的热门货币汇率行情等API。
免费会员100次/天 白银会员600次/天 钻石会员15万次/日
免费 (根据会员等级不同,每日可调用次数不同,了解各会员权益>>)
  • 货币兑换
  • 实时汇率
  • 所有货币

基本信息

  • 接口地址: http://open.liupai.net/exchange/convert
  • 支持格式: JSON,JSONP
  • 请求方法: GET POST
  • 请求示例: http://open.liupai.net/exchange/convert?appkey=yourappsecret
  • 接口备注: 此汇率为综合汇率,不作为交易参考。

请求参数 API在线测试

参数名称 类型 必填 说明
from string 是 要换算的货币
to string 是 换算后的货币
amount int 是 数量

返回参数

参数名称 类型   说明
from string   要换算的货币
to string   换算后的货币
fromname string   要换算的货币名称
toname string   换算后的货币名称
updatetime string   更新时间
rate string   汇率
camount string   计算金额

请求代码 查看代码

  • PHP
  • JAVA
  • Python
require_once("curl.func.php");

$method = "POST";
$url = "http://open.liupai.net/exchange/convert";
$headers = NULL;
$params = array(  
    "appkey" => "yourappsecret",
    "from" => "USD",
    "to" => "CNY",
    "amount" => "1"
);
$result = api_curl($method, $url, $headers, $params);
if ($result) {
    $body = json_decode($result["body"], TRUE);
    $status_code = $body["status"];
    if ($status_code == "200") { 
        var_dump($body["result"]);
    }else
        var_dump($body); 
}else  
    echo "发送请求失败";

JSON返回示例

{
    "status": 200,
    "msg": "OK",
    "result": {
        "from": "USD",
        "to": "CNY",
        "fromname": "美元",
        "toname": "人民币",
        "updatetime": "2021-03-31 21:49:27",
        "rate": "6.5502",
        "camount": 6.5502
    }
}

    数据信息

  • 今日调用: 46,146  次
  • 客服电话: 010-8639-9970
  • 客服邮箱: kf@ksmsoft.net
  • 售前客服:
  • 售后技术:

汇率查询问答专区

问答专区

相关资讯

其他推荐