Binance API
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
Example 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
Matrix Score Breakdown
Partially tested on Apr 5, 2026
Technical Specifications
Related Tags
Alternatives to Binance
Technical alternatives for different use cases.
US-regulated exchange API with fiat on/off ramps
US-based applications needing regulatory compliance
Advanced trading features and lower fees
Advanced trading API with lower fees than Coinbase
Professional trading bots with limit orders
Global market access and altcoin variety
Established exchange with strong security track record
Security-focused trading with staking support
Number of trading pairs and liquidity depth
Similar APIs
View All →Alchemy Ethereum
Alchemy Ethereum provides programmatic access to ethereum node-as-a-service provider via REST API.
BitcoinAverage
BitcoinAverage aggregates price data from dozens of global cryptocurrency exchanges to produce weighted average prices for Bitcoin and other digital assets.
Bitfinex
Bitfinex is a professional cryptocurrency exchange offering one of the most comprehensive trading APIs for both spot and margin markets.
Bitmex
BitMEX is a derivatives exchange specializing in perpetual swaps and futures contracts for Bitcoin and other cryptocurrencies.
Bittrex
Bittrex provides programmatic access to next generation crypto trading platform via REST API.