Crypto exchange API guides for developers
How exchange APIs work, how to create and protect keys, and exchange-by-exchange Python notes on signing, test environments, rate limits and WebSocket streams.
Short answer: A crypto exchange API lets software read market data and, with a signed request, act on your own account. Most integrations need the same pieces: a key with limited permissions, request signing, rate limit handling and a WebSocket stream for live data. Signing and test environments differ by exchange, so check the platform's own documentation before you build.
Start with what a crypto API is and how an integration is put together, then read the notes for the platform you use. The later groups cover rate limits, error codes, live order books and shared libraries such as CCXT.
The guides describe each platform's official documentation, read on the date given in each guide, and do not recommend one over another. Availability depends on your jurisdiction and each platform's terms. For readers in Turkey, Article 99/A of Capital Markets Law No. 6362 treats activity by foreign crypto-asset platforms directed at Turkish residents as unauthorized.
- Start here
- Exchange by exchange, in Python
- Decentralized exchanges and swap APIs
- Rate limits and errors
- Live streams and order books
- Prices and historical data
- Test environments
- Orders in detail
- Order state and partial fills
- Several exchanges behind one interface
- At a glance
- Calculators
Start here: keys and how an integration works
What the different kinds of crypto API do, how an integration is put together, and how to create, sign with and protect a key.
- What is a crypto API? Exchange, data and wallet APIsNovember 5, 2026 · 10 min readWhat is a crypto API? Exchange, market data, node and wallet, and payment APIs explained, what an API key can do, free versus paid, and the rules that apply.
- Crypto exchange API integration: REST, WebSocket, limitsUpdated November 5, 2026 · 13 min readCrypto exchange API integration explained: REST vs WebSocket, request signing, clock sync, rate limits, client order IDs, retries and testnets.
- Binance API key: how to create one, plus 7 other exchangesNovember 5, 2026 · 13 min readHow to create a Binance API key, plus Coinbase, Kraken, Bybit, OKX, KuCoin, Bitget and MEXC: dated steps from official pages, permissions, IP rules and errors.
- Binance API key setup: permissions, IP rules and rotationNovember 6, 2026 · 13 min readBinance API key setup, checked 6 November 2026: where to create it, each permission, IP and expiry rules, HMAC vs Ed25519, a tested key check and leak steps.
- API key security for trading bots: permissions, storageUpdated November 5, 2026 · 13 min readAPI key security for trading bots: trade-only permissions, no withdrawals, IP allowlists, one key per bot, secret storage, rotation, safe logs, leak response.
- Ed25519 API key: create, sign and migrate off HMACNovember 6, 2026 · 13 min readEd25519 API key guide: generate the pair, register the public key, sign Binance requests, fix -1022 and -2015 errors and move a bot off HMAC.
Exchange by exchange, in Python
Hosts, signing, test environments, rate limits and WebSocket notes from each platform's own documentation, in alphabetical order.
- Binance API documentation: base URLs, testnets, conflictsNovember 6, 2026 · 13 min readBinance API documentation, read 6 November 2026: where Spot, futures, options and portfolio margin docs live, base URLs, testnets, SDKs and conflicts.
- Binance API Python trading bot: a testnet-first guideUpdated November 5, 2026 · 17 min readBinance API Python guide on the Spot Testnet: exchange filters, Ed25519 signed requests, test and live orders, order status, user data stream, error codes.
- BingX API in Python: signing, VST demo and error codesNovember 6, 2026 · 13 min readBingX API Python guide, docs read 6 Nov 2026: X-BX-APIKEY and HMAC signing, rate limits, error codes, the VST demo host and tested code.
- Bitget API in Python: UTA v3 signing, demo and WebSocketNovember 6, 2026 · 13 min readBitget API Python guide, docs read 5 Nov 2026: four ACCESS headers, HMAC signing, demo trading with paptrading, WebSocket URLs, rate limits, tested code.
- Bitvavo API Python: signing, weight limits and error codesNovember 6, 2026 · 13 min readBitvavo API in Python, read 6 Nov 2026: HMAC signing, operatorId, the 1,000-point weight limit, error codes, the WebSocket order book and tested code.
- Bybit API in Python: V5 signing, testnet and rate limitsNovember 5, 2026 · 13 min readBybit API Python guide for V5: testnet and demo hosts, HMAC signing, order calls, rate limits, the too many visits error and a tested WebSocket order book.
- Coinbase Advanced Trade API in Python: JWT, orders, limitsNovember 5, 2026 · 13 min readCoinbase Advanced Trade API Python guide: ES256 JWT signing, tested public and sandbox calls, the official SDK, rate limit facts and what the sandbox misses.
- Crypto.com API: Exchange v1 keys, signing and limitsNovember 6, 2026 · 13 min readCrypto.com Exchange API v1, read 6 Nov 2026: API key setup, the exact HMAC signing string, rate limits that conflict, the UAT sandbox and tested Python.
- Deribit API Python: testnet, API keys and rate limitsNovember 6, 2026 · 13 min readDeribit API in Python, tested on test.deribit.com: JSON-RPC over HTTP and WebSocket, API keys and scopes, heartbeats, book sync and credit limits.
- Gate.io API in Python: v4 signing, TestNet and WebSocketNovember 6, 2026 · 13 min readGate.io API v4 in Python, docs read 5 Nov 2026: HMAC-SHA512 signing, the 60-second clock window, TestNet hosts, rate limits, WebSocket, tested code.
- Kraken API in Python: nonce, signing and rate limitsNovember 5, 2026 · 13 min readKraken API Python guide: API-Sign test vector, nonce rules, rate limit exceeded errors, Spot UAT and the futures demo status, Derivatives auth and WebSocket v2.
- Kraken Futures API: Authent, PF_ symbols and demo statusNovember 6, 2026 · 13 min readKraken Futures API read 5 Nov 2026: REST map with costs, Authent and challenge signing tested, PF_ symbols after the inverse delisting, demo status.
- OKX API in Python: passphrase, demo trading and limitsNovember 5, 2026 · 13 min readOKX API Python guide: key and passphrase, Base64 HMAC signing, demo trading with x-simulated-trading, error 50119, rate limits, WebSocket and the API Agreement.
- Turkish crypto exchange APIs: BtcTurk, Binance TR, ParibuUpdated November 5, 2026 · 13 min readTurkish crypto exchange APIs from official docs: BtcTurk, Binance TR, Paribu, OKX TR, Bybit, Bitlo and Bitexen base URLs, signing, rate limits and API terms.
Decentralized exchanges and swap APIs
On decentralized exchanges and swap services, an order or a swap is signed with a wallet key, even where the service also issues an API key for access to its servers.
Rate limits and errors
What to do when a request is rejected: error codes, key and permission problems, nonces and rate limits.
- Kraken API invalid nonce: causes and multi-process fixesNovember 6, 2026 · 13 min readKraken API invalid nonce explained from Kraken's own pages: why shared keys, retries and clock steps break the nonce, and fixes tested across processes.
- Binance API error codes: -1021, -1022, -2015 and fixesNovember 5, 2026 · 12 min readBinance API error codes: what -1021, -1022, -2015, 429, 418 and 451 mean, what to check first, and a signing and clock check tested on the Spot Testnet.
- API rate limit exceeded: fixes for 12 crypto exchangesNovember 6, 2026 · 13 min readAPI rate limit exceeded? Limits, scopes, exact error codes and penalties for 12 crypto exchanges from their official docs, plus a tested Python fix.
- Binance API rate limit: weights, order counts and bansNovember 5, 2026 · 13 min readBinance API rate limit: Spot 6,000 and USD-M 2,400 request weight a minute (read 4 Nov 2026), per-account order counts, 429 and 418 bans, tested Python tracker.
- Token bucket rate limiter in Python, with measured 429sNovember 6, 2026 · 13 min readA token bucket rate limiter in Python for exchange APIs: thread, asyncio and multi-process code, weights, Retry-After, and real 429 counts from a local mock.
- Exponential backoff with jitter in Python: tested retriesNovember 6, 2026 · 13 min readExponential backoff with jitter in Python: full, equal and decorrelated formulas simulated, strict Retry-After parsing, and safe retries for timed-out orders.
Live streams and order books
Streams and reconnects, what order book data contains and how to keep a live book correct when a connection drops.
- Local order book via WebSocket: snapshot and diff syncUpdated November 5, 2026 · 14 min readHow to maintain a local order book from WebSocket streams: Binance snapshot plus diff sync, update IDs, gap detection, Kraken checksums, tested Python.
- Level 2 order book data: free feeds, depth limits, costsNovember 6, 2026 · 13 min readLevel 2 order book data explained: L1 vs L2 vs L3, free depth limits of five crypto APIs read 6 Nov 2026, gap recovery, data terms and stock L2 fees.
- WebSocket heartbeat and reconnect in Python for tradingNovember 6, 2026 · 13 min readWebSocket heartbeat vs ping pong, five exchanges' documented timers against measured ones, a tested Python reconnect loop with a stale-feed watchdog and jitter.
- Binance WebSocket API and streams: limits and reconnectsNovember 5, 2026 · 12 min readBinance WebSocket Streams and WebSocket API compared: URLs, limits, ping and pong, 24-hour disconnects, serverShutdown and a reconnect loop tested on testnet.
- Binance API user data stream: listenKey, subscribe, eventsNovember 6, 2026 · 13 min readBinance API user data stream: Spot listenKey retired (HTTP 410), userDataStream.subscribe, USD-M listenKey, events and Python tested on a local mock.
- MEXC WebSocket API in Python: protobuf and Blocked errorsNovember 6, 2026 · 13 min readMEXC WebSocket in Python, tested 5 November 2026: why subscriptions return Blocked, compiling the protobuf files, decoding streams and depth versions.
- Order book imbalance formula: OBI, OFI and edge casesNovember 6, 2026 · 13 min readOrder book imbalance formula: (bid - ask) / (bid + ask) by levels or price band, weighted variants, how OFI differs, and tested Python for the edge cases.
Prices and historical data
Current prices and past candles, trades and funding rates come from exchange endpoints, price aggregators, bulk files and paid data vendors, each with its own limits and terms.
- Crypto price API: live, historical and OHLCV dataNovember 5, 2026 · 12 min readCrypto price API guide: exchange endpoints, aggregators and tick vendors, pricing checked in November 2026, tested Python for OHLCV candles, gaps and licenses.
- Crypto historical data download: sources, caps, licensesNovember 6, 2026 · 13 min readCrypto historical data download: exchange candle caps and bulk files tested 6 Nov 2026, the license each source states, and Python that writes a checked CSV.
- Binance historical data API: REST klines vs zip archivesNovember 6, 2026 · 13 min readBinance historical data API, tested 5 November 2026: klines paging, intervals, USD-M mark price candles, data.binance.vision zips, checksums, microseconds.
- Funding rate history API: open interest, liquidation dataNovember 6, 2026 · 13 min readFunding rate history API by venue, tested 5 Nov 2026: rows, page limits and traps, Binance's one-month open interest limit, why liquidation feeds undercount.
Test environments
What each platform offers for testing without real money, from its own documentation.
- Binance Futures testnet API key: two hosts, one demo marketNovember 6, 2026 · 13 min readBinance Futures testnet API key as of 5 November 2026: creating it on demo.binance.com, demo-fapi vs the old host, the SDK, and tested Python code.
- Coinbase sandbox: Exchange vs Advanced Trade vs CheckoutsNovember 6, 2026 · 13 min readCoinbase sandbox explained: the Exchange sandbox login, keys and fake funds, the mocked Advanced Trade sandbox, Checkouts, and what each one can prove.
- KuCoin sandbox in 2026: status and Python API testingNovember 6, 2026 · 13 min readIs there a KuCoin sandbox? Status checked 5 November 2026, and how to test the KuCoin API in Python: signing, order test, rate limits and WebSocket drops.
Orders in detail
The order fields and types that cause most rejected or duplicated orders.
- Client order ID: idempotent orders on exchanges and FIXNovember 6, 2026 · 13 min readClient order ID rules compared: Binance, Bybit, Coinbase, Kraken, OKX, Hyperliquid, Alpaca and FIX tag 11, the retry trap after a fill, and tested Python.
- Time in force: GTC, IOC, FOK and post only in trading APIsNovember 6, 2026 · 13 min readTime in force explained: GTC, IOC, FOK, GTD and post only mapped across seven exchange APIs and FIX tag 59, with failure behavior and a tested Python mapper.
- Reduce only order: meaning, rejections and API fixesNovember 6, 2026 · 13 min readReduce only order meaning, why reduceOnly orders are rejected on Binance, Bybit and others, error codes -2022 and -4118, and a tested Python fix flow.
- OCO order: how it works and how to place one by APINovember 6, 2026 · 13 min readOCO order meaning with an example, Binance Spot POST /api/v3/orderList/oco, USD-M conditional orders in the Algo Service, and a tested Python emulation.
- Iceberg order: display size, refills and API fieldsNovember 6, 2026 · 13 min readIceberg order explained: display size, why a refill loses queue priority on CME, hidden vs iceberg, and crypto API fields by venue, read 6 November 2026.
- TWAP order: how slicing works, API fields and tested codeNovember 6, 2026 · 13 min readTWAP order explained: how a parent order is sliced, TWAP vs VWAP, native API fields on five venues, what happens on failure, and a tested Python slicer.
Order state and partial fills
An order moves through states from sent to filled, canceled, rejected or expired, and its fills can arrive in parts, late or more than once, so trading software has to track each step.
- Order state machine: FIX states, late fills and testsNovember 6, 2026 · 13 min readOrder state machine for trading code: FIX OrdStatus precedence, Binance, Bybit and Kraken statuses, unknown orders, late fills and tested Python.
- Partial fill: what it means and how to track it in codeNovember 6, 2026 · 13 min readA partial fill executes only part of an order. How Binance, Bybit, Kraken, Coinbase, Alpaca, IBKR and FIX report fills (6 Nov 2026), with tested Python.
Several exchanges behind one interface
When a shared library such as CCXT is enough, and when a direct integration is the better fit.
- CCXT Python: building a multi-exchange trading botUpdated November 5, 2026 · 15 min readCCXT Python guide: unified markets, fetch_ticker, fetch_ohlcv, precision helpers, sandbox mode, rate limits, errors, CCXT Pro streams and a tested bot skeleton.
- CCXT rate limit and error handling: what is safe to retryNovember 6, 2026 · 13 min readCCXT rate limit and error handling in release 4.5.92: what rateLimit does, which exceptions are safe to retry, why orders are not, and a tested wrapper.
Signing and test environments at a glance
Private requests are signed differently from one platform to the next: HMAC over a defined string on some, a short-lived JWT or a wallet signature on others. Test environments differ too, and the crypto exchange API comparison holds the full table with the date each row was read; it is not a ranking or a recommendation.
Calculators
- HMAC signature generator: debug exchange API signingBuild the exact string an exchange signs, see it byte by byte, get the HMAC in hex and Base64 and compare it with yours. Never paste a live secret into any website, this one included: the tool loads a published sample key. Free, no sign-up required.
- API rate limit calculator: budget weights and requestsEnter your API's limit, its window and what your program calls to see the share used per window, the headroom, the largest symbol count that fits and a backoff schedule. Every number is yours. Free, no sign-up required.
- Crypto trading fee calculator: maker, taker and slippageEnter the trade size, your maker and taker rates, the share of maker fills, slippage and round trips per month to see what trading costs per round trip and per month. Free, no sign-up required.
From Fincode
- Crypto exchange API comparisonFincodeCrypto exchange API comparison from official docs: signing, rate limits, WebSocket limits, test environments and FIX for 13 platforms, dated 5 November 2026.
- Exchange API integration checklistFincodeAn exchange API integration checklist with tests: permissions, signing, clock sync, rate limits, client order IDs, retries, partial fills and reconciliation.
- Crypto exchange API changes: a dated logFincodeDated log of API changes from official changelogs since 1 September 2026, including the Binance API changelog, with who is affected and a source link.
- Crypto trading glossary: API and trading software termsFincodeGlossary of 262 crypto trading and API terms: keys, REST, WebSocket, FIX, rate limits, orders, fills, market data, risk controls, testing and regulation.
- Crypto exchange API integration servicesServiceConnect crypto exchange APIs to your app, bot or internal tool: market data, orders and balances, with rate-limit handling, retries, logs and documentation.
- Turkish crypto exchange API connectorsServiceAPI connectors for BtcTurk and other platforms on Turkey's Capital Markets Board list, for foreign fintechs. API terms are checked before we quote.
- Subcontract crypto API and trading software development for agenciesServiceExchange connectors, rule-based trading modules and TradingView bridges built as subcontract work for software agencies, with written scope and test reports.
- API key handling and security practicesFincodeHow Fincode software handles exchange API keys: read and trade permissions only, no withdrawal rights, IP restriction, your own server by default.
Frequently asked questions
What is an API key in crypto, and should it have withdrawal permission?
An API key identifies your software to an exchange and sets what it may do. Trading software needs read and trade permissions only: keep withdrawal permission off, restrict the key by IP where the platform allows it, and use one key per bot.
When is WebSocket needed instead of REST?
REST suits request and response work such as placing orders, reading balances and fetching history. WebSocket suits streams such as the live order book and fills.
CCXT or the exchange's API directly?
CCXT is quick for common features across many exchanges. A direct integration fits when you need features or streams the library does not cover.
These guides are general information about software and markets, not investment, legal or tax advice. Automated trading can lose money, past or backtested performance does not guarantee future results, and the rules that apply depend on your jurisdiction and your exchange's terms.
Other guides
Send a short project brief
The form or an email is enough. You do not need to share your rules yet.
- The exchange or platform you use
- What the software should do
- Your target timeline
- Project briefs and business inquiriesinfo@fincodelabs.com
- WhatsApp (messages only)+90 545 697 41 15 (opens in a new tab)