Repolode
bmoscon

bmoscon/cryptofeed

Python library that streams normalized real-time market data (trades, order books, tickers) from many cryptocurrency exchanges over websockets.

Stars
2,973
Forks
783
Open issues
2
Last commit
2 days ago

Repolode describes open-source projects and does not give investment advice. Trading and investing can lose money: assess the risk yourself and follow the laws where you live before using this project.

What is it?

Cryptofeed connects to many cryptocurrency exchanges and delivers their market data in a single normalized format. You register async callbacks for channels such as trades, L1/L2/L3 order books, tickers, funding, open interest, liquidations and candles, and the library calls them with consistent objects regardless of which venue the data came from. It prefers websockets and falls back to REST polling when an exchange has no websocket feed.

The library covers a long list of spot, perpetual and dated futures venues, including Binance, Coinbase, Kraken, OKX, Bybit and Hyperliquid. Symbols follow a shared naming scheme, and prices and sizes are returned as Decimal values. A synthetic NBBO feed can aggregate best bid and ask across several exchanges.

For storage, cryptofeed includes backends for Redis, Kafka, PostgreSQL, MongoDB, InfluxDB, QuestDB and ClickHouse, among others. It can also record raw traffic to pcap files for later replay. Requires Python 3.13 or newer.

Key features

  • 01Normalized trade, book, ticker, funding and liquidation objects across exchanges
  • 02Websocket-first connections with REST polling fallback
  • 03Synthetic NBBO feed aggregating best bid and offer from several venues
  • 04Built-in backends for Redis, Kafka, PostgreSQL, InfluxDB, ClickHouse and more
  • 05Record market data to pcap files and replay them later

Use cases

  • Collecting live order book and trade data from several exchanges for quantitative research
  • Feeding real-time market data into a trading system or strategy engine
  • Building a market data warehouse in ClickHouse, QuestDB or PostgreSQL
  • Recording exchange traffic for offline replay and backtesting

Quick start

  1. 1

    Install cryptofeed from PyPI (requires Python 3.13+)

    pip install cryptofeed
  2. 2

    Create a FeedHandler, add exchange feeds with symbols and channels, then run it

Things to know

  • Requires Python 3.13 or newer.
  • Licensed under AGPL, a copyleft license with obligations for networked use.

Topics

FAQ

What is cryptofeed?
Python library that streams normalized real-time market data (trades, order books, tickers) from many cryptocurrency exchanges over websockets. Cryptofeed connects to many cryptocurrency exchanges and delivers their market data in a single normalized format. You register async callbacks for channels such as trades, L1/L2/L3 order books, tickers, funding, open interest, liquidations and candles, and the library calls them with consistent objects regardless of which venue the data came from. It prefers websockets and falls back to REST polling when an exchange has no websocket feed.
Is cryptofeed free to use? What license does it have?
cryptofeed is open source under the Other license. Check the license terms before using it in commercial products.
Is cryptofeed still maintained?
Actively maintained. The last commit to cryptofeed was on Nov 6, 2026.
What can I use cryptofeed for?
Collecting live order book and trade data from several exchanges for quantitative research Feeding real-time market data into a trading system or strategy engine Building a market data warehouse in ClickHouse, QuestDB or PostgreSQL Recording exchange traffic for offline replay and backtesting
How do I install cryptofeed?
Install cryptofeed from PyPI (requires Python 3.13+): pip install cryptofeed Create a FeedHandler, add exchange feeds with symbols and channels, then run it
Where can I get cryptofeed?
The source code and installation instructions are on GitHub: https://github.com/bmoscon/cryptofeed

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects