故障排查

Binance API 报错排查

4 类最常见 API error 自助排查 · 90% 不需要联系支持。

报错分类速查

| 错误代码 / 关键词 | 类型 | 跳到 | |-------------------|------|------| | IP whitelist / Invalid IP | IP 不匹配 | Section 1 | | Invalid API-key / Permission denied | 权限不足 | Section 2 | | Too many requests / 429 / 418 | 限流 | Section 3 | | Timestamp / recvWindow | 时钟偏差 | Section 4 |

Section 1 · IP whitelist mismatch

典型报错:Invalid API-key, IP, or permissions for action

根因:你的 API 密钥绑定了 IP 白名单,但发起请求的 IP 跟绑定 IP 不一致。

解决:

  1. 登录 Binance → API Management → 找到执行端用的那把密钥
  2. 检查 Restrict access to trusted IPs only 是否开
  3. 检查绑定的 IP 是否是 你那台云主机(执行端)的 IP(向导里给过)
  4. 这把密钥 只给你主机上的执行端用——不要同时配给自己电脑 / 其他工具
  5. 主机 IP 变了(重建 / 换区)→ 在 Binance 把白名单更新成新 IP;向导/控制台会显示当前应填的 IP

动态 IP 提醒:执行端跑在固定 IP 的云主机上;别把这把密钥配到 IP 会变的设备上。

Section 2 · Permission insufficient

典型报错:This action is disabled on this account / API-key permissions do not allow this action

根因:API 密钥权限不全。

要求的最小权限组合:

| 权限 | 状态 | |------|------| | Enable Reading | ✅ 必开 | | Enable Futures | ✅ 必开 | | Enable Withdrawals | ❌ 永远关闭 | | Restrict to trusted IPs(你主机 IP) | ✅ 必开 |

解决:

  1. Binance → API Management → 找到那把密钥 → Edit restrictions
  2. 确认 ReadingFutures 都开、Withdrawals
  3. 保存(可能需要 2FA)

Section 3 · Rate limit(限流)

典型报错:Too many requests · IP banned until <timestamp>(429 / 418)/ Rate limit exceeded

根因:Binance API 限流。执行端请求频率经过控制、不会自己触发;多半是你账户上有其他工具 / 脚本同时高频请求

解决:

  1. 检查账户上还有哪些 API 密钥,关掉不必要的
  2. 不要用同一把密钥给多个工具同时跑
  3. 自己的脚本要遵守 Binance rate limit、加节流
  4. 等限流过期(报错里通常有 unban 时间)自动恢复

Section 4 · Timestamp / 时钟偏差

典型报错:Timestamp for this request is outside of the recvWindow

根因:主机系统时钟跟 Binance 服务器差超过 1 秒。通常发生在执行端主机侧。

自动处理:执行端主机跑 NTP 时钟同步、启动校准,偶发漂移会自动重试。

如果持续报这个错:邮件联系支持,我们会帮你检查主机 NTP 状态。

其他常见错误

  • Order would immediately trigger:你的止损/限价立即会触发;执行端会自动调价重下,不用你管
  • Insufficient balance:合约钱包 USDT 不足;充值或减仓
  • Margin is insufficient:已用保证金过多;等持仓自动平 / 手动平掉部分仓位

仍未解决怎么办

邮件 [email protected],请附:

  • 完整错误代码 + 报错截图
  • 发生的精确时间(UTC + 你的时区)
  • 最近是否改过 API 密钥 / IP / 账户设置
  • 注册邮箱 + Binance UID 后 6 位