Endpoints

Available pairs

shell
curl -s https://zealous.markets/api/v1/streams \
-H "Authorization: Bearer $ZM_KEY"

Returns every pair available for streaming. Use this to discover what you can subscribe to and ask the status endpoint about.

Subscribe to a pair

shell
curl -s https://zealous.markets/api/v1/streams \
-X POST \
-H "Authorization: Bearer $ZM_KEY" \
-H "Content-Type: application/json" \
-d '{"exchange":"coinbase","base":"BTC","quote":"USD","metrics":["trade","book"]}'

Marks a pair as one you intend to consume. metrics is optional and defaults to all three (trade, book, quote). The call is idempotent and additive — re-posting an existing pair unions the metric set; it never narrows. A pair that isn't currently available for streaming returns 400 invalid_parameter.

Unsubscribe

shell
# drop the whole pair
curl -s -X DELETE https://zealous.markets/api/v1/streams/coinbase/BTC/USD \
-H "Authorization: Bearer $ZM_KEY"
# drop just one metric, keep the rest subscribed
curl -s -X DELETE "https://zealous.markets/api/v1/streams/coinbase/BTC/USD?metric=book" \
-H "Authorization: Bearer $ZM_KEY"

Idempotent — unsubscribing twice still returns 204.

Status

shell
curl -s https://zealous.markets/api/v1/streams/coinbase/BTC/USD/status \
-H "Authorization: Bearer $ZM_KEY"

Returns the derived stateREQUESTED | WARMING | READY | STALE | FAILED — together with the raw signals it was computed from (24-hour coverage, live heartbeat) and a per-metric breakdown. Poll this after subscribing to a pair until it reports READY.

Historical snapshot

shell
curl -s https://zealous.markets/api/v1/streams/coinbase/BTC/USD/snapshot \
-X POST \
-H "Authorization: Bearer $ZM_KEY" \
-H "Content-Type: application/json" \
-d '{"metrics":["trade"],"granularity":"minute","from_ms":1714500000000,"to_ms":1714510000000}'
FieldNotes
metricsNon-empty subset of trade, book, quote.
granularitysecond, minute, hour, or day. day is trade-only.
from_ms / to_msEpoch ms. to_ms defaults to now; from_ms to a granularity-specific lookback.
formatOptional json | toon.

Range caps: second ≤ 24 h, minute ≤ 7 d, hour ≤ 30 d. The response is a bars array — which fields are populated depends on the requested metrics. circulating_supply is included only when book was requested.

Latest live snapshot

shell
curl -s https://zealous.markets/api/v1/streams/coinbase/BTC/USD/live \
-H "Authorization: Bearer $ZM_KEY"

The most recent live bar for a pair, or null if nothing has been published yet. For a continuous feed, use SSE.

Scheme-event history

shell
curl -s "https://zealous.markets/api/v1/streams/coinbase/BTC/USD/schemes?lookback_hours=24" \
-H "Authorization: Bearer $ZM_KEY"

Flagged spoofing scheme events — flipping, vacuuming, and layering — from the live detector buffer for the requested window. Reflects live output, not batch top-N tables. Live detections also stream over SSE as scheme-event.

FieldNotes
lookback_hoursLookback window in hours. Default 24, min 1, max 720.
limitMaximum events returned. Default 10000, min 100, max 50000.

The response is a SchemeHistoryResponse with start_ms, end_ms, and an events array of scheme detections (each with scheme, direction, confidence, alert_score, and the underlying build/collapse metrics).

Pair discovery by market cap

shell
curl -s "https://zealous.markets/api/v1/cmc/top?exchange=coinbase&n=10" \
-H "Authorization: Bearer $ZM_KEY"

CoinMarketCap-ranked tokens with a tradable pair resolved on the requested exchange. Use this to pick popular pairs to subscribe to.