canonical: https://jentic.com/apis/binance.com/binance

# Binance Public Spot API

The Binance Public Spot API is the programmatic interface to Binance's spot exchange, exposing 340 endpoints covering market data, spot trading, margin, sub-accounts, savings, futures-related lookups, fiat on-ramps, C2C, NFT, and Binance Pay. It supports the standard exchange order lifecycle - place, query, cancel, list - with order types including market, limit, OCO, OTO, and SOR-routed orders, plus margin borrow and repay, isolated and cross margin, and account information lookups. Authentication is by API key in the X-MBX-APIKEY header for trading and account endpoints, with HMAC-SHA256 request signing required for signed endpoints.

## For AI agents

Place spot and margin trades, pull market data, manage Binance accounts and sub-accounts, and access savings, futures lookups, NFT, and Binance Pay across 340 endpoints.

## Scope

Does not handle Binance Futures USD-M perpetual order placement (covered by a separate Futures API), KYC, or fiat banking - use for spot, margin, savings, sub-account, and Pay operations on the spot exchange only.

## Capabilities

- Place, query, and cancel spot orders including OCO, OTO, and SOR-routed order lists
- Read market data: kline/candlestick bars, order book depth, recent trades, and 24-hour ticker statistics
- Borrow, repay, and manage cross and isolated margin positions and account state
- Manage sub-accounts and inter-account transfers from a parent account
- Subscribe to and renew user-data streams for real-time order and balance updates
- Run wallet operations: deposit and withdrawal history, asset transfers, and capital flow lookups
- Access savings, simple earn, auto-invest, crypto loans, NFT, and Binance Pay endpoints from one credential set

## Use cases

### Algorithmic Spot Trading

Quant teams and trading bots place and manage spot orders programmatically. The Binance API exposes POST /api/v3/order for new orders, DELETE /api/v3/order for cancels, GET /api/v3/openOrders for live state, and OCO and SOR variants for advanced strategies. Combined with /api/v3/klines and /api/v3/depth for market data, it covers a full algorithmic loop. A direct integration has to implement HMAC signing and, for live fill notifications, a websocket user-data stream.

Example prompt: Place a LIMIT BUY order on BTCUSDT for 0.01 BTC at 60000 USDT via POST /api/v3/order, then poll GET /api/v3/order to confirm fill status.

### Cross and Isolated Margin Trading

Traders running cross-margin or isolated-margin strategies need borrow, repay, and order endpoints in one place. Binance exposes POST /sapi/v1/margin/borrow-repay for borrowing, POST /sapi/v1/margin/order for margin orders, and /sapi/v1/margin/account or /sapi/v1/margin/isolated/account for state. This avoids stitching together multiple platforms when running leveraged strategies.

Example prompt: Borrow 1000 USDT on cross margin via POST /sapi/v1/margin/borrow-repay with type=BORROW, then place a leveraged BUY order via POST /sapi/v1/margin/order on BTCUSDT.

### Treasury and Sub-Account Management

Funds and operations teams use Binance sub-accounts to segregate strategies and managed accounts. The API exposes the sub-account management surface and wallet endpoints to move assets between the parent and sub-accounts and to pull capital-flow history for reporting.

Example prompt: Pull cross-margin capital flow via GET /sapi/v1/margin/capital-flow for the last seven days and reconcile against the local treasury ledger.

### Market Data Pipelines for Research

Research teams need historical and current market data across many symbols. Binance exposes /api/v3/klines, /api/v3/aggTrades, /api/v3/historicalTrades, and /api/v3/exchangeInfo for symbol and rule discovery. These endpoints are public and unsigned, so a backfill pipeline can be built without API-key plumbing.

Example prompt: For BTCUSDT, fetch one year of 1d klines via repeated GET /api/v3/klines calls and write each batch to local storage for backtesting.

### AI Agent Trading and Reporting Assistant via Jentic

An AI assistant can place orders, monitor positions, and produce P&L reports from natural-language requests routed through Jentic. The X-MBX-APIKEY and HMAC secret are held in your Jentic One instance, so the agent never sees the raw credentials, and Jentic returns the right Binance operation when the user asks something like "sell 0.5 BTC at market". Going through Jentic replaces the hand-written credential and signing plumbing a direct integration needs.

Example prompt: Search Jentic for 'place a Binance spot order', load the POST /api/v3/order schema, and execute it as a MARKET SELL of 0.5 BTC on BTCUSDT.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /api/v3/order | Place a new spot order |
| DELETE | /api/v3/order | Cancel a spot order |
| GET | /api/v3/openOrders | List open orders |
| GET | /api/v3/account | Retrieve account information including balances |
| GET | /api/v3/klines | Fetch candlestick market data |
| GET | /api/v3/depth | Fetch order book depth |
| POST | /sapi/v1/margin/order | Place a margin order |
| POST | /sapi/v1/margin/borrow-repay | Borrow or repay on margin |

## Key resources

- **Market** — Public endpoints for ping, server time, exchange info, depth, trades, klines, and tickers
- **Trade** — Spot order placement, cancellation, and lookup including OCO, OTO, and SOR routing
- **Margin** — Cross and isolated margin borrow, repay, orders, and account state
- **Wallet** — Deposit, withdrawal, and transfer operations for assets across the account
- **Sub-Account** — Manage sub-accounts and parent-to-sub asset transfers
- **Stream** — Open and renew user-data streams for live updates over websocket
- **Savings, Simple Earn, Auto-Invest** — Yield products attached to the Binance account
- **Pay, Gift Card, Convert** — Binance Pay, Gift Card, and asset conversion endpoints

## Why Jentic

- **Setup:** Wiring the Binance Public Spot API by hand means attaching your API key and HMAC-signing every request with your secret, tracking timestamps and recvWindow across spot, margin, and savings surfaces yourself. Through Jentic you install once, import the Binance Spot API from the API Directory, store the key and secret once, and your agent calls it.
- **Permission scoping:** Binance passes the trading symbol and order parameters in the query and body rather than a path segment, so limit the agent to the operations it needs, such as reading klines, depth, or the account. You choose that set, so placing or cancelling orders and margin borrow-repay are not reachable unless you include them.
- **Credential handling:** Your Binance API key and HMAC secret are stored once, encrypted, by your own Jentic One instance and injected at call time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'place a Binance spot order' or 'get the order book depth', and Jentic returns the matching Binance operation with its input schema and signature requirements so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Kraken** — US- and EU-friendly crypto exchange API with comparable spot and margin scope
- **Bitfinex** — Crypto exchange API with strong margin and derivatives support
- **OKX** — Crypto exchange API with unified trading and derivatives surface
- **Bitstamp** — Long-running EU-regulated crypto exchange API

## FAQ

### What authentication does the Binance Public Spot API use?

Trading and account endpoints require an API key in the X-MBX-APIKEY header, plus HMAC-SHA256 request signing using the matching secret. Public market-data endpoints like /api/v3/klines and /api/v3/depth do not require authentication. When called via Jentic, both the API key and the HMAC secret are held in your Jentic One instance so the agent never sees the raw credentials.

### Can I place spot and margin orders through the Binance API?

Yes. POST /api/v3/order places spot orders and supports MARKET, LIMIT, STOP_LOSS, and other order types, while POST /api/v3/orderList/oco places OCO order pairs. For margin trading, POST /sapi/v1/margin/order places cross or isolated margin orders, and POST /sapi/v1/margin/borrow-repay handles borrowing and repaying.

### What are the rate limits for the Binance Spot API?

Binance limits by IP rather than by API key, and its REST reference states this directly: 'The limits on the API are based on the IPs, not the API keys.' Each route carries a weight, and every response returns an X-MBX-USED-WEIGHT header for the interval showing how much of the allowance the IP has consumed. The current ceilings and weights live in the rateLimits array returned by GET /api/v3/exchangeInfo, covering RAW_REQUESTS, REQUEST_WEIGHT, and ORDERS. Unfilled order counts are tracked per account and can be read at GET /api/v3/rateLimit/order. Exceeding a limit returns a 429 with a Retry-After header, and continuing to send requests after that leads to an automated IP ban.

### Is there a Binance MCP server?

You don't need an MCP server to give your agent the Binance Public Spot API. Jentic connects it directly from the API Directory: install self-hosted Jentic One, add the API, store your key and secret once, and your agent can call any of the 340 operations. Because the instance runs on your own infrastructure, your rules decide which Binance operations the agent may reach, and the credentials stay in the instance instead of an agent-side config file.

### How do I place an order through Jentic?

Install self-hosted Jentic One on the machine that will host it, then run jentic register on the separate machine where your agent runs, and add the Binance Public Spot API to your workspace. Ask for 'place a Binance spot order' and Jentic returns POST /api/v3/order with its input schema, so the agent supplies symbol, side, type, quantity, and price and executes. Keep the agent off the instance's machine before you load real trading keys: an agent running as the same OS user as Jentic One can read its stored keys directly.

### Is the Binance Spot API free to use?

Binance charges trading commission per executed order, and GET /api/v3/account/commission returns the rates that actually apply for a symbol: a standardCommission and a taxCommission block, each carrying maker, taker, buyer, and seller rates, plus a discount block showing whether a discount is enabled for the account and the symbol and in which asset. Access itself comes from creating a key on the API Management page of a Binance account, and by default that key cannot trade, so trading has to be enabled there before any fee-bearing call will succeed.

### Can I subscribe to real-time order and balance updates?

Yes. The /api/v3/userDataStream-style endpoints in the Stream group open and renew user-data streams that deliver real-time order, balance, and position updates over websocket. The REST API issues the listen key, and the websocket connection is then opened against the streaming endpoint.

### Can I limit what my agent is allowed to do with the Binance Public Spot API?

Yes. Because Jentic One is self-hosted, you decide which Binance operations your agent may call, and Binance passes the trading symbol and order parameters in the query and body rather than a path segment, so you scope by operation. You can allow read-only calls such as GET /api/v3/klines, GET /api/v3/depth, and GET /api/v3/account while withholding order placement. Write operations like POST /api/v3/order, DELETE /api/v3/order, and margin borrow-repay via POST /sapi/v1/margin/borrow-repay stay unreachable unless you include them in the set the agent is permitted to use.
