Skip to content
Back to App

API Reference

TestMax exposes two REST APIs that give you full programmatic control over backtesting, order execution, and strategy management. Whether you are building a Python trading bot, integrating with an external tool, or automating your workflow, these APIs cover everything you need.

The two APIs

TestMax has two distinct APIs, each serving a different purpose:

TopStep Simulator API

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

The TopStep Simulator API emulates the real TopStep ProjectX Gateway API. It exposes the same endpoints, request formats, and response shapes so that strategies you build for TestMax can be ported to live trading with minimal changes.

This is the API you use when writing Python strategies in the Algo Playground or when building standalone trading bots.

Authentication: Bearer token obtained via Auth/loginKey (requires an API key generated in Settings).

Covers: Authentication, accounts, contracts, order placement, positions, trades, historical bars, and replay control.

Playground API

Base path: https://api.test-max.com/api/playground/

The Playground API manages the Algo Playground experience — running backtests, managing saved strategies, browsing templates, and viewing run history.

Authentication: Cookie-based JWT (same session as the web app). No additional API key required.

Covers: Strategy templates, backtest execution, speed control, strategy CRUD, and run history.

Base URL

All API requests are made to:

https://api.test-max.com

The full URL for any endpoint is the base URL plus the API path. For example:

https://api.test-max.com/api/topstep-sim/Auth/loginKey
https://api.test-max.com/api/playground/templates

Standard response format

Every API response follows a consistent JSON structure:

{
"success": true,
"errorCode": 0,
"errorMessage": null,
...data
}
FieldTypeDescription
successbooleantrue if the request succeeded, false if there was an error
errorCodenumber0 for success, non-zero for errors
errorMessagestring or nullHuman-readable error description, or null on success

Additional data fields are included alongside these three fields depending on the endpoint. For example, Account/search returns an accounts array at the top level of the response object.

Authentication overview

The TopStep Simulator API uses Bearer token authentication.

  1. Generate an API key in the TestMax web app under Settings > API Keys
  2. Send a POST request to Auth/loginKey with your email and API key
  3. Receive a token in the response
  4. Include the token in all subsequent requests via the Authorization header
Authorization: Bearer <your-token>

Tokens can be refreshed with Auth/validate and invalidated with Auth/logout.

See the Authentication page for the complete auth flow with code examples.

Rate limits

TestMax enforces the following limits to ensure fair usage:

LimitValue
Max concurrent backtests per user1
Backtest execution timeout10 minutes
Max strategy script size200 KB
Playground speed range1x to 50x

There are no per-minute rate limits on individual API calls during a backtest session. The simulator is designed for rapid-fire order placement and bar stepping within a single session.

Getting started

The fastest way to start using the API is through the Algo Playground, where authentication and session setup are handled automatically. If you want to build a standalone bot or integrate directly:

  1. Create an account at testmax.io
  2. Generate an API key in Settings > API Keys
  3. Authenticate via POST Auth/loginKey
  4. Search for accounts via POST Account/search
  5. Find your contract via POST Contract/search
  6. Start a replay session via POST Replay/start
  7. Step through bars and place orders using the Order and Replay endpoints
  8. End the session via POST Replay/end to get final results

API reference sections