---
id: document_item.getting-api-keys-on-binance
page_type: documentation_article
title: "在 Binance 交易所获取 API 密钥"
description: "如何为 Moonbot 创建 HMAC 或 RSA 类型的 Binance API 密钥、开启 Spot/Futures 所需的权限、保存 Secret Key，并在需要时将访问限制为受信任的 IP 地址。"
section: documentation
category: "Moonbot 终端使用要点 / 在本地电脑上安装 Moonbot"
url: https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer/getting-api-keys-on-binance?format=md
locale: zh
alternate_ru: https://moonbot.pro/ru/documentation/installing-moonbot-on-a-local-computer/getting-api-keys-on-binance?format=md
alternate_en: https://moonbot.pro/documentation/installing-moonbot-on-a-local-computer/getting-api-keys-on-binance?format=md
parent: https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer?format=md
previous: https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer/account-registration-on-the-binance?format=md
next: https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer/funding-the-spot-wallet?format=md
status: published
updated_at: 2026-11-10T23:56:45+03:00
---

# 在 Binance 交易所获取 API 密钥

登录账户并完成身份验证后，在 [Binance](https://accounts.binance.com/register?ref=joinmoonbot) 的网页界面中打开合约交易图表。按照屏幕上的黄色提示操作，并通过合约交易准入测试。此外，还需要向 [Binance](https://accounts.binance.com/register?ref=joinmoonbot) 交易所账户的合约账户转入一小笔资金。

然后进入 **Account **→** API Management**（账户 → API 管理）页面。

点击 **Create API**（创建 API）按钮。

在 **Choose API Key Type**（选择密钥类型）窗口中，点击上方的选项 **System generated**（系统生成）以创建 **HMAC** 密钥，或点击 **Self-generated**（自行生成）以创建 **RSA** 密钥。然后点击 **Next**（下一步）。

在 **Create API** 窗口的 **Label API key to proceed**（为 API 密钥添加标签）字段中输入 API 密钥的标签名称，例如 “**Moonbot***”*，然后点击 **Next** 按钮。

在 **Security Verification Requirements**（安全验证要求）窗口中完成必要的验证步骤，输入验证器应用中的验证码以及发送到您邮箱的邮件中的验证码。

完成所有步骤后，API 密钥即创建成功。

⚠️ 重要！请将 **API Key** 和 **Secret Key** 保存到 U 盘上的文本文件中，或抄写在纸上——在 Moonbot 终端中注册密钥时需要用到它们（在 **Settings** → **Login** 选项卡上）。

接着点击 **Edit restrictions**（编辑限制）按钮。

![](https://moonbot.pro/storage/editor-images/EN01_01-1768137890.jpg)

即使您目前只使用 **FREE 版**，也同样可以在**现货**和**合约**市场交易。因此，建议一开始就创建可同时用于现货和合约市场交易的**通用 API 密钥**——这样将来无需重新设置，就可以在 Moonbot 终端的 **PRO 版**中使用同一组密钥。\
要创建**通用 API 密钥**，请**勾选** **Enable Futures**（启用合约）和 **Enable Spot & Margin Trading**（启用现货及杠杆交易）两项。

出于安全考虑，请务必确认该**复选框**，即 **Enable Withdrawals**（启用提现）一项，**没有被勾选**，因为 Moonbot 终端不提供提现功能，该功能在 API 密钥中必须保持**关闭**状态。

⚠️ 重要！同样出于安全考虑，建议选择 **Restrict access to trusted IPs only** (**Recommended)**（仅允许受信任的 IP 地址访问，推荐）选项，这样 API 密钥没有有效期限制；并在下方的字段中输入安装了使用这些 API 密钥的 Moonbot 终端的电脑或服务器的 **IP 地址**。IP 地址可以通过任意在线 IP 查询服务查到，例如 🔗[ https://2ip.io/](https://2ip.io/)

如果保留 **Unrestricted (Less Secure)**（不限制，安全性较低）选项，API 密钥的有效期将为 **90 天**，到期后需要手动续期或重新创建。此外，这种设置允许从任意 IP 地址访问，会明显降低安全性。

如果 Moonbot 终端中激活的 API 密钥没有绑定 IP 地址白名单，那么终端启动时会在日志中记录 API 密钥距到期还剩多少天。在到期**前 7 天**，终端主窗口**的 BNB 余额信息区域**会出现红色高亮的警告“**API: N days**”，提示 API 密钥剩余的可用天数；同时也会向 Telegram 发送相应通知（起初不超过每 6 小时一次；剩余不足 4 天时，每小时发送一次）。这一 API 密钥有效期检查机制适用于所有类型的交易所连接：**Binance Spot、Binance Futures (USDT-M) 和 Binance Quarterly (COIN-M)**。

完成 API 密钥的全部设置后，点击 **Save**（保存）按钮。

随后会再次打开 **Security Verification Requirements** 窗口。请输入**验证器应用**中的验证码和**电子邮件**中的验证码。之后，对 API 密钥的更改即保存成功。

## 导航

路径: [首页](https://moonbot.pro/zh?format=md) / [文档](https://moonbot.pro/zh/documentation?format=md) / [Moonbot 终端使用要点](https://moonbot.pro/zh/documentation/basics?format=md) / [在本地电脑上安装 Moonbot](https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer?format=md) / 在 Binance 交易所获取 API 密钥

上级栏目: [在本地电脑上安装 Moonbot](https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer?format=md)

上一页: [在 Binance 交易所注册账户](https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer/account-registration-on-the-binance?format=md)

下一页: [为交易所现货钱包充值](https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer/funding-the-spot-wallet?format=md)

## 相关内容

- [为交易所现货钱包充值](https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer/funding-the-spot-wallet?format=md)
- [下载 Moonbot 终端](https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer/download-the-moonbot-terminal?format=md)
- [为 Moonbot 终端创建文件夹](https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer/creating-a-folder-for-the-moonbot-terminal?format=md)
- [启动 Moonbot 终端](https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer/launching-the-moonbot-terminal?format=md)
- [在 Moonbot 终端中添加 API 密钥](https://moonbot.pro/zh/documentation/installing-moonbot-on-a-local-computer/adding-api-keys-to-the-moonbot-terminal?format=md)
