跳到主要内容

获取服务器时间

类型:NONE · 权重:1

状态:已实现。

GET /api/v3/time

返回网关时钟。用它计算签名请求中加到 timestamp 上的偏移量(见 时间同步)。

请求

GET /api/v3/time

响应 — 200

{ "serverTime": 1756600000000 }
字段类型说明
serverTimenumberUnix 毫秒。

错误

HTTPcode触发场景
429-1003按 IP 的公开权重耗尽。

示例

import time, requests
server = requests.get("https://api.rocky.exchange/api/v3/time").json()["serverTime"]
offset_ms = server - int(time.time() * 1000)