请求头信息:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/json
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
symbol | string | 是 | 加密货币代号(如 SOL) |
currency | string | 否 | 计价货币(默认 USD) |
interval | string | 否 | 时间间隔(1h, 24h, 7d) |
curl -X GET "https://cross.cybermagi.space/api/v1/crypto?symbol=SOL¤cy=USD" \
-H "Authorization: Bearer YOUR_API_KEY"
# Python调用示例
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://cross.cybermagi.space"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
params = {
"query": "example"
}
response = requests.get(
f"{BASE_URL}/api/v1/crypto",
params=params,
headers=headers
)
result = response.json()
print(result)
{
"success": true,
"data": {
"symbol": "SOL",
"price": 48000.0,
"change_24h": 2.35,
"volume_24h": 28500000000.0,
"market_cap": 960000000000.0,
"high_24h": 49200.0,
"low_24h": 47500.0
},
"request_id": "req_crypto_sol_zh_1"
}
点击返回主页,获取API密钥并在线测试