Barfinex
All exchanges
Interactive Brokers

Interactive Brokers

Coming SoonUS Brokers
connectorType: "ib"

Interactive Brokers is a multi-asset brokerage offering access to stocks, options, futures, forex, bonds, and funds across 150+ markets in 33 countries. Barfinex connects via the TWS/Gateway API.

Connection Architecture

Interactive Brokers
WebSocket / REST
Connector
libs/exchange-interactive-brokers
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
TWS Gateway
Data Format
JSON
Features
Local Gateway RequiredMulti-Asset

Best for

  • Built for professional and institutional traders who need access to equities, options, futures, and bonds from a single automated platform.
  • Supports complex multi-leg options strategies, cross-market hedging, and systematic futures trading.
  • Ideal for portfolio managers and quant funds running diversified automated strategies across US and global markets.
  • The breadth of asset classes makes IB the strongest choice for multi-asset algorithmic portfolios.

Connect via code

1Environment variables (.env)

IB_GATEWAY_URL=your_gateway_url_here
IB_ACCOUNT_ID=your_account_here

2Connector configuration

// config/config.provider.json
{
  "provider": {
    "connectors": [
      {
        "connectorType": "ib",
        "enabled": true,

        "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/ib/spot/BTCUSDT/h1?days=7"

Available via Barfinex API

/api/candles/ib/...
/api/trades/ib/...
/api/orderbook/ib/...
/api/account/ib/...
/api/symbols/ib/...
/api/assets/ib/...

Studio graphical setup — in development, coming in the next release.

Important

Interactive Brokers does NOT use API key/secret authentication.
You must have IB Gateway or Trader Workstation (TWS) running locally and authenticated with your IB credentials before Barfinex can connect.
IB_GATEWAY_URL typically points to localhost (e.g., http://localhost:4001).
Market data subscriptions must be activated separately on the IB account portal — unsubscribed symbols return delayed or empty data.
Paper trading requires a separate IB Paper Trading account (different credentials from your live account).
US equities: regular session 09:30–16:00 ET; extended hours available but liquidity varies significantly.
Supported Markets
SpotFuturesMargin
Founded1978
HeadquartersGreenwich, USA
Connect in Studio(soon)
Exchange Website

Let’s Get in Touch

Have questions or want to explore Barfinex? Send us a message.