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.comThe full URL for any endpoint is the base URL plus the API path. For example:
https://api.test-max.com/api/topstep-sim/Auth/loginKeyhttps://api.test-max.com/api/playground/templatesStandard response format
Every API response follows a consistent JSON structure:
{ "success": true, "errorCode": 0, "errorMessage": null, ...data}| Field | Type | Description |
|---|---|---|
success | boolean | true if the request succeeded, false if there was an error |
errorCode | number | 0 for success, non-zero for errors |
errorMessage | string or null | Human-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.
- Generate an API key in the TestMax web app under Settings > API Keys
- Send a
POSTrequest toAuth/loginKeywith your email and API key - Receive a token in the response
- Include the token in all subsequent requests via the
Authorizationheader
Authorization: Bearer <your-token>Tokens can be refreshed with Auth/validate and invalidated with Auth/logout.
The Playground API uses cookie-based JWT authentication — the same session cookie set when you log into the TestMax web app. No additional API key is needed.
If you are calling the Playground API from a script outside the browser, you will need to include the session cookie in your requests. In practice, most users interact with the Playground API through the web UI, and the cookie is handled automatically.
See the Authentication page for the complete auth flow with code examples.
Rate limits
TestMax enforces the following limits to ensure fair usage:
| Limit | Value |
|---|---|
| Max concurrent backtests per user | 1 |
| Backtest execution timeout | 10 minutes |
| Max strategy script size | 200 KB |
| Playground speed range | 1x 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:
- Create an account at testmax.io
- Generate an API key in Settings > API Keys
- Authenticate via
POST Auth/loginKey - Search for accounts via
POST Account/search - Find your contract via
POST Contract/search - Start a replay session via
POST Replay/start - Step through bars and place orders using the Order and Replay endpoints
- End the session via
POST Replay/endto get final results