Examples
Basics
Most-read docs for common Python, C++, and Rust use cases.
Advanced applications
Develop systematic strategies and algorithmic trading applications.
Can't find an example for your use case? Our team can help. Contact support or join our Slack community to chat with developers.
Equities
Equities: Introduction
Get started with equities data by fetching top-of-book quotes and last sale.
Equities
Historical
Top pre-market movers
Get a ranking of the biggest gainers in the Nasdaq pre-market session.
Equities
Historical
Find average spread for a symbol
Find the average spread for a symbol across the different equity venues.
Equities
Historical
Calculate synthetic NBBO from prop feeds
Consolidate MBP-1 from prop feeds to get an improved microprice vs. SIP NBBO.
Historical
Get daily closing prices for equities
Retrieve the official consolidated closing prices for US equities.
Historical
Analyze auction imbalance dynamics
Compare the closing auction process for different US equity exchanges.
Historical
Futures
Futures: Introduction
Get started with futures and symbology. Volumes, tick size, expirations, and more.
Futures
Historical
Volume, open interest, and settlement prices
Retrieve volume, open interest, and settlement prices from the statistics schema.
Futures
Historical
Futures trading hours
Get trading hours for a futures product.
Futures
Historical
Get options chain for a futures product
Get daily, weekly, and monthly options for a futures product.
Futures
Historical
Determine publishing times for statistics
Discover when different types of statistics are published for an instrument.
Futures
Historical
Indices
Indices: Introduction
Get started with index data from the Databento Core Indices dataset.
Indices
Historical
Implied SPX index from ES futures curve
Estimate an S&P 500 spot proxy from the front two ES contracts.
Indices
Futures
Historical
Filter options by moneyness
Calculate moneyness across the SPXW chain and set a volatility-adjusted strike range.
Indices
Options
Historical
Filter SPXW strikes by VIX-implied expected move
Interpolate the VIX to set a volatility-adjusted strike range for SPXW expirations.
Indices
Options
Historical
Options
Equity options: Introduction
Get started with stock options data. Fetch options chains, strikes, expirations, NBBO.
Options
Historical
Options on futures: Introduction
Get started with options on futures data. Fetch options chains, strikes, expirations.
Options
Historical
All options with a given underlying
Find all the quarterly, monthly (serial), weekly, and daily options of an underlying.
Options
Historical
Join options with underlying prices
Get front month outright options and join with the latest underlying futures quotes.
Options
Historical
US equity options volume by venue
Compare volume across all venues in the US equity options market using pandas.
Options
Historical
Resample US equity options NBBO
Fetch NBBO and downsample to 1-minute intervals for all options in a chain.
Options
Historical
Estimate implied volatility
Compute and graph implied volatility from options prices.
Options
Historical
Get symbols for 0DTE options
Get a list of 0DTE options for a product.
Options
Historical
Live
Daily statistics for equity options
Calculate volume and open interest for an equity options chain.
Options
Historical
Get end of day option spreads
Calculate end of day options spread by expirations.
Options
Historical
Live data
Handle multiple record types
Handle different record types using callbacks.
Live
Stream live data to a file
Write and save live data to a file.
Live
Estimate Databento feed latency
Get time between our servers and your real-time application.
Live
Calculate TICK and TRIN indicators
Compute market TICK and TRading INdex on real-time trades.
Live
Subscribe to MBO snapshot
Get the latest order book state without replaying the entire trading session.
Live
Compare on-exchange and off-exchange trade volume
Compare the volumes of the different venues of Nasdaq Basic with NLS Plus.
Live
Historical data
Programmatic batch downloads
Request and download batch files programmatically.
Historical
Best bid, best offer, and midprice
Calculate midprice using BBO from MBP-1 or TBBO data.
Historical
Custom OHLCV bars from trades
Resample trades data to construct custom OHLCV bars.
Historical
Join schemas on instrument ID
Augment price data with instrument definitions by joining on instrument ID.
Historical
Plot a candlestick chart
Visualize OHLCV data on a candlestick chart.
Historical
Calculate VWAP and RSI
Compute the volume-weighted average price and relative strength indicator.
Historical
End-of-day pricing and portfolio valuation
Get mark-to-market valuation of a portfolio at end of day.
Historical
Benchmark portfolio performance
Calculate metrics like risk-adjusted return and Sharpe ratio of a portfolio.
Historical
Market halts, volatility interrupts, and price bands
Handle trading halts using status messages.
Historical
Resample OHLCV from 1-minute to 5-minute
Forward-fill gaps from intervals with no trades, then resample to 5-minute bars.
Historical
Convert DBN to other encoding formats
Request data in DBN format and convert to CSV, JSON, or Parquet.
Historical
Request a large number of symbols
Get multiple symbols or a firehose of all symbols traded on a venue.
Historical
Symbology
Continuous contracts
Get symbols by lead month and handle rollovers using continuous symbology.
Futures
Historical
Parent symbology
Get all symbols with the same product root or option chains using parent symbology.
Historical
Symbology mapping for live data
Convert between instrument IDs and raw symbols.
Live
Dataset symbols
Get all symbols available in a dataset.
Historical
Live
Instrument definitions
Find most liquid instruments
Find most active instruments using instrument definitions and OHLCV data.
Historical
Handling tick sizes
Convert prices and spread size to tick units.
Historical
Find ICE intercommodity spreads
Find ICE intercommodity futures spreads from leg definitions.
Historical
Displaying fractional prices
Render prices in the venue's own fractional convention, such as 108'185.
Historical
Computing tick value and contract notional
Derive the value of one tick and the notional value of a contract.
Historical
Order book
Types of order book events
Learn how Databento normalizes MBO data from an order’s life cycle (e.g., Add, Fill).
Historical
State management of resting orders
Manage state of all orders to calculate BBO. Precursor to order book construction.
Historical
Limit order book construction
A complete order book implementation. Use MBO data to build the limit order book.
Historical
Microprice and book imbalance
Common predictors using order book data.
Historical
Queue position of an order
Use MBO data to get an accurate position of any order within a price level.
Historical
Algorithmic trading

A high-frequency liquidity-taking strategy
Implement simulated trading (paper trading) using live data.
Live
Build prediction models with machine learning
Construct alpha signals using Databento and regression models from sklearn.
Historical
Execution slippage and markouts
Plot markout curves for transaction cost analysis and measuring execution quality.
Historical
Matching engine latencies
Measure matching engine and feed latency with nanosecond, PTP timestamps.
Historical
Using messaging rates as a proxy for implied volatility
Determine and compare implied volatility (IV) and messaging rates.
Historical
Mean reversion and portfolio optimization
Fetch cross-sectional returns. Build a mean reversion strategy and optimal portfolios.
Historical

Pairs trading based on cointegration
A cross-venue pairs trading strategy between WTI (CME) and Brent (ICE) crude.
Historical
Build a real-time stock screener
Build a live stock screener for all U.S. equity tickers.
Historical
Live
Corporate actions
Security master
Enrich instrument definitions
Use the security master to enrich instrument definitions.
Historical
Listings and delistings
Track security listings, delistings and symbology changes across time with the security master point-in-time (PIT) records.
Historical
Market capitalization change
Combine daily close prices with shares outstanding to analyze changes in market capitalization over time.
Historical