RESTful API 与 WebSocket 实时数据流,支持现货交易、账户管理和资产提现。
https://realax.ai/openapiRealax Open API 提供完整的 RESTful 接口,涵盖现货交易、账户管理和资产提现功能。 所有接口均挂载在 /openapi 路径下。
https://realax.ai/openapi
三步完成首次 API 调用,从创建密钥到发送请求
签名算法:将所有请求参数(含 timestamp)拼接为查询字符串,使用 Secret Key 进行 HMAC-SHA256 哈希
1import hmac, hashlib, time, requests23API_KEY = "rlx_live_your_api_key"4SECRET_KEY = "YOUR_SECRET_KEY"56def sign(params: dict) -> str:7 query = "&".join(f"{k}={v}" for k, v in params.items())8 return hmac.new(9 SECRET_KEY.encode(), query.encode(), hashlib.sha25610 ).hexdigest()1112params = {"timestamp": int(time.time() * 1000)}13params["signature"] = sign(params)14headers = {"X-MBX-APIKEY": API_KEY}
公开接口(无需鉴权)— 获取行情
curl -X GET "https://realax.ai/openapi/v1/ticker/24hr?symbol=BTCUSDT"
私有接口(需签名)— 查询账户
curl -X GET "https://realax.ai/openapi/v1/account?timestamp=1714800000000&signature=<sig>" -H "X-MBX-APIKEY: rlx_live_your_api_key"