Skip to main content

Access your Wealthsimple account using their (GraphQL) API.

Project description

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ws_api-0.35.0.tar.gz (53.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ws_api-0.35.0-py3-none-any.whl (45.1 kB view details)

Uploaded Python 3

File details

Details for the file ws_api-0.35.0.tar.gz.

File metadata

  • Download URL: ws_api-0.35.0.tar.gz
  • Upload date:
  • Size: 53.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ws_api-0.35.0.tar.gz
Algorithm Hash digest
SHA256 7a8cb1e75ff0a76a77f5f3aa814a90c7b6d86f6102daa8622999777a89ffeb28
MD5 85da603bf3e7bfdf465e674638f7d459
BLAKE2b-256 3bf9d5c0702ff3e08c6df9518bcaf195f8cb9fa2918f483f6bc8aa312e0481a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ws_api-0.35.0.tar.gz:

Publisher: publish.yml on gboudreau/ws-api-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ws_api-0.35.0-py3-none-any.whl.

File metadata

  • Download URL: ws_api-0.35.0-py3-none-any.whl
  • Upload date:
  • Size: 45.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ws_api-0.35.0-py3-none-any.whl
Algorithm Hash digest
SHA256 795d424cad3fe093e0325a75a9379c036411b863f4cb3ef1a43697c379e13a32
MD5 e3b13b879d1f3b43dc9de8a576d0d11c
BLAKE2b-256 20758820310a08eff2d8e3c8b7b0f7027afcd27bcfd93ad96dde7a92da196cbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for ws_api-0.35.0-py3-none-any.whl:

Publisher: publish.yml on gboudreau/ws-api-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page