API Directory › ₿ Cryptocurrency › Binance
No authHTTPSCORS

Binance API

Public market data from the Binance exchange — prices, order books and klines.

Auth
No auth needed
HTTPS
Yes
CORS
Yes
Open Binance docs ↗

What it does

Binance’s API exposes full spot, margin and futures trading plus deep market data. The public market-data endpoints — price ticker, order book, recent trades, candlesticks — need no account and are what most read-only apps use. Real-time streaming is available over WebSocket.

Base URL

https://api.binance.com

Authentication

Market data (/api/v3/ticker/*, /api/v3/klines, /api/v3/depth) is public. Account and trading endpoints need an API key in the X-MBX-APIKEY header plus an HMAC-SHA256 signature of the query string using your secret. Note api.binance.com is geoblocked in some countries (use api.binance.us there).

Code examples

curl (public)
curl -s "https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT"
curl -s "https://api.binance.com/api/v3/klines?symbol=ETHUSDT&interval=1h&limit=24"
Python (public candles)
import requests

r = requests.get("https://api.binance.com/api/v3/klines",
                 params={"symbol": "BTCUSDT", "interval": "1d", "limit": 7}, timeout=10)
for k in r.json():
    open_time, o, h, l, c = k[0], k[1], k[2], k[3], k[4]
    print(open_time, o, c)

Rate limits & quotas

Rate limits are weight-based per IP: roughly 6,000 request-weight per minute on spot, where a simple ticker costs 1–2 and a deep order book costs more. Order placement has a separate per-10-second and per-day count. Response headers (X-MBX-USED-WEIGHT-1M) track your usage; exceed it and you get HTTP 429, then a temporary IP ban (418) if you keep going.

Key response fields

priceLast trade price for the symbol
klines[][openTime, open, high, low, close, volume, closeTime, …]
bids / asksOrder book levels as [price, qty]
X-MBX-USED-WEIGHT-1MHeader: request weight consumed this minute

Common errors

429Rate-limit weight exceeded — back off immediately.
418IP auto-banned for ignoring 429s — wait out the ban.
401 / -2015Bad API key, IP not whitelisted, or wrong permissions.
400 / -1121Invalid symbol (must be e.g. BTCUSDT, no dash).

When to use it (and alternatives)

Best when you need exchange-grade real-time prices, order books or actual trading. For aggregated cross-exchange market data and metadata use CoinGecko or CoinPaprika; Kraken is a comparable exchange API.

FAQ

Do I need an API key for prices?

No. All the market-data endpoints under /api/v3/ (ticker, klines, depth, trades) are public. Keys are only for balances and trading.

How do rate limits work?

By weight, not request count. Each endpoint has a documented weight; you get about 6,000 weight per minute per IP on spot. Read X-MBX-USED-WEIGHT-1M and stop before you hit 429 — repeated 429s escalate to a timed IP ban (418).

Why do I get a 451 or connection block?

api.binance.com is not available in some jurisdictions. Use the regional host (e.g. api.binance.us) or an aggregator instead.

New to APIs?

Short guides for working with this API — and any other.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

Crypto PriceCryptoLarz app

Related Cryptocurrency APIs

← Back

More Cryptocurrency APIs · All 196 APIs