Guide
BrokerMarket dataCrypto API key

Bitfinex API guide

Bitfinex has been around since 2012 and is known for margin trading and its peer-to-peer funding market.

Last verified · Also known as Bitfinex API, Bitfinex v2 API

Quick answer

Bitfinex’s v2 API has public REST and WebSocket endpoints for tickers, books and candles, and authenticated endpoints signed with HMAC-SHA384 over /api/ + path + nonce + body. It also exposes margin funding (lending) endpoints that few exchanges offer, and a paper-trading sub-account for TEST pairs.

Bitfinex API at a glance

Pricing
Free API; trading fees apply
Availability
Global; not US residents
Paper trading
Paper trading sub-account (TEST pairs)
Integration type
REST + API key
In AlgoGP
Design and backtest in AlgoGP, connect the exported code
Auth
HMAC-SHA384, bfx-nonce / bfx-apikey / bfx-signature
Public host
https://api-pub.bitfinex.com/v2
Paper
Paper-trading sub-account (TEST pairs)

Public market data from Bitfinex

curl -s "https://api-pub.bitfinex.com/v2/candles/trade:1h:tBTCUSD/hist?limit=200&sort=1"
Hourly BTC/USD candles (keyless).

Save the bars as CSV and replay them with the exported python backtest.py --csv bars.csv, or use CCXT to read the same candles in one line of Python.

What to know before automating Bitfinex

  • Candle rows are [MTS, OPEN, CLOSE, HIGH, LOW, VOLUME].
  • Nonces must strictly increase per key; use one key per process.
  • Funding endpoints let a bot lend USD or USDt to margin traders, a popular automated strategy.

Build a Bitfinex strategy with AlgoGP

AlgoGP does not connect to Bitfinex natively yet. Bitfinex uses plain HTTPS with an API key, so it is a good candidate for a native adapter; it is not built in yet.

  1. 1

    Design and backtest in AlgoGP

    Describe the strategy to the copilot and backtest it on years of normalized history. The result does not depend on any vendor.

  2. 2

    Export the Python project

    Every project exports strategy.py, market_data.py, brokers.py and live.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format.

  3. 3

    Plug in Bitfinex

    Implement the four adapter methods (account, positions, submit_market_order and a candle fetcher) with Bitfinex’s SDK, or keep a built-in platform for paper trading and add Bitfinex when you go live.

Built-in brokers for the same markets: Alpaca, Binance, Kraken, Bybit.

Bitfinex API: frequently asked questions

Can US residents use the Bitfinex API?

No, Bitfinex does not serve US persons.

Design and backtest your Bitfinex strategy first

AlgoGP turns an idea into Python and tests it on years of history before you connect it to Bitfinex. The exported code keeps the broker behind four small adapter methods.

  • AI copilot writes and revises the rules
  • Backtests with realistic costs
  • Exported Python ready to wire to Bitfinex

Free plan, no card required.

Bitfinex alternatives

Independent guide. AlgoGP is not affiliated with Bitfinex. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.

Build a strategy