---
title: "Key Concepts"
description: "Downloading data by the ticker is the ideal, low cost option to aquiring local trading data."
canonical: https://www.quantconnect.com/docs/v2/lean-cli/datasets/quantconnect/key-concepts
markdown: https://www.quantconnect.com/docs/v2/lean-cli/datasets/quantconnect/key-concepts.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/05%20Lean%20CLI/05%20Datasets/05%20QuantConnect/01%20Key%20Concepts
modified: 2026-11-14
index: https://www.quantconnect.com/llms.txt
---

# Key Concepts

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

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

## Introduction

To locally run the LEAN engine, you need local data. We recommend you source local data from our [Dataset Market](https://www.quantconnect.com/datasets), so you can use the same data that is available to your algorithm when you run it in the cloud. There are two methods of downloading data. You can download smaller, discrete datasets by ticker at a low cost or download complete datasets in bulk to avoid selection bias. You download the data through the CLI or LEAN in exchange for [QuantConnect Credit](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/credit.md) (QCC) or a data subscription. Before the CLI or LEAN downloads new files, they check if your local machine already stores the files.

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.

## Data Type

You can acquire local data in bulk or by ticker. The method you choose affects how you pay for the data and which data types you receive.

### Bulk

When you download a dataset in bulk, you subscribe to it and download the full dataset with daily updates for one year. After that year, subscribe to the cheaper updates package to keep your local copy current for another year. Bulk downloads include every data type the dataset provides.

### By Ticker

When you download by ticker, you download only the tickers you select and pay [QuantConnect Credit](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/credit.md) (QCC) per file. Some datasets provide up to three data types: **Trade**, **Quote**, and **Open Interest**. These data types are not mandatory, but to reproduce the same results as QuantConnect Cloud, download all the data types that the dataset provides.

## Using the CLI

You can download datasets with the CLI using the non-interactive mode or the interactive mode.

### Non-Interactive Mode

Follow these steps to download datasets with the non-interactive mode of the CLI:

1. Open the [listing page of the dataset](https://www.quantconnect.com/docs/v2/cloud-platform/datasets/navigating-the-market.md#02-View-All-Listings) that you want to download.
2. Click the **CLI** tab.
   If there is no **CLI** tab, you can't download the dataset.
3. Fill in the Command Line Generator form.
4. Select **Windows** or **Unix**.
5. Copy the CLI command that the form displays.
6. Open a terminal in your [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) and then run the command.
7. If you haven't already agreed to the CLI API Access and Data Agreement, in the browser window that opens, read the document and click **I Accept The Data Agreement**.

The CLI displays a summary of your purchase and the download progress.

```
Data that will be purchased and downloaded:
┌─────────────┬──────────┬────────────────────────┬────────────┬────────┐
│ Dataset     │ Vendor   │ Details                │ File count │ Price  │
├─────────────┼──────────┼────────────────────────┼────────────┼────────┤
│ US Equities │ AlgoSeek │ Data type: Trade       │ 3          │ 15 QCC │
│             │          │ Ticker: SPY            │            │        │
│             │          │ Resolution: Minute     │            │        │
│             │          │ Start date: 2023-01-01 │            │        │
│             │          │ End date: 2023-01-05   │            │        │
└─────────────┴──────────┴────────────────────────┴────────────┴────────┘
Total price: 15 QCC
Organization balance: 10,000 QCC

Data Terms of Use has been signed previously.
Find full agreement at: https://www.quantconnect.com/terms/data/?organization=<organizationId>
==========================================================================
CLI API Access Agreement: On 2022-04-12 22:34:26 You Agreed:
- Display or distribution of data obtained through CLI API Access is not permitted.
- Data and Third Party Data obtained via CLI API Access can only be used for individual or internal employee's use.
- Data is provided in LEAN format can not be manipulated for transmission or use in other applications.
- QuantConnect is not liable for the quality of data received and is not responsible for trading losses.
==========================================================================

 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% (32/32)
```

### Interactive Mode

Follow these steps to download datasets with the interactive mode of the CLI:

1. [Log in](https://www.quantconnect.com/docs/v2/lean-cli/initialization/authentication.md#02-Log-In) to the CLI if you haven't done so already.
2. Open a terminal in one of your [organization workspace directories](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md).
3. Run `lean data download` to start an interactive downloading wizard.
4. Go through the interactive wizard to configure the data you want to download.
5. After configuring the data you want to download, enter **N** when asked whether you want to download more data.

   ```
   $ lean data download
   Selected data:
   ...
   Total price: 10 QCC
   Organization balance: 10,400 QCC
   Do you want to download more data? [y/N]: N
   ```
6. In the browser window that opens, read the CLI API Access and Data Agreement and click **I Accept The Data Agreement**.
7. Go back to the terminal and confirm the purchase to start downloading.

   ```
   $ lean data download
   You will be charged 10 QCC from your organization's QCC balance
   After downloading all files your organization will have 10,400 QCC left
   Continue? [y/N]: y
   [1/1] Downloading equity/usa/daily/spy.zip (10 QCC)
   ```

Many of the datasets depend on the [US Equity Security Master](https://www.quantconnect.com/datasets/quantconnect-us-equity-security-master) dataset because the US Equity Security Master contains information on splits, dividends, and symbol changes. To check if a dataset depends the US Equity Security Master, see the listing in the [Dataset Market](https://www.quantconnect.com/datasets). If you try to download a dataset through the CLI that depends on the US Equity Security Master and you don't have an active subscription to it, you'll get an error.

For example, follow these steps to download US Equity data from the Dataset Market:

1. Open a terminal in one of your [organization workspace directories](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md).
2. Run `lean data download` to start an interactive downloading wizard and then select **QuantConnect** to list the categories in the [Dataset Market](https://www.quantconnect.com/datasets).

   ```
   $ lean data download
   Select a historical data provider:
   1) Interactive Brokers
   2) Oanda
   3) Bitfinex
   4) Coinbase Advanced Trade
   5) Binance
   6) Kraken
   7) CharlesSchwab
   8) IQFeed
   9) Polygon
   10) FactSet
   11) AlphaVantage
   12) CoinApi
   13) ThetaData
   14) QuantConnect
   15) Local
   16) Quant Bridge
   17) Bybit
   18) TradeStation
   19) Alpaca
   20) Tastytrade
   21) Eze
   22) dYdX
   23) Databento
   Enter an option: 14
   ```
3. Enter the dataset category number.

   ```
   $ lean data download
   Select a category:
   1) Commerce Data (3 datasets)
   2) Consumer Data (2 datasets)
   3) Energy Data (2 datasets)
   4) Environmental Data (1 dataset)
   5) Financial Market Data (30 datasets)
   6) Industry Data (1 dataset)
   7) Legal Data (2 datasets)
   8) News and Events (4 datasets)
   9) Political Data (2 datasets)
   10) Transport and Logistics Data (1 dataset)
   11) Web Data (9 datasets)
   Enter an option: 5
   ```
4. Enter the dataset number.

   ```
   $ lean data download
   Select a dataset:
   1) Bitcoin Metadata
   2) Brain Language Metrics on Company Filings
   3) Brain ML Stock Ranking
   4) CFD Data
   5) Composite Factor Bundle
   6) Cross Asset Model
   7) FOREX Data
   8) Insider Trading
   9) International Future Universe
   10) NFT Sales
   11) Tactical
   12) US Congress Trading
   13) US ETF Constituents
   14) US Equities
   15) US Equity Coarse Universe
   16) US Equity Option Universe
   17) US Equity Options
   18) US Equity Security Master
   19) US Future Option Universe
   20) US Future Options
   21) US Future Universe
   22) US Futures
   23) US Futures Security Master
   24) US Index Option Universe
   25) US Index Options
   26) US Interest Rate
   27) US SEC Filings
   28) US Treasury Yield Curve
   29) VIX Central Contango
   30) VIX Daily Price
   Enter an option: 13
   ```

   If you don't have an active subscription to the US Equity Security Master, you'll get the following error message:

   `Your organization needs to have an active Security Master subscription to download data from the 'US Equities' datasetYou can add the subscription at https://www.quantconnect.com/datasets/quantconnect-security-master/pricing`
5. Enter the data type.

   ```
   $ lean data download
   Data type:
   1) Trade
   2) Quote
   3) Bulk
   Enter an option: 1
   ```
6. Enter the ticker(s).

   ```
   $ lean data download
   Ticker(s) (comma-separated): SPY
   ```
7. Enter the resolution.

   ```
   $ lean data download
   Resolution:
   1) Tick
   2) Second
   3) Minute
   4) Hour
   5) Daily
   Enter an option: 3
   ```
8. If you selected tick, second, or minute resolution in the previous step, enter the start and end date.

   ```
   $ lean data download
   Start date (yyyyMMdd): 20230101
   End date (yyyyMMdd): 20230105
   ```
9. Review your selected data and enter whether you would like to download more data.

   ```
   $ lean data download
   Selected data:
   ┌─────────────┬──────────┬────────────────────────┬────────────┬────────┐
   │ Dataset     │ Vendor   │ Details                │ File count │ Price  │
   ├─────────────┼──────────┼────────────────────────┼────────────┼────────┤
   │ US Equities │ AlgoSeek │ Data type: Trade       │ 3          │ 15 QCC │
   │             │          │ Ticker: SPY            │            │        │
   │             │          │ Resolution: Minute     │            │        │
   │             │          │ Start date: 2023-01-01 │            │        │
   │             │          │ End date: 2023-01-05   │            │        │
   └─────────────┴──────────┴────────────────────────┴────────────┴────────┘
   Total price: 15 QCC
   Organization balance: 10,000 QCC
   Do you want to download more data? [y/N]: n
   ```
10. If you haven't already agreed to the CLI API Access and Data Agreement, in the browser window that opens, read the document and click **I Accept The Data Agreement**.
11. Confirm your data purchase.

    ```
    $ lean data download
    Data Terms of Use has been signed previously.
    Find full agreement at: https://www.quantconnect.com/terms/data/?organization=<organizationId>
    ==========================================================================
    CLI API Access Agreement: On 2022-04-12 22:34:26 You Agreed:
    - Display or distribution of data obtained through CLI API Access is not permitted.
    - Data and Third Party Data obtained via CLI API Access can only be used for individual or internal employee's use.
    - Data is provided in LEAN format can not be manipulated for transmission or use in other applications.
    - QuantConnect is not liable for the quality of data received and is not responsible for trading losses.
    ==========================================================================

    You will be charged 15 QCC from your organization's QCC balance
    After downloading all files your organization will have 9,985 QCC left
    Continue? [y/N]: y
    ```
   After you confirm your data purchsae, the CLI downloads the data and prints its progress.
   ```
   $ lean data download
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% (3/3)
   ```

## Using Lean

For more information about using LEAN to download datasets, see [Download Datasets During Backtests](https://www.quantconnect.com/docs/v2/lean-cli/backtesting/deployment.md#04-Download-Datasets-During-Backtests).

## Supported Datasets

To view all of the supported datasets, see the [Dataset Market](https://www.quantconnect.com/datasets).
