Skip to main content
GET
Open one connection and leave it open. The server pushes each public and Pro feed event as it happens, from large trades to wallet grade changes, and there are no client-to-server messages. For a durable, paged backfill of whale_trades_inserted events instead, use Event replay.

Parameters

Filters are set when you connect and cannot be changed on an open connection. They apply to replayed frames and live frames alike, and a frame has to pass every filter you set.

Frames

A resync marker carries completeness.status: truncated when your resume point was older than the retained window, lagged when the stream fell behind, and reset when the server’s sequence numbering restarted while your connection was open. Frames are never skipped without one. After a reset marker, the frames that follow carry lower id values than the frames before it. The marker’s id is one below the first of the new numbering, so storing it as your cursor resumes with nothing missed; from_sequence is the last id you were sent and to_sequence is the first of the new numbering.

How to reconnect without missing a frame

  1. Open the stream with curl -N or a browser EventSource. Sending no resume cursor attaches you to live frames, with no replay and no error.
  2. Store each frame’s id after you have processed it.
  3. On reconnect, send Last-Event-ID: <that id>. A browser EventSource does this for you.
  4. Read the replayed frames in ascending id, then the live frames. There is no gap in seq between the two.
  5. On event: resync, refetch current state, keep the connection open, and store the marker’s id as your cursor.

When the stream ends on its own

The key is checked when you connect, and again every 30 seconds while the connection is open. If the key is revoked, expired, or rotated, or the account that owns it is deleted, locked, or no longer subscribed, the stream ends within 40 seconds with one final frame and the connection closes:
error is the same object a reconnect is answered with in its response body, so one handler covers both cases. retry: false means a reconnect with the same credential is refused with that code: invalid_api_key (401), subscription_required (402), forbidden (403, a deleted account), account_locked (423), or insufficient_scope (403). Don’t reconnect: fix the credential or the account first. There is one retryable case. If the credential store has not confirmed the key for 90 seconds, the frame carries database_unavailable and retry: true. Reconnect after error.retry_at with Last-Event-ID set to that frame’s id, and the replay covers what you missed. A browser EventSource also fires its own error event when the connection fails, with no data, so check event.data before you parse it. @0xinsider/sdk gives you the frame from streamFeed() as an envelope with type error, and streamFeedResilient() stops on the reconnect’s 4xx.

Example

What it does not return

  • An open stream past the cap of 5 connections per key, or past the cluster-wide ceiling. Over either, you get 429 with Retry-After, so close the connections you are not reading.
  • An open stream while the admission or replay service is down. You get 503 with Retry-After: reconnect after the wait.
  • Another account’s targeted events. Alert and following frames reach only the key that owns them.
  • Frames older than the retained window. You get one resync marker instead.
  • Recomputed Polymarket data. Each frame is the envelope 0xinsider broadcasts internally, forwarded as it is.
  • Anything at all on an idle connection, apart from the keep-alive comment every 5 seconds.
  • Frames after the key or the account stops authorizing the stream. You get one event: error frame, and then the connection closes.

Authorizations

Authorization
string
header
required

Legacy default or named integration API key, or OAuth 2.1 access token, in the Authorization header as Bearer oxi_sk_live_... or Bearer oxi_at_.... Default keys retain full access; integration keys are limited to their approved read, webhooks, export and usage scopes and expire within 90 days. All credentials share the owner's account limits. Data calls require an active Pro subscription and return live data. A 401 carries WWW-Authenticate: Bearer resource_metadata="https://api.0xinsider.com/.well-known/oauth-protected-resource" (RFC 6750 section 3, RFC 9728).

Headers

X-Query-Validation
enum<string>

Opt into strict query-name validation. The default is compatible: unknown names are ignored and reported in X-Query-Ignored. With strict, an unknown name returns 400 bad_request with error.reason unknown_query_parameter before the handler runs, including when its percent escape is incomplete.

Available options:
strict
Last-Event-ID
string

Cluster-shared sequence id of the last frame the client successfully processed. The stream replays the strictly-newer retained window before resuming live, even when reconnect routing changes replicas. A future or expired id emits resync. Browser EventSource clients send this automatically on reconnect. Omit to attach live from now.

Query Parameters

last_event_id
string

Query-string fallback for the Last-Event-ID resume cursor when the client cannot set the request header. Numeric cluster-shared sequence id; non-numeric or absent attaches live with no replay. A future or expired id emits resync.

seq
string

Alias for last_event_id. Numeric cluster-shared sequence id to resume after; non-numeric or absent attaches live with no replay. A future or expired id emits resync.

event
string

Optional per-connection subscribe-time filter. Comma-separated list of frame wire types (the SSE 'type' discriminator, e.g. WhaleTradesInserted,wallet_grade_changed); a frame passes only when its type is in the set. An unknown token returns HTTP 400 naming the offending value. An empty/all-whitespace value is treated as absent (no constraint). Applied to BOTH the replay window and live frames, and always AFTER the per-subscriber privacy gate, so it can never widen visibility beyond what the key may already see. Combines with condition_id and min_grade as a logical AND; an absent param adds no constraint.

condition_id
string

Optional per-connection subscribe-time filter. Raw provider condition_id or mkt_-prefixed market id (normalized the same way the other v1 market endpoints normalize). A frame passes only when it carries a matching condition_id field; frames that carry no condition_id (e.g. whale-pulse events) are EXCLUDED while this is set. An empty value after normalization returns HTTP 400. Combines with event and min_grade as a logical AND; an absent param adds no constraint.

min_grade
enum<string>

Optional per-connection subscribe-time filter. A frame passes only when it carries a grade field whose grade is better-or-equal to this minimum (S is best). Frames without a grade (every frame except wallet_grade_changed and LargeTradeInsertedV2) are excluded. An invalid grade returns HTTP 400. Combines with the other filters as a logical AND.

Available options:
S,
A,
B,
C,
D,
F
wallet
string

Filter LargeTradeInsertedV2 frames to this Polymarket wallet. Other event types have no wallet and are excluded when set. Applied to live and retained Redis frames after privacy checks.

Pattern: ^0x[a-fA-F0-9]{40}$
min_size
string

Filter LargeTradeInsertedV2 frames to trades at or above this USD notional. Positive decimal with at most six places; other event types are excluded when set.

Pattern: ^[0-9]+(\.[0-9]{1,6})?$

Response

Open Server-Sent Events stream. The body is an unbounded text/event-stream of frames; each data frame is a JSON feed envelope (with cluster-shared seq, published_at, type, and event-specific fields) and carries an SSE id equal to seq. resync marker frames use event: resync for expired, future, lagged, sequence-reset, or otherwise uncovered cursors. A terminal event: error frame (id: , data: { type: 'error', error: { code, message, ... }, retry: }) ends the stream when the key or account it was opened with no longer authorizes it, or when the credential store has not confirmed it within 90 seconds; the connection closes after it.

Newline-delimited SSE frames: 'id: \ndata: \n\n' for events, 'event: resync\nid: \ndata: \n\n' for resync markers, 'event: error\nid: \ndata: \n\n' as the one terminal frame when the credential stops authorizing the stream, and ': keep-alive' comment lines while idle.