Medved Trader APIs

#

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.

Which API should I use?

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

At a glance

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

Common to all of them

  • A Premium subscription is required for all of them. A trial subscription includes full API access.
  • Medved Trader must be running. The APIs talk to the copy running on your PC and use the brokerages and data sources you have already set up in it.
  • All four are turned on in one place: Settings → App → API. Each one is off by default. Changing these settings asks for your Medved Trader account password, or your PIN if you use a social login.
  • Local by default. The servers listen on your own machine (127.0.0.1) only, unless you choose to allow connections from your local network.

WebSocket API Primary developer API

WebSocket · JSON or XML · ws://127.0.0.1:16400 · Premium

An 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:

  • Connect to any supported brokerage, and monitor balances, positions and transactions.
  • Place, cancel and modify orders.
  • Stream market data from most of the providers Medved Trader supports: Level 1, Level II, news, halts and options.
  • Backfill market data, and read historical data Medved Trader has already collected.
  • Read, create and modify alerts, and be notified as they trigger.
  • Watch Medved Trader's scan results in real time, and tune scans and paintbars through InterVars.
  • Add and change portfolios, and read or set Linked Symbols.

MCP Server For AI assistants

Model Context Protocol · http://localhost:16240/mcp · API key · Premium

Lets 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.

Paste API Trading automation

Clipboard or WM_COPYDATA · JSON · Premium · Windows

Drives 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 API Legacy

HTTP GET · plain text · http://127.0.0.1:16239/Req?… · Premium

A 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.

Related: using your own data files

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.

Questions?

Contact us at support@medvedtrader.com. We are glad to help with any API question.