@api-emulator/schwab
v0.2.2
Published
Charles Schwab Trader API provides OAuth, brokerage accounts, account hashes, orders, quotes, and option chain data.
Readme
@api-emulator/schwab
Charles Schwab Trader API provides OAuth, brokerage accounts, account hashes, orders, quotes, and option chain data.
Use this emulator for local tests, CI, and offline agent runs. It keeps your tests separate from the production API.
Start the emulator
- Install the package.
npm install @api-emulator/schwab- From this registry, start the emulator.
npx -p api-emulator api --plugin ./providers/@schwab/api-emulator.mjs --service schwabThe emulator uses the local URL that api-emulator prints. Set your client base URL to this local URL.
Supported API
POST /v1/oauth/tokenGET /trader/v1/accounts/accountNumbersGET /trader/v1/accountsGET /trader/v1/accounts/:accountHash/ordersPOST /trader/v1/accounts/:accountHash/ordersGET /trader/v1/accounts/:accountHash/orders/:orderIdGET /marketdata/v1/quotesGET /marketdata/v1/chainsGET /inspect/contractGET /inspect/state
Coverage
- Level:
smoke-only - Meaning: A smoke test starts the emulator and checks its main behavior.
- Evidence: a direct smoke test exists, but a conformance manifest does not exist.
Credentials
Use a fixed bearer token or API key in each test. The emulator does not send these credentials to the provider.
Test data
Add repeatable test data to the provider configuration.
schwab:
# Add provider-specific seed state here.