小小API是一个稳定 快速 的 API 接口服务   点击加入QQ群

汇率换算API

GEThttps://v2.xxapi.cn/api/exchange

接口描述

免费在线汇率换算器,支持人民币、美元、欧元等200多种世界货币和比特币等加密货币的实时转换。提供准确的实时汇率,支持中文货币名称,让您轻松进行全球货币换算。

请求参数

请求示例

var axios = require('axios')

var config = {
  method: 'get',
  url: 'https://v2.xxapi.cn/api/exchange?from=USD&to=CNY&amount=100'
}

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data))
  })
  .catch(function (error) {
    console.log(error)
  })

返回示例

// 货币代码可以查看https://xxapi.cn/doc/allrates
{
    "code": 200,
    "msg": "数据请求成功",
    "data": {
        "amount": 100,
        "from": "USD",
        "rate": 7.3325486852,
        "result": 733.25486852,
        "to": "CNY",
        "update_at": 1736700600000
    },
    "request_id": "821d95235d5917f746600d0b"
}