Download By Ticker

Key Concepts

Introduction

Downloading data by the ticker is the ideal, low-cost option to acquiring local trading data if you don't need an entire universe. This technique is for smaller, discrete downloads. You can download our ticker data through the CLI or LEAN in exchange for some QuantConnect Credit (QCC). Before the CLI or LEAN download new files, they check if your local machine already stores the files.

To use the CLI, you must be a member in an organization on a paid tier.

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 that you want to download.
  2. Click the CLI tab.
  3. If there is no CLI tab, you can't download the dataset.

  4. Fill in the Command Line Generator form.
  5. Select Windows or Unix.
  6. Copy the CLI command that the form displays.
  7. Open a terminal in your organization workspace and then run the command.
  8. 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 to the CLI if you haven't done so already.
  2. Open a terminal in one of your organization workspace directories.
  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 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. 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.
  2. Run lean data download to start an interactive downloading wizard and then select QuantConnect to list the categories in the Dataset Market.
    $ 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) Terminal Link
    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' dataset
    You 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
  12. 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.

Supported Datasets

To view all of the supported datasets, see the Dataset Market.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: