Binance
ActiveCrypto — Major Exchanges
connectorType: "binance"Binance is the world's largest cryptocurrency exchange by trading volume, offering spot, futures, margin, and options trading across thousands of pairs. Barfinex provides full integration with Binance including real-time orderbook streaming, trade streaming, candle data, and order execution.
Connection Architecture
Binance
WebSocket / REST→
Connector
libs/exchange-binance→
Provider
:8081/api→
Detector
Advisor
Studio
The connector receives data from the exchange and feeds it to Provider (port 8081). From there — to Detector, Advisor, and Studio.
Technologies
Transport
WebSocketREST
Authentication
API Key + SecretData Format
JSONFeatures
Rate LimiterTestnet418/429 Protection
Best for
- Binance is the default choice for most automated strategies due to its unmatched liquidity and pair coverage.
- It suits high-frequency spot scalpers, perpetual futures trend-followers, and multi-leg arbitrage bots that need tight spreads across dozens of pairs simultaneously.
- Barfinex users running capital-efficiency backfills or live paper-trading sessions will find Binance data the most representative benchmark for global crypto markets.
Integration Features
Spot TradingYes
Futures TradingYes
Margin TradingYes
Orderbook StreamingYes
Trade StreamingYes
Candle StreamingYes
Historical DataYes
Order ExecutionYes
Testnet AvailableYes
Connect via code
1Environment variables (.env)
BINANCE_API_KEY=your_key_here BINANCE_API_SECRET=your_secret_here
2Connector configuration
// config/config.provider.json
{
"provider": {
"connectors": [
{
"connectorType": "binance",
"enabled": true,
"key": "${BINANCE_API_KEY}",
"secret": "${BINANCE_API_SECRET}",
"markets": [
{ "marketType": "spot", "symbols": [{ "name": "BTCUSDT" }] }
],
"subscriptions": [
{ "type": "PROVIDER_MARKETDATA_CANDLE", "symbols": ["BTCUSDT"], "intervals": ["min1", "h1"], "active": true },
{ "type": "PROVIDER_MARKETDATA_TRADE", "symbols": ["BTCUSDT"], "active": true },
{ "type": "PROVIDER_MARKETDATA_ORDERBOOK", "symbols": ["BTCUSDT"], "active": true }
]
}
]
}
}3Verify and query data
# Verify connection curl -H "Authorization: Bearer $PROVIDER_API_TOKEN" \ https://localhost:8081/api/exchanges/runtime-proof # Candles (last 7 days) curl -H "Authorization: Bearer $PROVIDER_API_TOKEN" \ "https://localhost:8081/api/candles/binance/spot/BTCUSDT/h1?days=7"
Available via Barfinex API
/api/candles/binance/...
/api/trades/binance/...
/api/orderbook/binance/...
/api/account/binance/...
/api/symbols/binance/...
/api/assets/binance/...
Studio graphical setup — in development, coming in the next release.
Important
Permissions required: Read Info + Spot Trading + Futures Trading (enable each separately in Binance API settings).
Rate limit: 1,200 requests/min on the REST endpoint; the Barfinex connector enforces backpressure automatically.
IP whitelist is strongly recommended — binding the API key to a static IP dramatically reduces risk of key theft.
Do not enable Withdrawals permission.
Futures and Spot keys are the same key-pair but Futures must be activated in your account before use.
Supported Markets
SpotFutures
Founded2017
HeadquartersGlobal (Cayman Islands)
Websitewww.binance.com
API DocumentationOpen