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"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
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
Export the Python project
Every project exports
strategy.py,market_data.py,brokers.pyandlive.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format. - 3
Plug in Bitfinex
Implement the four adapter methods (
account,positions,submit_market_orderand 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
- Kraken API Built into AlgoGPLong-running, US-available crypto exchange with granular API key permissions and public OHLC data.
- Bitstamp API GuideOne of the oldest regulated crypto exchanges (now part of Robinhood), with a v2 REST API, public OHLC and HMAC-signed trading.
- OKX API Built into AlgoGPMajor crypto exchange with a V5 REST and WebSocket API for spot, perpetuals, futures and options, plus demo trading.
- Binance API Built into AlgoGPThe largest crypto exchange by volume, with a deep public market-data API and a free spot testnet.
Frameworks that connect to Bitfinex
Independent guide. AlgoGP is not affiliated with Bitfinex. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.