skillfed

schwab-py

Unofficial API wrapper for the Schwab HTTP API

schwab-py v1.5.1 162.4K downloads/30d#10,608 on PyPI461
Permissive license MIT AGING released

What it is and what it does

schwab-py is an unofficial Python wrapper around the Charles Schwab Consumer APIs, designed as a thin layer over the HTTP endpoints. It handles OAuth authentication and token refresh automatically, eliminating the need to roll your own OAuth callback flow. The package returns raw API responses, allowing you to interpret the data as you need rather than imposing opinionated logic.

The wrapper covers login, quotes, fundamentals, historical pricing, options chains, streaming quotes and order book depth, trade execution and management, and account information. It is a direct successor to the now-defunct tda-api library, with a migration guide provided. The package requires Python 3.10 or later and depends on authlib, httpx, websockets, flask, and several utility libraries for its core functionality.

Use it for:

  • Fetch historical daily price data for equities over multi-year periods for backtesting or analysis.
  • Retrieve real-time options chains and streaming quote data for algorithmic trading systems.
  • Execute and manage trades programmatically against a Schwab account with automatic OAuth token handling.
  • Build a portfolio monitoring dashboard that pulls live account balances and positions from Schwab.
  • Migrate existing trading bots from the deprecated tda-api library to the Schwab API.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Unofficial wrapper for the Charles Schwab API that provides programmatic access to authentication, quotes, options chains, streaming data, trade execution, and account information.

Yes, if you need programmatic access to Schwab's trading and account APIs and are comfortable with an unofficial wrapper. The low install friction, permissive MIT license, and active repository (despite aging maintenance) make it a reasonable choice for Schwab-based automation. However, be aware that the last release was 410 days ago, paper trading and historical options pricing are not supported, and you must have a Schwab developer account approved before use. Not suitable if you need thinkorswim-specific features or paper trading.

Install

schwab-py on PyPI

pip

pip install schwab-py

uv

uv add schwab-py

poetry

poetry add schwab-py

Installing schwab-py

Before you install

Low install friction with a pure-wheel distribution. Maintenance status is aging—last commit was 2025-08-04 and the latest release 2025-06-30 came 410 days before the fact sheet date—but the repository remains active and not archived, with 461 stars.

License in practice

MIT license (permissive) means you can use, modify, and distribute the package freely in commercial and private projects, provided you include the license notice. The package includes a disclaimer that it is unofficial and unendorsed by Charles Schwab.

Quickstart

pip install schwab-py

from schwab import auth, client

api_key = 'YOUR_API_KEY'
app_secret = 'YOUR_APP_SECRET'
callback_url = 'https://127.0.0.1:8182/'
token_path = '/path/to/token.json'

c = auth.easy_client(api_key, app_secret, callback_url, token_path)
r = c.get_price_history_every_day('AAPL')
print(r.json())

Requires Python 3.10 or later. You must create a Charles Schwab developer account and application, obtain an API key and app secret, and have your app approved by Schwab before use.

Verify before relying

  • Whether the aging maintenance status (410 days since last release) indicates active ongoing support or gradual deprecation.
  • Real-world reliability and latency characteristics for streaming quotes and order book depth data.
  • Whether all Schwab API endpoints are fully wrapped or if some require direct HTTP calls.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 10 — autopep8, authlib, certifi, flask, httpx, multiprocess, psutil, python-dateutil, urllib3, websockets
Maintenance aging — 410 days since the last release
Last repo commit
First released
Downloads 162,376/month — #10,608 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: schwab_py-1.5.1-py2.py3-none-any.whl

Keywords: finance, trading, equities, bonds, options, research

Development Status :: 1 - PlanningIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Office/Business :: Financial :: Investment

Tags

schwab api wrapper pythoncharles schwab trading apischwab authentication oauthschwab options chains streamingschwab account data accessschwab historical price dataschwab trade execution
trading-apioauth-wrapperfinancial-data

More Investment packages