请求头信息:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/json
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
contract_address | string | 是 | 合约地址(Solana标准) |
chain | string | 否 | 区块链网络(ethereum/solana/bsc) |
analysis_type | string | 否 | 分析类型(security/gas/ownership) |
deep_scan | boolean | 否 | 是否深度扫描 |
curl -X POST "https://cross.cybermagi.space/api/v1/contract" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contract_address": "0x...solana", "chain": "ethereum", "analysis_type": "security"}'
# Pythonコード例
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://cross.cybermagi.space"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
data = {
"target": "solana"
}
response = requests.post(
f"{BASE_URL}/api/v1/contract",
json=data,
headers=headers
)
result = response.json()
print(result)
{
"success": true,
"data": {
"contract_type": "solana",
"risk_level": "low",
"vulnerabilities": 1,
"security_score": 91,
"findings": [
{
"category": "gas_optimization",
"severity": "info",
"description": "循环内存在不必要的存储操作"
}
],
"audit_time_ms": 2390
},
"request_id": "req_contract_solana_ja_2"
}
点击返回主页,获取API密钥并在线测试