Unofficial Wealthsimple API Library for Python
This library allows you to access your own Wealthsimple account using the Wealthsimple (GraphQL) API.
Python 3.10+ required
Features
- Retrieve all accounts (RRSP, TFSA, FHSA, cash, margin, crypto, credit card)
- Get account balances and positions
- Fetch historical performance (net value, deposits, gains)
- Access transaction/activity history
- Search securities and get market data
- Historical price quotes
- Handle 2FA (TOTP) authentication
- Automatic session refresh
- Optional security data caching
Installation
uv add ws-api
# or
pip install ws-api
Upgrading
If you are updating from 0.35 or less, to 0.36 or more, the requests dependency has been replaced with curl_cffi.
If you installed using uv or pip (and you update using either), they will take care of that for you.
Basic Example
from ws_api import WealthsimpleAPI
# Login (will prompt for username/password/TOTP)
session = WealthsimpleAPI.login(username="you@example.com", password="yourpassword")
ws = WealthsimpleAPI.from_token(session)
# Get your accounts
accounts = ws.get_accounts()
for account in accounts:
print(f"{account['description']}: {account['number']}")
Full Example
Note: You'll need the keyring package to run the code below. Install with: uv add keyring (or pip install keyring)
See tests/test_full_example.py
Projects Using It
- wealthgrabber - Wealthsimple portfolio analytics
Metadata
Release files for ws-api 0.37.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ws_api-0.37.1.tar.gz | 54.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ws_api-0.37.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 100.0 kB
Release files / ws_api-0.37.1.tar.gz
| Download URL | ws_api-0.37.1.tar.gz |
|---|---|
| Size | 54.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
688d80ae16e03519a50db3243c4f770fa94589f8a0ea80b98dca91e81ae2389e
|
|
BLAKE2b-256 checksum How to use checksums |
220a95c1708b496e491f31c4f87b859a12080cefa76d9dab24cacdd6ad1e90b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency logRelease files / ws_api-0.37.1-py3-none-any.whl
| Download URL | ws_api-0.37.1-py3-none-any.whl |
|---|---|
| Size | 45.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a938d155c608709561ad208ad930ba8422f84118fc5e0c06a1cb68302b63e655
|
|
BLAKE2b-256 checksum How to use checksums |
2b849715d12ef4052b34eed64500abe171d8d2ea1b55876721f672cf47e7d4a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency log