全球汇率实时查询

提供最新的货币汇率信息,整合权威金融数据源并实时更新。支持主要国际及新兴市场货币对,适用于金融应用、电子商务平台和企业财务系统。助力用户和开发者高效获取数据。

接口状态:运行中
接口类型:密钥接口
请求方式:GET
响应格式:application/json
总调用:16,506
添加时间:2025-12-10
更新时间:2026-01-10

请求信息

请求地址:
https://xsapi.com/API/rate.php
示例地址:
https://xsapi.com/API/rate.php?apikey=你的秘钥&wd=人民币兑欧元

请求参数

参数名 类型 必填 说明
apikey string 登录后自动获取
wd string 需要查询的汇率(如人民币、人民币兑欧元等)

状态码说明

状态码 说明
200 请求成功,服务器已成功处理了请求。
403 服务器拒绝请求。可能是缺少API密钥或权限不足。
404 请求的资源未找到,请检查请求地址是否正确。
429 请求过于频繁,已超出速率限制,请稍后再试。
500 服务器内部错误,执行请求时遇到问题。

在线测试

此处将显示接口返回结果...

调用示例

<?php
$url = 'https://xsapi.com/API/rate.php';
$params = ['apikey' => 'YOUR_VALUE', 'wd' => 'YOUR_VALUE', ];
$url .= '?' . http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://xsapi.com/API/rate.php'
params = {'apikey': 'YOUR_VALUE', 'wd': 'YOUR_VALUE', }
response = requests.get(url, params=params)
print(response.text)
const url = 'https://xsapi.com/API/rate.php?';
const params = new URLSearchParams({apikey: 'YOUR_VALUE', wd: 'YOUR_VALUE', });
fetch(url + params)
    .then(response => response.text())
    .then(data => console.log(data));
import java.net.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        String url = "https://xsapi.com/API/rate.php?";
        String params = "apikey=YOUR_VALUE&wd=YOUR_VALUE&";
        URL obj = new URL(url + params);
        HttpURLConnection con = (HttpURLConnection) obj.openConnection();
        con.setRequestMethod("GET");
        BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
        String inputLine;
        StringBuffer response = new StringBuffer();
        while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
        in.close();
        System.out.println(response.toString());
    }
}
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://xsapi.com/API/rate.php?"
    params := "apikey=YOUR_VALUE&wd=YOUR_VALUE&"
    resp, err := http.Get(url + params)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()
    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(body))
}
using System;
using System.Net;

class Program {
    static void Main() {
        string url = "https://xsapi.com/API/rate.php?";
        string parameters = "apikey=YOUR_VALUE&wd=YOUR_VALUE&";
        WebClient client = new WebClient();
        string result = client.DownloadString(url + parameters);
        Console.WriteLine(result);
    }
}
curl "https://xsapi.com/API/rate.php?apikey=YOUR_VALUE&wd=YOUR_VALUE&"