Skip to content
Skip to main content

TradeZero Developer Documentation

Welcome to the TradeZero developer documentation. The REST and WebSocket APIs provide programmatic access to your TradeZero account - the same order routing, risk validation, locate workflows, and account data available through TradeZero Platforms. Whether you are building a trading dashboard or placing and managing orders programmatically, you will find the reference material and runnable examples you need here.

What you can build​

  • Programmatic order workflows - place, cancel, and replace equity and options orders with full route control.
  • Short selling - quote, accept, inventory, and credit-back locates on live accounts.
  • Portfolio monitoring - balances, open and closed positions, as-of historical holdings, cash ledger, and order history over REST or WebSocket.
  • Production-ready integrations - copy-paste Python and TypeScript recipes for authentication, orders, locates, options, and streaming.
  • AI-assisted workflows - TradeZero MCP links Claude, Claude Code, ChatGPT (Business / Enterprise / Edu), Perplexity, Grok, Cursor, or VS Code. Paste the hosted URL and sign in with OAuth 2.0.

Trading & account data

Equity trading - market, limit, and stop orders with direct market access routing.

Options trading - single-leg and multi-leg spreads using OCC symbology you supply from your own market data.

Short locates - quote, accept, and reuse inventory through the locator API.

Account & positions - balances, open, closed, and historical positions, cash ledger, and historical orders over REST.

Real-time & more

WebSocket streams - live P&L and portfolio order updates without polling.

TradeZero MCP - Claude, ChatGPT (Business/Enterprise/Edu), Perplexity, Grok, Cursor, and VS Code over OAuth sign-in.

Quickstart recipes - copy-paste Python and TypeScript examples for the core integration flows.

TradeZero MCP

Connect Claude, Claude Code, ChatGPT (Business / Enterprise / Edu on the web with Developer mode), Perplexity, Grok, Cursor, or VS Code to your TradeZero account through TradeZero MCP. Add the server URL, complete OAuth sign-in, and manage orders, positions, and short locates in natural language. ChatGPT Free, Plus, and Pro do not support TradeZero MCP. TradeZero MCP

Where to start​

New to the API? Start with Quickstart Recipes - runnable code from your first authenticated call through production workflows. Popular entry points:

Popular recipes

Try with an assistant (MCP)

  • ReadWhat open orders do I have on my account right now?
  • WritePlace a limit order to buy 100 shares of AAPL at $180.
  • WriteQuote a locate for 500 shares of BB and show the cost of each offer before I accept.
  • ReadConnect your assistant - setup guide and full prompt list.

Prefer the reference first? About Trading API lists every production REST endpoint. The API Reference is the OpenAPI reference; companion surfaces outside that production catalog are summarized under Beyond REST.

For REST and WebSocket, follow Authentication - enable API Trading in the Portal, sign the agreement, and generate keys. For TradeZero MCP, paste the hosted URL and complete OAuth in your assistant (TradeZero MCP). See About TradeZero for program scope. Before production REST traffic, review API Rate Limits for per-endpoint budgets and 429 handling.

Search the documentation​

Press Ctrl+K (⌘K on Mac) to search the site. Starting points:

Two environments​

PaperLive
Base URLhttps://webapi.tradezero.com (same for both)Same
Which environmentDetermined by the API key pair you sendSame
LocatesCalls return rejected rows (live-only inventory)Full workflow
Historical orders archiveEmpty on paperUp to one week via REST

TradeZero supports paper and live environments through the same base URL, authentication headers, and response schemas. Run your integration on paper before switching to live credentials. See API Conventions for environment guards and Authentication → Pick an environment for a full comparison.

For API updates and new endpoints, see the Change Log.