---
title: "Databento"
description: "Learn how to connect and feed data to a live algorithm from Databento in Lean CLI."
canonical: https://www.quantconnect.com/docs/v2/lean-cli/datasets/databento
markdown: https://www.quantconnect.com/docs/v2/lean-cli/datasets/databento.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/05%20Lean%20CLI/05%20Datasets/08%20Databento
modified: 2026-11-14
index: https://www.quantconnect.com/llms.txt
---

# Databento

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Lean CLI](https://www.quantconnect.com/docs/v2/lean-cli.md) > Datasets > Databento

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

Instead of using the data from QuantConnect or your brokerage, you can use Databento for historical data if you're deploying a local project. This page explains our integration with their API and its functionality. To use Databento, you need to [get an API key](https://databento.com/portal/keys).

To view the implementation of the Databento integration, see the [Lean.DataSource.Databento repository](https://github.com/QuantConnect/Lean.DataSource.Databento).

To use the CLI, you must be a member in an [organization](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/tier-features.md) on a paid tier.

## Supported Datasets

The Databento data provider serves asset price data directly from [Databento's API](https://databento.com/docs/). Our integration supports [US Futures](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/futures.md) securities. It only provides the security price data, so you need to download the [US Futures Security Master](https://www.quantconnect.com/datasets/quantconnect-us-futures-security-master) and the [US Futures Universe](https://www.quantconnect.com/datasets/quantconnect-us-futures-universe).

## Alternative Data

If you have licensed alternative data with QuantConnect, it works as expected with the Databento data provider for research, backtesting, and live trading.

## Download

To download Databento data, open a terminal in your [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) and then run `lean data download --data-provider-historical Databento --data-type Trade --resolution <resolution> --security-type Future --ticker <tickers> --market <market> --start <YYYYMMDD> --end <YYYYMMDD> --databento-api-key <apiKey>`.

```
$ lean data download --data-provider-historical Databento --data-type Trade --resolution Daily --security-type Future --ticker ES,ESH6,ESM6,ESU6,ESZ6 --market CME --start 20260101 --end 20260213 --databento-api-key apiKey
```

If you provide the canonical symbol (e.g., ES), all contracts for that symbol will be downloaded according to the [Future universe](https://www.quantconnect.com/datasets/quantconnect-us-future-universe) data. Alternatively, you can specify individual contracts (e.g., ESH6, ESM6, ESU6, ESZ6) to download only those contracts.

## Research

To access Databento data from the local Research Environment, open a terminal in your [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) and then run `lean research <projectName> --data-provider-historical Databento --databento-api-key <apiKey>`.

```
$ lean research "My Project" --data-provider-historical Databento --databento-api-key apiKey
```

Due to performance considerations, you may want to [download](https://www.quantconnect.com/docs/v2/lean-cli/datasets/databento.md#06-Download) the historical data before running the research environment.

## Backtesting

To run a local backtest with Databento data, open a terminal in your [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) and then run `lean backtest <projectName> --data-provider-historical Databento --databento-api-key <apiKey>`.

```
$ lean backtest "My Project" --data-provider-historical Databento --databento-api-key apiKey
```

Due to performance considerations, you may want to [download](https://www.quantconnect.com/docs/v2/lean-cli/datasets/databento.md#06-Download) the historical data before running the backtest.

## Optimization

Follow these steps to run a local optimization job with Databento data:

1. Add some [parameters](https://www.quantconnect.com/docs/v2/lean-cli/optimization/parameters.md) to your project.
2. Open a terminal in your [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md).
3. Run `lean optimize <projectName> --data-provider-historical Databento --databento-api-key <apiKey>`.
   ```
   $ lean optimize "My Project" --data-provider-historical Databento --databento-api-key apiKey
   ```
4. Follow [the steps in the interactive wizard](https://www.quantconnect.com/docs/v2/lean-cli/optimization/deployment.md#02-Run-Local-Optimizations) to configure your optimization job settings.

The `lean optimize` command also accepts additional [options](https://www.quantconnect.com/docs/v2/lean-cli/api-reference/lean-backtest.md#04-Options) so that you can select Alpha Vantage and run the command in non-interactive mode. If you provide any of the preceding options, your [Lean configuration file](https://www.quantconnect.com/docs/v2/lean-cli/initialization/configuration.md#03-Lean-Configuration) saves them so that you only need to run `lean optimize <projectName>` to run another optimization job with the same options.

Due to performance considerations, you may want to [download](https://www.quantconnect.com/docs/v2/lean-cli/datasets/databento.md#06-Download) the historical data before running the optimization.

## Live Trading

To deploy a local live algorithm that uses Databento as the historical and the live data provider, open a terminal in your [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) and then run `lean live deploy <projectName> --data-provider-historical Databento --data-provider-live Databento --databento-api-key <apiKey> --brokerage <brokerageName> <requiredBrokerageOptions>`.

```
$ lean live deploy "My Project" --data-provider-historical Databento --data-provider-live Databento --databento-api-key apiKey --brokerage "Paper Trading"
```

## Pricing

To view the prices of the Databento API packages, see the [Pricing](https://databento.com/pricing) page on the Databento website.
