explaingit

binance/binance-spot-api-docs

4,782Audience · developerComplexity · 2/5Setup · moderate

TLDR

The official technical documentation for Binance's spot trading APIs, covering REST, WebSocket, FIX, and binary streaming connections, the authoritative reference for anyone building trading bots or apps on one of the world's largest crypto exchanges.

Mindmap

mindmap
  root((binance-spot-api-docs))
    API types
      REST API
      WebSocket API
      FIX protocol
      SBE streaming
    SDK connectors
      Python
      Node.js
      Go and Rust
    Use cases
      Trading bots
      Portfolio tracking
      Market data feeds
    Features
      Order management
      Fee calculation
      Testnet sandbox
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a cryptocurrency trading bot that places and manages orders on Binance's spot market using the REST API

USE CASE 2

Create a real-time portfolio tracker using WebSocket streams to receive live price and trade updates

USE CASE 3

Integrate Binance market data into a charting or analytics application without managing low-level connection details

USE CASE 4

Practice order management safely using the Binance testnet environment before trading with real funds

Tech stack

REST APIWebSocketFIX protocolSBEPythonNode.jsJavaGo

Getting it running

Difficulty · moderate Time to first run · 30min

Requires a Binance account and API key, a testnet environment is available for practicing without real funds.

No license information was provided in the documentation.

In plain English

This repository is the official documentation for Binance's spot trading APIs. Binance is one of the world's largest cryptocurrency exchanges, and this repo is where they publish the technical reference material that developers need to connect software to the exchange. If you are building a trading bot, a portfolio tracker, or any application that interacts with Binance's spot market, this is the authoritative source for how those connections work. The documentation covers several distinct ways to talk to the exchange. The REST API lets you send requests over standard web connections to place orders, check balances, and retrieve market data. The WebSocket API provides a persistent connection that pushes real-time updates to your application without needing to ask repeatedly. The FIX API is an older protocol used by professional trading firms. There are also streaming market data feeds in both standard and a compact binary format called SBE, which is designed for high-frequency use cases where every millisecond matters. Beyond the core spot market, the repo links out to documentation for Binance's other services: margin trading, futures contracts, options, wallet management, savings products, and more. Those live on Binance's developer portal rather than in this repo, but this README serves as a central index pointing to all of them. The FAQ section answers practical questions that come up frequently when using the API: how order types behave, how trading fees are calculated, how Binance prevents a user from accidentally trading against themselves, and how the exchange handles order limits. A set of connector libraries in Python, Node.js, Java, Go, Rust, and several other languages is listed here as well. These are thin wrappers that handle the low-level details of signing requests and managing connections, so developers do not have to implement those parts from scratch. A testnet environment is also available for anyone who wants to practice without using real funds.

Copy-paste prompts

Prompt 1
Using the Binance spot REST API, write Python code to place a market buy order for BTC/USDT, check my account balance first, and handle the HMAC signature authentication correctly.
Prompt 2
Show me how to connect to the Binance WebSocket API in Node.js to subscribe to real-time price updates for BTC/USDT and log each trade as it arrives.
Prompt 3
I am building a trading bot and need to understand Binance order types. Explain the difference between LIMIT, MARKET, STOP_LOSS, and OCO orders as described in the Binance spot API docs.
Prompt 4
How does Binance's self-trade prevention mechanism work, and how do I calculate the trading fee for a filled order using the API response fields?
Open on GitHub → Explain another repo

← binance on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.