CuteMarkets Docs

API Reference

Everything you need to integrate market data, build faster, and scale.

Docs

Tip: open /docs/historical-options-replay-runbook.md directly for raw markdown (easy copy/paste into an LLM).

A historical options replay is an attempt to reconstruct what a strategy, scanner, or analyst could actually observe and trade at a past decision time. It is stricter than a chart review and more useful than a table of old option prices. The replay must preserve contract identity, timestamp windows, quote evidence, trade evidence, and rejects.

Use this runbook for earnings studies, 0DTE tests, opening range strategies, implied-move reviews, unusual-options-activity backtests, and paper-trading parity checks.

Use it alongside Historical Options Data API, Options Backtesting API, Options Data API Evaluation, and Why Option Quotes Matter More Than Last Price.

Replay principles

  1. Use the exact contract, not a ticker-level idea.
  2. Rebuild the contract universe before selecting legs.
  3. Use bid/ask quotes for fills.
  4. Use trades for activity validation, not automatic execution.
  5. Store rejected rows with reasons.
  6. Record request URLs and timestamp windows.
  7. Keep plan, freshness, and entitlement assumptions visible.

The goal is not to make the backtest pessimistic. The goal is to keep the evidence chain honest enough that a developer can reproduce or debug it. That is the same standard used in Backtest Options Without Stale Contracts, Same-Bar Fill Lookahead, and Backtest Artifacts and Launch Contracts.

Event record

Every replay starts with an event record. For a strategy that does not depend on news, the event can be the signal timestamp. For an earnings workflow, it is the earnings release, call, or first tradable session after the release.

FieldExampleReason
underlying_tickerNVDAConnects stock context to option contracts
event_timestamp2026-05-20T20:05:00ZThe event anchor
decision_timestamp2026-05-20T19:45:00ZLast state the model could observe before entry
entry_window_start2026-05-20T19:40:00ZQuote window for entry evidence
entry_window_end2026-05-20T19:50:00ZPrevents using later quotes
exit_window_start2026-05-21T13:30:00ZExit evidence starts after the event
exit_window_end2026-05-21T14:00:00ZBounded exit logic
contract_policy7-21 DTE, 0.35-0.65 deltaMakes selection reproducible
fill_policylong ask in, bid outMakes PnL assumptions explicit

If you cannot write this event record, the replay is probably not ready.

Request sequence

A minimal CuteMarkets replay follows this order:

bash
curl "https://api.cutemarkets.com/v1/tickers/expirations/NVDA/" \
  -H "Authorization: Bearer YOUR_API_KEY"

curl "https://api.cutemarkets.com/v1/options/contracts/?underlying_ticker=NVDA&as_of=2026-05-20&expiration_date.gte=2026-05-22&expiration_date.lte=2026-06-19&limit=100" \
  -H "Authorization: Bearer YOUR_API_KEY"

curl "https://api.cutemarkets.com/v1/options/quotes/O:NVDA260522C00180000/?timestamp.gte=2026-05-20T19:40:00Z&timestamp.lt=2026-05-20T19:50:00Z&limit=1000" \
  -H "Authorization: Bearer YOUR_API_KEY"

curl "https://api.cutemarkets.com/v1/options/trades/O:NVDA260522C00180000/?timestamp.gte=2026-05-20T19:40:00Z&timestamp.lt=2026-05-21T14:00:00Z&limit=1000" \
  -H "Authorization: Bearer YOUR_API_KEY"

The OCC ticker above is a placeholder. In a real replay it must come from contract discovery or a chain response that belongs to the correct time period.

Contract selection

Contract selection should be deterministic. A replay that searches the whole chain after the outcome is known will find impressive but untrustworthy winners.

Recommended selection fields:

FieldUse
Expiration dateEnforces DTE and event-window policy
Contract typeSeparates calls, puts, and spreads
StrikePreserves the exact leg
MoneynessPrevents arbitrary far-wing selection
DeltaSupports target-risk selection when available
Open interestFirst-pass participation filter
VolumeSame-day activity context
IV and GreeksVolatility and risk context
Latest quoteInitial spread and freshness check

Do not let volume alone choose the trade. Volume can come from closing trades, rolls, hedges, cheap far-out-of-the-money speculation, or one-off prints.

Quote windows

Quote windows are the primary fill evidence.

For each selected contract, compute:

  • best available quote inside the entry window
  • quote age at decision time
  • bid, ask, midpoint, and spread dollars
  • spread percent relative to midpoint
  • displayed bid and ask size if available
  • whether the quote passes the policy
  • whether the quote is used for fill or only for diagnostics

Example fill rules:

PositionEntryExit
Long callBuy at askSell at bid
Long putBuy at askSell at bid
Short callSell at bidBuy at ask
Short putSell at bidBuy at ask
Long straddleBuy call ask plus put askSell call bid plus put bid
Short straddleSell call bid plus put bidBuy call ask plus put ask

Midpoint results can be useful as a sensitivity column, but they should not replace executable assumptions unless the study is explicitly theoretical.

Trade and aggregate validation

Trades answer a different question from quotes: what printed. Use trades to validate participation, price formation, and tape context.

Aggregates answer another question: what the bar-level path looked like. Use aggregates for charting, event windows, and strategy signals.

Do not use either as a substitute for bid/ask fill evidence. A contract can have a trade print and still be too wide or stale for the strategy. An aggregate can show a high or low that was never available at the moment your system needed to act.

Reject reasons

Rejected rows should be first-class output. A replay that hides rejects is hard to trust.

Common reject reasons:

  • contract was not listed at the decision time
  • expiration did not match policy
  • quote window was missing
  • quote was older than the allowed threshold
  • spread percent exceeded the maximum threshold
  • bid was zero or below the exit threshold
  • open interest or volume was below policy
  • IV or Greeks were missing when required
  • pagination did not load the full surface
  • plan did not include the required quote endpoint
  • corporate-action adjustment made the contract outside policy

Rejects often explain why a strategy that looked strong in last-price form disappears under quote-aware replay.

Replay artifact

A useful replay artifact has enough detail for a second developer to rerun the study.

bash
{
  "replay_id": "nvda-earnings-2026-05-20-front-week",
  "underlying": "NVDA",
  "decision_timestamp": "2026-05-20T19:45:00Z",
  "selected_contracts": ["O:NVDA260522C00180000", "O:NVDA260522P00180000"],
  "requests": [
    "/v1/tickers/expirations/NVDA/",
    "/v1/options/contracts/?underlying_ticker=NVDA&as_of=2026-05-20",
    "/v1/options/quotes/O:NVDA260522C00180000/?timestamp.gte=..."
  ],
  "fill_policy": "long ask in, bid out",
  "reject_policy": {
    "max_quote_age_ms": 1000,
    "max_spread_percent": 0.35,
    "min_bid": 0.05
  },
  "rejects": [
    {
      "contract": "O:NVDA260522C00160000",
      "reason": "spread_percent_over_limit"
    }
  ]
}

This artifact is more valuable than a pretty chart because it gives support, research, and engineering the same source of truth. It also connects directly to Paper Trading Bot Operations and Backtest to Paper Trading Parity when a research workflow moves into simulation.

Related CuteMarkets docs

Replay artifact notes

A replay runbook succeeds when the final artifact can be handed to a skeptical developer. Include the research date, signal timestamp, as_of contract request, selected OCC option ticker, quote window, trade window, aggregate bar window, fill rule, rejected candidates, data-quality labels, and the exact code version that produced the result.

Replay also needs a recovery policy. If the quote window is empty, the cursor is incomplete, the contract was not listed, or the entitlement was unavailable, the artifact should show a reject rather than a patched estimate. Use Backtesting Data Model, Backtesting Execution Realism, and Market Data Ingestion and Caching to keep the artifact tied to source rows.

Terminology

Terms to keep straight on this page

Market-data APIs use similar words for different objects. These links keep the docs page connected to the precise CuteMarkets workflow and related reference material.

OPRA-originating data

The listed-options source context behind quotes, trades, participant records, exchange context, and consolidated option-market data.

SIP and direct feed

Market-data delivery paths that explain where consolidated equities and options records originate before a normalized API returns them.

Quote, trade, aggregate

Three different price semantics: executable bid/ask market, printed transaction, and bar-level summary.

Quote/trade condition

The sale condition, quote condition, exchange id, correction, sequence, and timestamp context attached to market-data rows.

Contract identity

The OCC symbol, expiration, strike, side, root, and reference data needed to preserve the exact option being studied.

Entitlement gate

A plan-aware check that prevents live, quote, WebSocket, or historical behavior from being implied when the product does not include it.

Access method

The delivery mode for data, such as REST request, WebSocket stream, historical window, flat file, or local cache.

Backfill window

A timestamp-bounded REST request used to repair or complete data after a stream gap, retry, deploy, or cache miss.

Session label

A premarket, regular, after-hours, closed, half-day, holiday, or unknown tag attached to a market-data timestamp.

Data-quality reject

A logged reason for skipping a candidate because required contracts, quotes, timestamps, pagination, or entitlements failed policy.

Commercial-use boundary

The product, plan, display, redistribution, and customer-facing use context that must be reviewed before shipping market data.

Adjusted option deliverable

The changed deliverable or contract terms that can appear after splits, mergers, special dividends, or other corporate actions.

Next steps

Move from the docs into the product workflow

If you are evaluating the API rather than implementing a specific endpoint right now, the product pages map live and historical workflows for stocks, options, and WebSockets.