ZeroGEX Backtesting API
The Backtesting API from ZeroGEX, for backtesting.
The Backtesting API from ZeroGEX, for backtesting.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/zerogex-io:zerogex-io-backtesting-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: ZeroGEX Backtesting API
description: 'Real-time options analytics API.
**Two versions are served.**
* **v2 (recommended)** — `/api/v2/*`. Every endpoint returns `{"data": ..., "freshness": {...}}`, where the `freshness` block reports response evaluation time, the underlying data''s source timestamp, the market session, the expected update cadence, and a rolled-up `freshness_status` — so endpoint health and data age are separate, machine-readable facts on every response.
* **v1 (stable)** — `/api/*` and `/api/v1/levels/*`. Unchanged and supported; `data` in a v2 response is byte-for-byte the v1 body.
See "API versions & the freshness envelope" in API_Guide.md for the field contract and the per-endpoint cadence table.'
version: 2.0.0
tags:
- name: Backtesting
paths:
/api/backtest/meta:
get:
tags:
- Backtesting
summary: Get Meta
description: 'Catalog for the configuration form: underlyings, patterns, data window, defaults.'
operationId: get_meta_api_backtest_meta_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
additionalProperties: true
type: object
title: Response Get Meta Api Backtest Meta Get
security:
- HTTPBearer: []
/api/backtest/insights/patterns:
get:
tags:
- Backtesting
summary: Get Pattern Insights
description: 'Strategy scoreboard: latest stats row per (catalog strategy, underlying).
Read-only roll-up of ``playbook_pattern_stats`` folded onto canonical
strategy-catalog ids — n, win rate, dollar economics, derived PF /
expectancy, window dates, most-recent ``computed_at``, plus the catalog''s
name / family / tier / research stage.
``source`` picks the measurement feed: ``option_pnl`` (realized P&L from
the strategy''s own live-emitted Action Cards — the default and the
strongest claim), ``bot_replay`` (realized P&L from replaying a bot-bound
strategy''s entry rule over history — same pricing, reconstructed entries),
or ``underlying_touch`` (the price-touch proxy, no dollar economics).
``include_unmeasured`` (default true) appends an explicit "no data yet"
row for every catalog strategy absent from this source, so the page shows
the whole catalog rather than only what happens to have been screened.
Ignored when ``underlying`` narrows to one symbol.'
operationId: get_pattern_insights_api_backtest_insights_patterns_get
security:
- HTTPBearer: []
parameters:
- name: source
in: query
required: false
schema:
type: string
pattern: ^(option_pnl|underlying_touch|bot_replay)$
default: option_pnl
title: Source
- name: underlying
in: query
required: false
schema:
anyOf:
- type: string
pattern: ^[A-Za-z]{1,10}$
- type: 'null'
title: Underlying
- name: include_unmeasured
in: query
required: false
schema:
type: boolean
default: true
title: Include Unmeasured
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items: {}
title: Response Get Pattern Insights Api Backtest Insights Patterns Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/backtest/runs:
post:
tags:
- Backtesting
summary: Create Backtest Run
description: Validate a BacktestSpec, persist a queued run, and schedule execution.
operationId: create_backtest_run_api_backtest_runs_post
security:
- HTTPBearer: []
responses:
'202':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Create Backtest Run Api Backtest Runs Post
get:
tags:
- Backtesting
summary: List Backtest Runs
description: Recent runs for the calling end-user (anonymous runs when unauthenticated).
operationId: list_backtest_runs_api_backtest_runs_get
security:
- HTTPBearer: []
parameters:
- name: limit
in: query
required: false
schema:
type: integer
maximum: 100
minimum: 1
default: 25
title: Limit
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items: {}
title: Response List Backtest Runs Api Backtest Runs Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/backtest/runs/{run_id}:
get:
tags:
- Backtesting
summary: Get Backtest Run
description: Status + summary for one run.
operationId: get_backtest_run_api_backtest_runs__run_id__get
security:
- HTTPBearer: []
parameters:
- name: run_id
in: path
required: true
schema:
type: integer
title: Run Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Get Backtest Run Api Backtest Runs Run Id Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/backtest/runs/{run_id}/share:
post:
tags:
- Backtesting
summary: Share Backtest Run
description: 'Mint (or return) a public share token for a completed run.
Turns a run into a shareable "prove it" report at
``/backtesting/shared/``. Owner-scoped; only completed runs qualify.'
operationId: share_backtest_run_api_backtest_runs__run_id__share_post
security:
- HTTPBearer: []
parameters:
- name: run_id
in: path
required: true
schema:
type: integer
title: Run Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Share Backtest Run Api Backtest Runs Run Id Share Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/backtest/runs/shared/{share_token}:
get:
tags:
- Backtesting
summary: Get Shared Backtest Run
description: Public read of a shared run's result (no owner scoping).
operationId: get_shared_backtest_run_api_backtest_runs_shared__share_token__get
security:
- HTTPBearer: []
parameters:
- name: share_token
in: path
required: true
schema:
type: string
title: Share Token
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Get Shared Backtest Run Api Backtest Runs Shared Share Token Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/backtest/runs/shared/{share_token}/equity:
get:
tags:
- Backtesting
summary: Get Shared Backtest Equity
description: Public equity curve for a shared run.
operationId: get_shared_backtest_equity_api_backtest_runs_shared__share_token__equity_get
security:
- HTTPBearer: []
parameters:
- name: share_token
in: path
required: true
schema:
type: string
title: Share Token
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
type: object
additionalProperties: true
title: Response Get Shared Backtest Equity Api Backtest Runs Shared Share Token Equity Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/backtest/runs/{run_id}/trades:
get:
tags:
- Backtesting
summary: Get Backtest Trades
description: Paginated trade blotter for a run.
operationId: get_backtest_trades_api_backtest_runs__run_id__trades_get
security:
- HTTPBearer: []
parameters:
- name: run_id
in: path
required: true
schema:
type: integer
title: Run Id
- name: limit
in: query
required: false
schema:
type: integer
maximum: 500
minimum: 1
default: 100
title: Limit
- name: offset
in: query
required: false
schema:
type: integer
minimum: 0
default: 0
title: Offset
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Get Backtest Trades Api Backtest Runs Run Id Trades Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/backtest/runs/{run_id}/trades.csv:
get:
tags:
- Backtesting
summary: Download Backtest Trades Csv
description: Download the full trade blotter for a run as CSV.
operationId: download_backtest_trades_csv_api_backtest_runs__run_id__trades_csv_get
security:
- HTTPBearer: []
parameters:
- name: run_id
in: path
required: true
schema:
type: integer
title: Run Id
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/backtest/runs/{run_id}/equity:
get:
tags:
- Backtesting
summary: Get Backtest Equity
description: Equity curve points for a run.
operationId: get_backtest_equity_api_backtest_runs__run_id__equity_get
security:
- HTTPBearer: []
parameters:
- name: run_id
in: path
required: true
schema:
type: integer
title: Run Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items: {}
title: Response Get Backtest Equity Api Backtest Runs Run Id Equity Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/backtest/configs:
get:
tags:
- Backtesting
summary: List Backtest Configs
description: Saved configs for the calling end-user (anonymous pool when unauthenticated).
operationId: list_backtest_configs_api_backtest_configs_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
items: {}
type: array
title: Response List Backtest Configs Api Backtest Configs Get
security:
- HTTPBearer: []
post:
tags:
- Backtesting
summary: Create Backtest Config
description: Save a named, validated BacktestSpec; returns its summary + share token.
operationId: create_backtest_config_api_backtest_configs_post
responses:
'201':
description: Successful Response
content:
application/json:
schema:
additionalProperties: true
type: object
title: Response Create Backtest Config Api Backtest Configs Post
security:
- HTTPBearer: []
/api/backtest/configs/shared/{share_token}:
get:
tags:
- Backtesting
summary: Get Shared Backtest Config
description: Public read-only fetch of a shared config by token (clone into the form).
operationId: get_shared_backtest_config_api_backtest_configs_shared__share_token__get
security:
- HTTPBearer: []
parameters:
- name: share_token
in: path
required: true
schema:
type: string
title: Share Token
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Get Shared Backtest Config Api Backtest Configs Shared Share Token Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/backtest/configs/{config_id}:
get:
tags:
- Backtesting
summary: Get Backtest Config
description: Fetch one saved config (incl. spec), scoped to its owner.
operationId: get_backtest_config_api_backtest_configs__config_id__get
security:
- HTTPBearer: []
parameters:
- name: config_id
in: path
required: true
schema:
type: integer
title: Config Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Get Backtest Config Api Backtest Configs Config Id Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
put:
tags:
- Backtesting
summary: Update Backtest Config
description: Rename and/or replace a saved config's spec (owner only).
operationId: update_backtest_config_api_backtest_configs__config_id__put
security:
- HTTPBearer: []
parameters:
- name: config_id
in: path
required: true
schema:
type: integer
title: Config Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Update Backtest Config Api Backtest Configs Config Id Put
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Backtesting
summary: Delete Backtest Config
description: Delete a saved config (owner only).
operationId: delete_backtest_config_api_backtest_configs__config_id__delete
security:
- HTTPBearer: []
parameters:
- name: config_id
in: path
required: true
schema:
type: integer
title: Config Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Delete Backtest Config Api Backtest Configs Config Id Delete
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/backtest/sweeps:
post:
tags:
- Backtesting
summary: Create Backtest Sweep
description: Run a base spec across a parameter grid; one queued child run per cell.
operationId: create_backtest_sweep_api_backtest_sweeps_post
security:
- HTTPBearer: []
responses:
'202':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Create Backtest Sweep Api Backtest Sweeps Post
get:
tags:
- Backtesting
summary: List Backtest Sweeps
description: Recent sweeps for the calling end-user.
operationId: list_backtest_sweeps_api_backtest_sweeps_get
security:
- HTTPBearer: []
parameters:
- name: limit
in: query
required: false
schema:
type: integer
maximum: 100
minimum: 1
default: 25
title: Limit
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items: {}
title: Response List Backtest Sweeps Api Backtest Sweeps Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/backtest/sweeps/{sweep_id}:
get:
tags:
- Backtesting
summary: Get Backtest Sweep
description: Sweep header + per-cell run status/metrics (used while polling).
operationId: get_backtest_sweep_api_backtest_sweeps__sweep_id__get
security:
- HTTPBearer: []
parameters:
- name: sweep_id
in: path
required: true
schema:
type: integer
title: Sweep Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Get Backtest Sweep Api Backtest Sweeps Sweep Id Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
securitySchemes:
HTTPBearer:
type: http
scheme: bearer
bearerFormat: API-Key