schwab-py
Unofficial API wrapper for the Schwab HTTP API
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-pyuv
uv add schwab-pypoetry
poetry add schwab-pyInstalling 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
Tags
More Investment packages
Generates country- and subdivision-specific…
permissive · top 1,000 on PyPI
yfinanceFetches financial and market data from Yahoo…
permissive · top 1,000 on PyPI
numpy-financialProvides elementary financial functions (IRR,…
permissive · top 5,000 on PyPI
ccxtCCXT is a unified API library for connecting to…
permissive · top 5,000 on PyPI
databentoOfficial Python client for accessing live and…
permissive · top 5,000 on PyPI
edgartoolsEdgarTools parses SEC EDGAR filings into typed…
permissive · top 5,000 on PyPI
longbridgeLongbridge provides a Python SDK for accessing…
unclear · top 15,000 on PyPI
python-binanceUnofficial Python wrapper for the Binance…
permissive · top 15,000 on PyPI
betfairlightweightA Python wrapper for the Betfair API-NG that…
permissive · top 15,000 on PyPI
massiveOfficial Python client for Massive's REST and…
permissive · top 15,000 on PyPI
tradingview-taRetrieves technical analysis indicators and…
permissive · top 15,000 on PyPI
fyers-apiv3Official Python client library for the Fyers…
permissive · top 15,000 on PyPI
yahooqueryRetrieves financial data from Yahoo Finance…
permissive · top 15,000 on PyPI
ib_asyncib_async provides a Python interface to…
permissive · top 15,000 on PyPI
shortzyShortzy wraps the Adlinkfly API and alternative…
permissive · top 15,000 on PyPI
lark-oapiPython SDK for the Feishu Open Platform that…
permissive · top 5,000 on PyPI