alpha

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Binance Alpha Skill

Binance Alpha Skill

Alpha request on Binance using authenticated API endpoints. Requires API key and secret key for certain endpoints. Return the result in JSON format.
通过经过身份验证的API端点在Binance上发起Alpha请求,部分端点需要提供API key和secret key,返回结果为JSON格式。

Quick Reference

快速参考

EndpointDescriptionRequiredOptionalAuthentication
/bapi/defi/v1/public/alpha-trade/ticker
(GET)
Ticker (24hr Price Statistics)symbolNoneNo
/bapi/defi/v1/public/alpha-trade/agg-trades
(GET)
Aggregated TradessymbolfromId, startTime, endTime, limitNo
/bapi/defi/v1/public/alpha-trade/get-exchange-info
(GET)
Get Exchange InfoNoneNoneNo
/bapi/defi/v1/public/alpha-trade/klines
(GET)
Klines (Candlestick Data)symbol, intervallimit, startTime, endTimeNo
/bapi/defi/v1/public/wallet-direct/buw/wallet/cex/alpha/all/token/list
(GET)
Token ListNoneNoneNo

端点描述必填参数选填参数身份验证
/bapi/defi/v1/public/alpha-trade/ticker
(GET)
行情(24小时价格统计)symbol
/bapi/defi/v1/public/alpha-trade/agg-trades
(GET)
聚合交易记录symbolfromId, startTime, endTime, limit
/bapi/defi/v1/public/alpha-trade/get-exchange-info
(GET)
获取交易所信息
/bapi/defi/v1/public/alpha-trade/klines
(GET)
K线(蜡烛图数据)symbol, intervallimit, startTime, endTime
/bapi/defi/v1/public/wallet-direct/buw/wallet/cex/alpha/all/token/list
(GET)
代币列表

Parameters

参数

Common Parameters

通用参数

  • symbol: e.g., "ALPHA_175USDT" – use token ID from Token List
  • fromId: starting trade ID to fetch from (e.g., 1)
  • startTime: start timestamp (milliseconds) (e.g., 1623319461670)
  • endTime: end timestamp (milliseconds) (e.g., 1641782889000)
  • limit: number of results to return (default 500, max 1000) (e.g., 500)
  • interval: e.g., "1h" – supported intervals: 1s, 15s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M
  • symbol: 例如 "ALPHA_175USDT" – 使用代币列表中的token ID
  • fromId: 要获取的起始交易ID(例如1)
  • startTime: 起始时间戳(毫秒)(例如 1623319461670)
  • endTime: 结束时间戳(毫秒)(例如 1641782889000)
  • limit: 返回结果数量(默认500,最大1000)(例如500)
  • interval: 例如 "1h" – 支持的时间间隔:1s, 15s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M

Authentication

身份验证

For endpoints that require authentication, you will need to provide Binance API credentials. Required credentials:
  • apiKey: Your Binance API key (for header)
  • secretKey: Your Binance API secret (for signing)
Base URLs:
对于需要身份验证的端点,你需要提供Binance API凭证。 所需凭证:
  • apiKey: 你的Binance API key(放在请求头中)
  • secretKey: 你的Binance API secret(用于签名)
基础URL:

Security

安全

Share Credentials

凭证提交

Users can provide Binance API credentials by sending a file where the content is in the following format:
bash
abc123...xyz
secret123...key
用户可以通过发送文件的形式提供Binance API凭证,文件内容格式如下:
bash
abc123...xyz
secret123...key

Never Disclose API Key and Secret

切勿泄露API Key和Secret

Never disclose the location of the API key and secret file.
Never send the API key and secret to any website other than Mainnet and Testnet.
切勿泄露API key和secret文件的存储位置。 除了主网和测试网之外,切勿将API key和secret发送给任何其他网站。

Never Display Full Secrets

切勿完整展示密钥

When showing credentials to users:
  • API Key: Show first 5 + last 4 characters:
    su1Qc...8akf
  • Secret Key: Always mask, show only last 5:
    ***...aws1
Example response when asked for credentials: Account: main API Key: su1Qc...8akf Secret: ***...aws1
向用户展示凭证时:
  • API Key: 仅展示前5位 + 后4位:
    su1Qc...8akf
  • Secret Key: 始终脱敏,仅展示最后5位:
    ***...aws1
查询凭证时的响应示例: 账户: main API Key: su1Qc...8akf Secret: ***...aws1

Listing Accounts

账户列表展示

When listing accounts, show names and environment only — never keys: Binance Accounts:
  • main (Mainnet)
  • futures-keys (Mainnet)
列出账户时,仅展示名称和环境,绝不展示密钥: Binance账户:
  • main(主网)
  • futures-keys(主网)

Transactions in Mainnet

主网交易

When performing transactions in mainnet, always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed.

在主网执行交易时,务必先与用户确认,要求用户输入"CONFIRM"后再继续操作。

Binance Accounts

Binance账户

main

main

  • API Key: your_mainnet_api_key
  • Secret: your_mainnet_secret
  • API Key: 你的主网API key
  • Secret: 你的主网secret

TOOLS.md Structure

TOOLS.md结构

bash
undefined
bash
undefined

Binance Accounts

Binance Accounts

main

main

  • API Key: abc123...xyz
  • Secret: secret123...key
  • Description: Primary trading account
  • API Key: abc123...xyz
  • Secret: secret123...key
  • Description: Primary trading account

futures-keys

futures-keys

  • API Key: futures789...def
  • Secret: futuressecret...uvw
  • Description: Futures trading account
undefined
  • API Key: futures789...def
  • Secret: futuressecret...uvw
  • Description: Futures trading account
undefined

Agent Behavior

Agent行为规范

  1. Credentials requested: Mask secrets (show last 5 chars only)
  2. Listing accounts: Show names and environment, never keys
  3. Account selection: Ask if ambiguous, default to main
  4. When doing a transaction in mainnet, confirm with user before by asking to write "CONFIRM" to proceed
  5. New credentials: Prompt for name, environment, signing mode
  1. 被请求提供凭证时:对密钥脱敏(仅展示最后5位)
  2. 列出账户时:展示名称和环境,绝不展示密钥
  3. 账户选择:存在歧义时询问用户,默认选择main账户
  4. 在主网执行交易前,要求用户输入"CONFIRM"确认后再继续
  5. 新增凭证时:提示用户提供名称、环境、签名模式

Adding New Accounts

新增账户

When user provides new credentials:
  • Ask for account name
  • Store in
    TOOLS.md
    with masked display confirmation
当用户提供新凭证时:
  • 询问账户名称
  • 存储到
    TOOLS.md
    中,并向用户确认脱敏后的展示内容

Signing Requests

请求签名

For trading endpoints that require a signature:
  1. Build query string with all parameters, including the timestamp (Unix ms).
  2. Percent-encode the parameters using UTF-8 according to RFC 3986.
  3. Sign query string with secretKey using HMAC SHA256, RSA, or Ed25519 (depending on the account configuration).
  4. Append signature to query string.
  5. Include
    X-MBX-APIKEY
    header.
Otherwise, do not perform steps 3–5.
对于需要签名的交易端点:
  1. 构建包含所有参数的查询字符串,包括时间戳(Unix毫秒级)。
  2. 按照RFC 3986规范使用UTF-8对参数进行百分号编码。
  3. 使用secretKey对查询字符串进行签名,支持HMAC SHA256、RSA或Ed25519(取决于账户配置)。
  4. 将签名追加到查询字符串中。
  5. 添加
    X-MBX-APIKEY
    请求头。
不需要签名的请求无需执行3-5步。

User Agent Header

User-Agent请求头

Include
User-Agent
header with the following string:
binance-alpha/1.0.0 (Skill)
See
references/authentication.md
for implementation details.
请求中需携带
User-Agent
头,值为:
binance-alpha/1.0.0 (Skill)
实现细节请参考
references/authentication.md