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.
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:
- Open the listing page of the dataset that you want to download.
- Click the CLI tab.
- Fill in the Command Line Generator form.
- Select or .
- Copy the CLI command that the form displays.
- Open a terminal in your organization workspace and then run the command.
- 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 .
If there is no CLI tab, you can't download the dataset.
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 │ ├───────────────────────────┼─────────┼────────────────────────┼────────────┼─────────┤ │ Binance Crypto Price Data │ CoinAPI │ Data type: Trade │ 32 │ 800 QCC │ │ │ │ Ticker: BTCBUSD │ │ │ │ │ │ Resolution: Second │ │ │ │ │ │ Start date: 2022-05-05 │ │ │ │ │ │ End date: 2022-06-05 │ │ │ └───────────────────────────┴─────────┴────────────────────────┴────────────┴─────────┘ Total price: 800 QCC Organization balance: 1,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:
- Log in to the CLI if you haven't done so already.
- Open a terminal in one of your organization workspace directories.
- Run
lean data download
to start an interactive downloading wizard. - Go through the interactive wizard to configure the data you want to download.
- 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
- In the browser window that opens, read the CLI API Access and Data Agreement and click .
- 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:
- Open a terminal in one of your organization workspace directories.
- Run
lean data download
to start an interactive downloading wizard and then 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
- Enter the dataset number.
$ lean data download Select a dataset: 1) Binance Crypto Future Margin Rate Data 2) Binance Crypto Future Price Data 3) Binance Crypto Price Data 4) Binance US Crypto Price Data 5) Bitcoin Metadata 6) Bitfinex Crypto Price Data 7) Brain Language Metrics on Company Filings 8) Brain ML Stock Ranking 9) CFD Data 10) Coinbase Crypto Price Data 11) Composite Factor Bundle 12) Cross Asset Model 13) FOREX Data 14) Insider Trading 15) Kraken Crypto Price Data 16) NFT Sales 17) Tactical 18) US Congress Trading 19) US ETF Constituents 20) US Equities 21) US Equity Coarse Universe 22) US Equity Options 23) US Equity Security Master 24) US Federal Reserve (FRED) 25) US Futures 26) US Futures Security Master 27) US Index Options 28) US SEC Filings 29) US Treasury Yield Curve 30) VIX Central Contango 31) VIX Daily Price Enter an option: 20
If you don't have an active subscription to the US Equity Security Master, you'll get the following error message:
- Enter the data type.
$ lean data download Data type: 1) Trade 2) Quote 3) Bulk Enter an option: 1
- Enter the ticker(s).
$ lean data download Ticker(s) (comma-separated): SPY
- Enter the resolution.
$ lean data download Resolution: 1) Tick 2) Second 3) Minute 4) Hour 5) Daily Enter an option: 3
- 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
- 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
- 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 .
- 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.
Supported Datasets
To view all of the supported datasets, see the Dataset Market.