Medved Trader can be driven by your own programs, scripts and AI assistants. Every brokerage and data provider has its own API, and no two of them work the same way. Medved Trader has already done that integration work. Through Medved Trader you reach all of them with one consistent interface: your accounts, your orders, and live and historical market data.
There are four APIs, each built for a different job. All of them run locally on your own PC, against your own running copy of Medved Trader. Your data and orders never pass through our servers.
| If you want to… | Use |
|---|---|
| Write a program that streams quotes, Level II, news and alerts, monitors your accounts, and places trades | WebSocket API — the full-featured developer API |
| Let an AI assistant such as Claude read your quotes, charts, portfolios and accounts, and optionally trade | MCP Server — plug-and-play for AI clients |
| Send orders from another program, macro tool or hardware keypad into a Chart, Level II, DOM or Trade Ticket window, the same way a hotkey does | Paste API — hotkey JSON delivered to a trading window |
| Pull a quote, history or a portfolio's symbols into a spreadsheet or a quick script using a plain URL | HTTP API — simple, read-mostly, legacy |
| WebSocket API | MCP Server | Paste API | HTTP API | |
|---|---|---|---|---|
| Connection | WebSocket | HTTP (MCP, JSON-RPC) | Clipboard or WM_COPYDATA |
HTTP GET |
| Format | JSON or XML | JSON | JSON (hotkey language) | Plain text / CSV |
| Times | UTC | UTC | — | US Eastern, in and out |
| Default port | 16400 | 16240 | — | 16239 |
| Streaming | Yes — pushed updates | No — request / response | Optional echo of window state | No — request / response |
| Market data | L1, L2, time & sales, news, halts, options, history, backfill | Quotes, history, option chains | — | Last quote, stored history, time & sales, option chains |
| Accounts & trading | Balances, positions, orders; place, cancel, modify | Balances, positions, orders; place, cancel, modify (per key) | Orders, cancels, flatten, modify | — |
| Security | Local connection | API key with permissions | Password in every payload | Local connection (no password) |
| Requires | Premium subscription | Premium subscription; an API key | Premium subscription; Windows | Premium subscription |
127.0.0.1) only, unless you choose to allow connections from your local network.ws://127.0.0.1:16400 · PremiumAn asynchronous, streaming API for any language that can open a WebSocket. Connect to one or several brokerages and data sources at the same time and receive updates as they happen. With it you can:
http://localhost:16240/mcp · API key · PremiumLets an AI assistant such as Claude Desktop work with your running copy of Medved Trader. You can ask it to pull up quotes and history, review your positions, manage watchlists, arrange your layout, and, if you allow it, place trades. Each API key carries its own permissions. New keys are read-only until you grant more.
Most people only need the setup guide. The developer reference is for writing your own MCP client.
WM_COPYDATA · JSON · Premium · WindowsDrives Medved Trader's trading windows (Chart, Level II, DOM, Trade Ticket and Account) by handing one a block of JSON. The JSON is the same language Medved Trader's hotkeys are written in, so anything a hotkey can do, a Paste API payload can do. The quickest way to write one is to build the hotkey in the Hotkey editor, then right-click it and choose Copy for Paste API.
It works alongside the WebSocket API: send the same hotkey JSON with tradeCommandFromHotkey, or have a window echo its state back over the WebSocket connection.
http://127.0.0.1:16239/Req?… · PremiumA simple URL-based API, backward compatible with QuoteTracker. It returns portfolios, last quotes, stored history, time & sales and option chains as plain text, and can add symbols to portfolios and set Linked Symbols. It is handy for spreadsheets and quick scripts. Unlike the other APIs, which use UTC, all of its times, in requests and responses, are US Eastern. For anything new, use the WebSocket API.
To load data from files instead of writing a program, such as history from another application, a symbol your feed doesn't cover, or data you generate yourself, use the LOCAL Backfill data source. Point it at a folder of CSV, TAB, JSON or XML files and Medved Trader backfills charts from them.
Contact us at support@medvedtrader.com. We are glad to help with any API question.