CuteMarkets Docs

API Reference

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

Docs

Tip: open /docs/real-time-options-system-design.md directly for raw markdown (easy copy/paste into an LLM).

Real-time options data is useful only when the application has a clear policy for initialization, freshness, streaming, reconnects, REST backfills, quote access, and user-facing labels. A live page that says "real time" without those details leaves too much work to the developer.

This guide describes a production-oriented design for options scanners, dashboards, alerts, and internal tools using CuteMarkets REST endpoints and, where available by plan, WebSockets.

Read it together with Real-Time Options Data API, WebSockets, Live, Delayed, and Entitlements, Options Chain Scanner Architecture, and Options Data API. The terminology should remain precise across articles: REST snapshot, WebSocket stream, reconnect, REST backfill, live data, delayed data, stale quote, latest trade, quote age, spread percent, subscription state, and entitlement.

System phases

PhaseGoalData used
InitializeBuild the first known stateExpirations, chain snapshots, contract snapshots
Subscribe or refreshKeep important state currentWebSockets where available, repeated REST snapshots otherwise
ValidateDecide whether a row is usableLatest quote, latest trade, quote age, spread, OI, volume
AlertProduce an event or UI updateFiltered chain rows, selected contract state, stream events
BackfillRepair gaps after restart or disconnectHistorical quotes, trades, aggregates
AuditExplain what the app showed and whyRequest logs, subscription logs, timestamps, rejects

A live options product should not start by streaming random symbols. It should first know which underlying, expiration, and contract set it cares about. The same idea appears in the Options Chain API page, the Option Chain docs, and the contract snapshot docs.

Initialization with REST

REST endpoints are the safest way to build the initial state.

  1. Fetch listed expirations for the underlying.
  2. Choose the relevant expiration or DTE range.
  3. Request the chain for that expiration.
  4. Apply scanner filters locally.
  5. Store selected OCC tickers.
  6. Fetch contract snapshots for selected rows if the UI needs focused panels.
  7. Start stream subscriptions or polling for the selected scope.
bash
curl "https://api.cutemarkets.com/v1/tickers/expirations/SPY/" \
  -H "Authorization: Bearer YOUR_API_KEY"

curl "https://api.cutemarkets.com/v1/options/chain/SPY/?expiration_date=2026-06-19&limit=100" \
  -H "Authorization: Bearer YOUR_API_KEY"

The chain response should be treated as a state snapshot. It is not a permanent truth. Store the response timestamp, row count, pagination status, selected filters, and plan state.

Freshness policy

Real-time systems need freshness labels.

FieldWhy it matters
snapshot_loaded_atShows when the app initialized or refreshed the chain
latest_quote_timestampDrives quote-age checks and spread-sensitive filters
latest_trade_timestampShows recent print activity but not fill availability
last_stream_event_atShows whether live updates are still flowing
last_rest_backfill_atShows whether a reconnect gap was repaired
data_freshness_labelCommunicates live, delayed, stale, or unavailable state

For user-facing tools, do not bury staleness in logs. If the quote is too old, mark it. If the plan is delayed, label it. If the latest trade is present but the latest quote is missing, do not imply that the row is quote-aware.

REST versus WebSockets

Use REST for:

  • initial chain load
  • expiration lookup
  • selected-contract snapshots
  • historical quote and trade windows
  • reconnect backfill
  • deterministic audits
  • small internal tools that do not need continuous updates

Use WebSockets when:

  • the plan includes stream access
  • the product needs continuous updates
  • alerts depend on low-latency changes
  • the application can monitor reconnects and subscriptions
  • the team is prepared to store last-seen event state

REST and WebSockets are complementary. REST gives reproducible state. Streams give movement. A robust system uses REST to rebuild, then streams or polling to maintain.

Scanner model

A real-time chain scanner should rank only after it has enough evidence.

Recommended row fields:

CategoryFields
Identityunderlying, expiration, OCC ticker, contract type, strike
Riskdelta, gamma, theta, vega, IV, underlying price
Participationopen interest, volume, latest trade timestamp
Quote qualitybid, ask, size, spread dollars, spread percent, quote age
Stateselected filters, snapshot timestamp, plan freshness, pagination status
Decisionpass/fail, rank score, reject reason, last evaluated at

The scanner should fail closed when required evidence is missing. For example, if the rule says spread percent must be below 20 percent, a missing quote should reject the row rather than make it look clean.

Reconnect and backfill

A stream disconnect is a data gap, not a harmless network detail.

Reconnect policy:

  1. Record disconnect time.
  2. Record last event timestamp per subscription.
  3. Reconnect and resubscribe.
  4. Request REST history for the missed window when the endpoint supports it.
  5. Mark the gap as repaired or unrecoverable.
  6. Recompute scanner state from the repaired timeline.
  7. Keep the gap visible in operational logs.

Do not silently continue as if nothing happened. A user may have missed the only quote or trade that made an alert meaningful. This is why live operations and historical quote windows should share the same audit vocabulary.

Alert design

Good alerts explain their evidence.

Example alert payload:

bash
{
  "alert_type": "option_chain_liquidity_candidate",
  "underlying": "SPY",
  "contract": "O:SPY260619C00550000",
  "expiration": "2026-06-19",
  "conditions": {
    "delta_band": "0.35-0.55",
    "max_spread_percent": 0.15,
    "min_open_interest": 500,
    "max_quote_age_ms": 1000
  },
  "evidence": {
    "bid": 4.2,
    "ask": 4.35,
    "spread_percent": 0.034,
    "open_interest": 18420,
    "latest_quote_timestamp": "2026-06-04T15:31:12.002Z",
    "latest_trade_timestamp": "2026-06-04T15:30:58.220Z"
  },
  "source": {
    "snapshot_request": "/v1/options/chain/SPY/?expiration_date=2026-06-19",
    "stream_topic": "options.SPY",
    "freshness": "live"
  }
}

This makes the alert debuggable. If a later review asks why the row fired, the answer is in the payload.

Common mistakes

  • building a live scanner from last trade only
  • ranking chain rows before pagination finishes
  • showing delayed data without a delay label
  • assuming quote access exists on every plan
  • ignoring reconnect gaps
  • treating WebSockets as a replacement for historical backfill
  • using live chain state to validate historical fills
  • suppressing reject reasons in the UI

Related CuteMarkets docs

Real-time system notes

Real-time systems need an initialization path and a repair path. Start with REST snapshots or chains, subscribe to WebSocket topics, then use REST backfill after disconnects, missed heartbeats, or stale rows. Store subscription topic, connection id, last message time, last REST backfill window, entitlement state, and the row timestamp shown in the UI.

For options, do not treat a connected socket as proof that every contract is fresh. A chain table still needs quote age, spread state, and selected-contract snapshots. Pair this page with WebSockets, Market Data Access Methods, Quotes, and Live and Delayed Entitlements before building live alerts.

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.