{"library":"schwab-py","title":"schwab-py","description":"An unofficial Python API wrapper for the Schwab HTTP API, providing access to trading, account data, market data, and streaming. Current version is 1.5.1, requires Python >=3.10. Active development with frequent releases.","language":"python","status":"active","last_verified":"Sat May 09","install":{"commands":["pip install schwab-py"],"cli":null},"imports":["from schwab import auth; client = auth.client_from_token_file('/path/to/token.json', 'your-app-key', 'your-app-secret')","from schwab.auth import easy_client","from schwab.client import Client"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom schwab import auth\nfrom schwab.client import Client\n\n# Set up authentication (first time will open browser for OAuth)\ntoken_path = '/path/to/token.json'\napp_key = os.environ.get('SCHWAB_APP_KEY', 'your-app-key')\napp_secret = os.environ.get('SCHWAB_APP_SECRET', 'your-app-secret')\n\n# On first run, this will prompt for login via browser\ntry:\n    client = auth.client_from_token_file(token_path, app_key, app_secret)\nexcept FileNotFoundError:\n    # Token file doesn't exist yet; perform initial login\n    client = auth.easy_client(app_key, app_secret, token_path)\n\n# Get account info\naccounts = client.get_account_numbers()\nprint(accounts)\n\n# Get a quote\nquote = client.get_quote('AAPL')\nprint(quote)","lang":"python","description":"Initialize client and fetch account numbers and a stock quote.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}