How do I use the API File Provider?

Ensuring a high data quality is one of the hardest parts of setting reliable backtesting. There are many challenges to ensuring your data is in the right format, free of errors or omissions and historically accurate. We’ve tried to address this for you by opening the LEAN Data Library and letting you download our data. LEAN data is organized into millions of tiny files which can be difficult to put into place manually; but using the API File Provider we provide a way for you to automatically install this into your LEAN project.

Currently we provide forex and cfd data for each of the major vendors we support in tick, second, minute, hour and daily resolution. To request data; go to your data library and specify what you’d like to download.

Data library collection for FXCM EURUSD data

Each data file has a unique URL to download thedata for the day which will get a LEAN formatted CSV zip. By using the API File Downloader we check if you have the filein your data-folder; and if not we attempt to download it from the API. This assumes you have already added the data to your repository through the web interface.

This requires 2 key changes to the config.json file in the QuantConnect.Lean.Launcher Project:

  1. Insert your job-user-id and api-access-token into the relevant config fields. You can find these on your Account page.
  2. Update the data-provider configuration to refer to the APIDataProvider class. This is called QuantConnect.Lean.Engine.DataFeeds.ApiDataProvider.

Check out the video below where we guide you step by step through how to use the API Data Provider.


By: Jared Broad

Founder & CEO

img Back to Blog

Related Articles

algorithmic trading

Living Our Mission 🚀

By: Jared Broad • 20.09.2022

Pioneering a Free Market for Alpha

By: Jared Broad • 17.07.2019

IB Gateway Automation

By: Alex Otsu • 28.05.2019 lean report creator

LEAN’s Tear Sheet – The LEAN Report Creator

By: Jared Broad • 26.06.2018 lean

R-Support, Visual Studio Integration, Python Updates – LEAN Release Notes v2.4.0.1

By: Stefano Raggi • 08.08.2017