示例地址已复制到剪贴板
接口信息
状态: 正常
总调用: 214
添加时间: 2025-08-19
更新时间: 2025-08-19
访问权限: 公开访问(无需密钥)
请求信息
请求地址:
https://wwm.34bc.com/API/usd-cny-rate.php
示例地址:
https://wwm.34bc.com/API/usd-cny-rate.php
请求参数
参数名 类型 必填 说明
此接口无需请求参数
状态码说明
状态码 说明
200 请求成功,服务器已成功处理了请求。
403 服务器拒绝请求。这可能是由于缺少必要的认证凭据(如API密钥)或权限不足。
404 请求的资源未找到。请检查您的请求地址是否正确。
429 请求过于频繁。您已超出速率限制,请稍后再试。
500 服务器内部错误。服务器在执行请求时遇到了问题。
在线测试
请求参数
此接口无需请求参数
响应结果
此处将显示接口返回结果...
调用示例
<?php
$url = 'https://wwm.34bc.com/API/usd-cny-rate.php';
$params = [
    ];

// 构建URL
$url .= '?' . http_build_query($params);

// 初始化cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);


// 执行请求
$response = curl_exec($ch);
$contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
curl_close($ch);

// 输出响应
if (strpos($contentType, 'image/') === 0) {
    header('Content-Type: ' . $contentType);
    echo $response;
} elseif (strpos($contentType, 'video/') === 0) {
    header('Content-Type: ' . $contentType);
    echo $response;
} elseif (strpos($contentType, 'audio/') === 0) {
    header('Content-Type: ' . $contentType);
    echo $response;
} else {
    echo $response;
}
?>
import requests
import io
from PIL import Image  # 需要安装Pillow库: pip install pillow

url = "https://wwm.34bc.com/API/usd-cny-rate.php"
params = {
    }

headers = {}

# 发送请求
response = requests.get(url, params=params, headers=headers, stream=True)
content_type = response.headers.get('Content-Type', '')

# 处理响应
if 'image/' in content_type:
    # 处理图片响应
    image = Image.open(io.BytesIO(response.content))
    image.show()  # 显示图片
elif 'video/' in content_type:
    # 处理视频响应
    with open('api_response.mp4', 'wb') as f:
        f.write(response.content)
    print(f"视频已保存为 api_response.mp4")
elif 'audio/' in content_type:
    # 处理音频响应
    with open('api_response.mp3', 'wb') as f:
        f.write(response.content)
    print(f"音频已保存为 api_response.mp3")
else:
    # 处理文本响应
    print(response.text)
const url = new URL('https://wwm.34bc.com/API/usd-cny-rate.php');
const params = {
    };

// 添加参数到URL
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

const fetchOptions = { 
    method: 'GET',
    headers: {}
};


// 发送请求
fetch(url, fetchOptions)
    .then(response => {
        const contentType = response.headers.get('Content-Type') || '';
        
        // 根据响应类型处理
        if (contentType.includes('image/')) {
            return response.blob().then(blob => {
                const imgUrl = URL.createObjectURL(blob);
                const img = document.createElement('img');
                img.src = imgUrl;
                document.body.appendChild(img);
            });
        } else if (contentType.includes('video/')) {
            return response.blob().then(blob => {
                const videoUrl = URL.createObjectURL(blob);
                const video = document.createElement('video');
                video.src = videoUrl;
                video.controls = true;
                document.body.appendChild(video);
            });
        } else if (contentType.includes('audio/')) {
            return response.blob().then(blob => {
                const audioUrl = URL.createObjectURL(blob);
                const audio = document.createElement('audio');
                audio.src = audioUrl;
                audio.controls = true;
                document.body.appendChild(audio);
            });
        } else {
            // 处理文本响应
            return response.text().then(text => console.log(text));
        }
    })
    .catch(error => console.error('请求失败:', error));
curl -X GET "https://wwm.34bc.com/API/usd-cny-rate.php?"
# 对于图片/视频/音频响应,可以保存到文件
# -o output.jpg  # 保存图片
# -o output.mp4  # 保存视频
# -o output.mp3  # 保存音频
API列表