The official Java connector for Binance APIs, designed for backend applications and services running on the JVM.
The connector provides a modular and idiomatic Java interface to Binance APIs, supporting REST APIs, WebSocket APIs and WebSocket Streams. It includes built-in request signing, connection management, and strongly typed request and response models to help you build reliable and maintainable integrations.
For source code, issues, and release notes, see the binance-connector-java repository on GitHub.
Supported environments
- Java 11 or newer
- Backend Java applications and JVM-based services
This connector is intended for server-side usage only.
Package structure
The Java connector is published as a set of product-specific artifacts.
Each Binance product is distributed as an independent dependency (for example binance-sdk-spot),
allowing you to include only the APIs you need. This modular structure keeps dependencies minimal
and makes upgrades and integrations easier to manage.
Typical use cases
- Trading and execution services
- Real-time and historical market data ingestion
- Backend services managing accounts, balances, and orders
- Applications consuming WebSocket APIs or WebSocket Streams for low-latency 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
- Consistent and idiomatic Java API design
Getting started
Install the dependency for the product you want to integrate with:
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 each package’s 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