Providers
Dejavu is a new product, as such data providers are currently limited. Expect this list to grow over time as the package becomes more mature.
dejavu.data.feeds.binance.BinanceRESTFeed
¶
Bases: RESTDataFeed
Binance is one the world's largest Crypto market places. Whether you're interested in Crypto or not, Binance can be a helpful starting point for getting familiar with Dejavu due to low-cost of data access compared to more traditional entrypoints.
Binance provide numerous base_urls, these are documented here If you wish to change the base_url you can do so easily:
binance_feed = BinanceRESTFeed(symbols=['BTCUSDT'], interval='1m')
binance_feed.base_url = 'https://api4.binance.com'
Errors you may encounter when using this feed
- Users may experience a number of HTTP errors when fetching data from Binance. One of the most perplexing ones is HTTP Error 451. Which typically occurs if you're calling this function from a region where Binance services are restricted.
__init__(symbols, interval, total_limit=2000)
¶
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbols
|
list[str]
|
List of Symbols to fetch, e.g. ["BTCUSDT", "ETHUSDT"] |
required |
interval
|
BinanceSupportedIntervals
|
Candle interval, e.g. "1m", "5m", "1h", etc. See Binance docs for supported intervals. |
required |
total_limit
|
int
|
Total number of candles to fetch per symbol. Defaults to 2000. |
2000
|
stream()
¶
Bridges async → sync so the backtest engine works out of the box.
supports_asset_class(asset_class)
¶
Override if the feed only supports certain asset classes. Default: all supported.
dejavu.data.feeds.alpha_vantage.AlphaVantageRESTFeed
¶
Bases: RESTDataFeed
Alpha Vantage REST API feed.
Supports intraday (⅕/15/30/60 min) and periodic (daily/weekly/monthly) intervals for equities, FX, and crypto.
Note: Alpha Vantage has strict rate limits (5 calls/minute, 500 calls/day for the free tier). Intraday endpoints typically require a paid subscription — check the Alpha Vantage docs to confirm your API key has the necessary permissions.
Example:
equity_feed = AlphaVantageRESTFeed(
api_key="YOUR_KEY",
symbols=["IBM", "AAPL"],
asset_class=AssetClass.EQUITY,
interval=AlphaVantageIntradayInterval.FIVE_MINUTES,
)
forex_feed = AlphaVantageRESTFeed(
api_key="YOUR_KEY",
symbols=["EUR/USD"],
asset_class=AssetClass.FX,
interval=AlphaVantagePeriodicInterval.WEEKLY,
)
feed = CombinedDataFeed(equity_feed, forex_feed)
__init__(api_key, symbols, asset_class, interval, total_limit=2000)
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api_key
|
str
|
Your Alphavantage API key. Usually stored as an environment variable. |
required |
symbols
|
list[str]
|
The list of symbols you wish to return. Note, they must be within the same asset class. |
required |
asset_class
|
AssetClass
|
The asset class of the data you're returning. |
required |
interval
|
AlphaVantageInterval
|
Your time interval for the data, eg. 1min, weekly, etc. |
required |
total_limit
|
int
|
|
2000
|
stream()
¶
Bridges async → sync so the backtest engine works out of the box.