Binance API

⭐ Beginner's Pick Cryptocurrency / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

Binance Spot API provides real-time and historical market data for thousands of cryptocurrency trading pairs on the world's largest crypto exchange by volume. Public endpoints — including order book depth, recent trades, and candlestick (kline) data — require no authentication, while account endpoints for placing orders require an API key and HMAC-SHA256 request signing. Developers use it to build trading bots, charting tools, and portfolio management apps.

💡

Beginner Tip

Public market data endpoints like `/api/v3/ticker/price` need no API key at all — great for learning. Only trading and account endpoints need authentication. The WebSocket streams (wss://stream.binance.com:9443) are often easier than polling the REST API for real-time prices.

Available Data

coin price in USD/EUR
market capitalization
24h price change
trading volume
circulating supply
stock price and symbol

Example Response

JSON Response
{
  "id": "bitcoin",
  "symbol": "btc",
  "current_price": 65432.1,
  "market_cap": 1280000000000,
  "price_change_24h": 1250.5,
  "price_change_percentage_24h": 1.95,
  "total_volume": 28500000000
}

Field Reference

symbol Trading pair identifier (e.g., "BTCUSDT" means Bitcoin priced in USDT).
price Current last traded price as a decimal string — parse to float for arithmetic.
openTime Start of the current 24-hour rolling window in milliseconds since epoch.
priceChangePercent 24-hour price change as a percentage (positive = price up, negative = price down).
volume Total base asset volume traded in the last 24 hours.
count Number of trades executed in the 24-hour window.

Implementation Example

const url = "https://github.com/binance/binance-spot-api-docs";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

-1100 Illegal characters in parameter The symbol parameter uses lowercase or incorrect formatting (e.g., "btcusdt" instead of "BTCUSDT").
All trading pair symbols must be uppercase: use "BTCUSDT", "ETHUSDT", etc.
-1121 Invalid symbol The requested trading pair does not exist on Binance Spot.
Query `GET /api/v3/exchangeInfo` to get the full list of valid symbols and confirm the pair you want is listed.
-1022 Signature for this request is not valid The HMAC-SHA256 signature is calculated incorrectly when using authenticated endpoints.
Ensure you sign the full query string (including `timestamp`) with your secret key before appending `&signature=...`. Use a library like `crypto` in Node.js to generate the HMAC correctly.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 10/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Cryptocurrency
Difficulty Intermediate
Verified: 2026-04-04

Alternatives to Binance

Technical alternatives for different use cases.

US-regulated exchange API with fiat on/off ramps

Better For

US-based applications needing regulatory compliance

Trade-off

Advanced trading features and lower fees

Advanced trading API with lower fees than Coinbase

Better For

Professional trading bots with limit orders

Trade-off

Global market access and altcoin variety

Established exchange with strong security track record

Better For

Security-focused trading with staking support

Trade-off

Number of trading pairs and liquidity depth

Similar APIs

View All →