This PowerShell script downloads all your documents from your Scalable Capital account.
The script automates the process of downloading every document available in your Scalable Capital mailbox. It first fetches a complete list of all documents and then downloads them one by one into a local downloads folder. If a file already exists, it will be skipped to avoid re-downloading.
- Windows PowerShell
- An active Scalable Capital account
-
Run the script: Open a PowerShell terminal, navigate to the directory containing the script, and run it:
.\Download-Documents.ps1 -
Enter your credentials: The script will prompt you to enter your
userIdandappSessiontoken. See the section below on how to obtain these values. -
Download: The script will create a
downloadsfolder in the same directory and start downloading all your documents. Existing files will be skipped.
To get the required userId and appSession values, you need to log in to your Scalable Capital account in a web browser and use the developer tools to inspect the network traffic.
-
Log in to your Scalable Capital account in your browser (e.g., Chrome, Firefox, Edge).
-
Open Developer Tools: Press
F12orCtrl+Shift+I(orCmd+Option+Ion Mac) to open the developer tools. -
Go to the Network tab: Click on the "Network" tab within the developer tools.
-
Find a GraphQL request: While the Network tab is open, refresh the page or navigate around your account. Look for requests made to a URL ending in
/graphql. You can use the filter bar in the network tab to search forgraphql. -
Inspect the request: Click on one of these
graphqlrequests to open its details.- To find the
userId: Look at the "Payload" or "Request" tab. You will find theuserIdwithin the request body. - To find the
appSession: Look at the "Headers" tab. Under "Request Headers", find theCookieheader. TheappSessionvalue is part of the cookie string.
Copy both values and paste them into the terminal when the script prompts you.
- To find the