Skip to content
Back to App

TopStep Simulator API

The TopStep Simulator API is a faithful emulation of the TopStep ProjectX Gateway API. It exposes the same endpoints, request/response formats, and enum values so that strategies built for TestMax can be ported to live trading on TopStep with minimal code changes.

In addition to the standard ProjectX endpoints, TestMax adds Replay Control endpoints that allow you to start backtest sessions, step through historical bars, control playback speed, and retrieve final results. These replay endpoints are the key differentiator that turns a trading API into a backtesting engine.

Base path

All TopStep Simulator API endpoints are prefixed with:

https://api.test-max.com/api/topstep-sim/

For example, to place an order:

POST https://api.test-max.com/api/topstep-sim/Order/place

Authentication

The Simulator API uses Bearer token authentication. You must first obtain a token by calling Auth/loginKey with your email address and API key, then include the token in the Authorization header of all subsequent requests.

Authorization: Bearer <your-token>
Content-Type: application/json

See the Authentication page for the complete flow.

Endpoint reference

Auth

MethodEndpointDescription
POSTAuth/loginKeyAuthenticate with email and API key
POSTAuth/validateValidate or refresh an existing token
POSTAuth/logoutInvalidate a token
GETStatus/pingHealth check

Account

MethodEndpointDescription
POSTAccount/searchList trading accounts

Contract

MethodEndpointDescription
POSTContract/searchSearch for instruments by name or symbol
POSTContract/searchByIdFind a specific contract by ID

Order

MethodEndpointDescription
POSTOrder/placePlace a new order (market, limit, stop, or stop-limit)
POSTOrder/searchSearch all orders for an account
POSTOrder/searchOpenGet open/pending orders only
POSTOrder/cancelCancel a pending order
POSTOrder/modifyModify a pending order’s size or price

Position

MethodEndpointDescription
POSTPosition/searchOpenGet all open positions
POSTPosition/closeContractClose an entire position
POSTPosition/partialCloseContractPartially close a position

Trade

MethodEndpointDescription
POSTTrade/searchGet trade/fill history

Replay Control (TestMax extension)

MethodEndpointDescription
POSTReplay/startStart a new backtest session
POSTReplay/stepAdvance the replay by N bars
POSTReplay/jumpToJump to a specific timestamp
POSTReplay/playStart auto-playing at a given speed
POSTReplay/pausePause auto-play
POSTReplay/endEnd the session and get final results

History

MethodEndpointDescription
POSTHistory/retrieveBarsRetrieve historical OHLCV bars

Typical workflow

A complete backtest session follows this sequence:

  1. AuthenticatePOST Auth/loginKey
  2. Get accountPOST Account/search
  3. Find contractPOST Contract/search
  4. Start replayPOST Replay/start with instrument, date, and timeframe
  5. Main loopPOST Replay/step to advance bars, POST Order/place to trade, POST Position/searchOpen to check positions
  6. End sessionPOST Replay/end to finalize and get P&L results

Detailed endpoint documentation