The official Rust connector for Binance APIs, designed for backend applications and services written in Rust.
The connector is published as a single crate (binance-sdk). You enable the Binance products you
need using Cargo features (for example spot). It supports REST APIs, WebSocket APIs and WebSocket
Streams, and provides built-in request signing, connection management, and strongly typed request
and response models.
For source code, issues, and release notes, see the binance-connector-rust repository on GitHub.
Supported environments
- Rust 1.86 or newer (stable toolchain)
- Backend Rust applications and services
This connector is intended for server-side usage only.
Package structure
The Rust connector is published as a single crate with product modules behind feature flags.
Enable the products you want in Cargo.toml (for example spot,
derivatives_trading_usds_futures, wallet etc.), then import the corresponding module in your
code. This keeps dependencies minimal and avoids pulling in APIs you don’t use.
Typical use cases
- Low-latency trading and execution services
- High-throughput market data ingestion
- Backend services managing accounts, balances, and orders
- Applications consuming WebSocket APIs or WebSocket Streams for real-time updates
Key features
- Support for Binance REST APIs, WebSocket APIs and WebSocket Streams
- Built-in request signing for authenticated endpoints
- WebSocket connection handling with automatic reconnection and session renewal
- Strongly typed request and response models
- Support for both production and testnet environments
- Memory-safe and performant Rust API design
Getting started
Enable the product feature you want under binance-sdk:
Code
Create a client and send a request:
Code
The example above uses asymmetric key authentication. HMAC-based authentication using an API secret is also supported.
Refer to the crate documentation for product-specific REST, WebSocket API and WebSocket Streams examples.
Notes and best practices
- Store API keys securely using environment variables or a secrets manager
- Prefer WebSocket APIs or Streams for real-time data instead of polling REST endpoints
- Monitor rate limits and endpoint weights when building high-throughput services
- Use testnet environments when developing and validating integrations