Tutorials

Authentication

Introduction

Some of the Lean CLI commands need to communicate with the QuantConnect API. If you use any commands which interact with the cloud you must log in using your QuantConnect account so the CLI can send authenticated API requests.

Logging in

Follow these steps to log in to your QuantConnect account with the CLI:

  1. Navigate to your QuantConnect Account page and click "Request Email With Token and Your User-Id for API Requests" under the Security section. After clicking on this link your user-id and API token are sent to your email address.
  2. Retrieve your user-id and API token from the email you registered on QuantConnect.
  3. Run lean login to login to the CLI, and enter your user-id and token when prompted. This command opens an interactive wizard asking you for your user-id and API token.
    $ lean login
    Your user id and API token are needed to make authenticated requests to the QuantConnect API
    You can request these credentials on https://www.quantconnect.com/account
    Both will be saved in C:\Users\john\.lean\credentials
    User id: 123456
    API token: ******************
    Successfully logged in

Logging out

Run lean logout to log out. This command removes the global configuration file containing your user id and API token.

Checking status

Run lean whoami to see the name and email address of the user who is currently logged in.

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

Did you find this page helpful?

Contribute to the documentation: