首页 金融理财 汇率查询
汇率查询

汇率查询

  • 1446
  • 1512
人民币、美元、欧元、英镑、日元、韩元等100多种货币的实时汇率查询,提供汇率转换、单个货币对应的热门货币汇率行情等API。
免费
  • 普通用户:100次
  • 会员:不限次
  • 技术代理:不限次
https://api.binstd.com/exchange/convert
JSON,JSONP
GET POST
https://api.binstd.com/exchange/convert?appkey=yourappkey&from=CNY&to=USD&amount=10

请求参数:

API在线测试
参数名称类型必填说明
from string 要换算的单位
to string 换算后的单位
amount string 数量

返回参数:

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

请求代码:

查看代码
<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$from = 'CNY';
$to = 'USD';
$amount = 10;
$url = "https://api.binstd.com/exchange/convert?appkey=$appkey&from=$from&to=$to&amount=$amount";
$result = curlOpen($url, ['ssl'=>true]);

$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));

if($jsonarr['status'] != 0)
{
    echo $jsonarr['msg'];
    exit();
}

$result = $jsonarr['result'];
echo $result['from'].' '.$result['to'].' '.$result['fromname'].' '.$result['toname'].' '.$result['updatetime'].' '.$result['rate'].' '.$result['camount'].'
';

JSON返回示例 :

{
    "status": "0",
    "msg": "ok",
    "result": {
        "from": "CNY",
        "to": "USD",
        "fromname": "人民币",
        "toname": "美元",
        "updatetime": "2015-10-26 16:56:22",
        "rate": "0.1574",
        "camount": "1.574"
    }
}
                    

API错误码:

代号说明
201 要兑换的货币为空
202 兑换后的货币为空
203 兑换数量为空
204 要兑换的货币有误
205 兑换后的货币有误
206 货币为空
207 货币有误
208 没有信息

系统错误码:

代号说明
101 APPKEY为空或不存在
102 APPKEY已过期
103 APPKEY无请求此数据权限
104 请求超过次数限制
105 IP被禁止
106 IP请求超过限制
107 接口维护中
108 接口已停用
会员等级权限
普通用户 100次
会员 不限次
技术代理 不限次

活动推荐ACTIVITY 更多

  • orc活动

热门API接口推荐RECOMMENDED DATA 更多

开通BinSTD会员

开通账号:

×

会员类型:

  • 会员

会员时长:

  • 按年付

总金额:

  • ¥ 600.00元原价:900.00元
  • ¥ 300.00元原价:450.00元
  • ¥ 50.00元原价:75.00元
  • ¥ 100.00元原价:150.00元
  • ¥ 150.00元原价:225.00元
  • ¥ 200.00元原价:300.00元
  • ¥ 250.00元原价:375.00元