- Import account transactions
- Import account balances
- Import account positions
- Automatically refresh access tokens
- Open a new Google Sheet.
- Click on
Extensions
>Apps Script
. - Delete the default
Code.gs
file. - Click on
File
>New
>Script
and name the fileQuestradeIntegration
. - Copy the entire script from the provided code and paste it into the
QuestradeIntegration.gs
file. - Replace the
YOUR_INITIAL_TOKEN
placeholder with your actual Questrade API key. - Save the script by clicking on the floppy disk icon or pressing
Ctrl + S
(orCmd + S
on macOS). - Close the Apps Script editor.
- After setting up the script, go back to your Google Sheet and refresh the page via the browser.
- Access the script editor by clicking on
Extensions
>Apps Script
. - Click on
Select function
and choose the function you want to run, such asimportTransactions
,updateBalances
, orimportPositions
. - Click on the play button to run the selected function.
- Check your Google Sheet for the imported data in the respective sheets.
setup
: Initializes the script and retrieves an access token using your API key.getAccessToken
: Retrieves an access token using a refresh token.updateBalances
: Imports account balances into the specified sheet.getAccounts
: Retrieves a list of accounts associated with the API key.getTransactions
: Retrieves account transactions for a specified date range.importPositions
: Imports account positions into the specified sheet.getPositions
: Retrieves account positions for a specified account number.getBalances
: Retrieves account balances for a specified account number.importTransactions
: Imports account transactions into the specified sheet.writeToSheet
: Writes data to the specified sheet.getSheet
: Retrieves or creates a sheet with the specified name.
- Ensure you have a valid Questrade API key and replace the
YOUR_INITIAL_TOKEN
placeholder with your actual API key. - You may need to adjust the date range in the
getTransactions
function to match your desired transaction history period. - For a more customized experience, you can modify the script to suit your specific needs, such as changing the sheet names or adding new functionality.
Contributions to the Google Sheets Passiv Integration project are welcome! If you have improvements, bug fixes, or new features you'd like to see added, please submit a Pull Request.
If you find this integration helpful and would like to support its development, consider making a donation. Every little bit helps!
This project is licensed under the MIT License. See the LICENSE file for details.