Stream catch-up
The events the live WebSocket at wss://stream.vike.io/v1/stream/hl-cohorts sent, from a cursor: what a client missed while it was disconnected, with the same filters.
GET https://data.vike.io/v1/hl-cohorts/stream-eventsThe REST catch-up of wss://stream.vike.io/v1/stream/hl-cohorts: the stored events of one channel after a cursor, oldest
first, filtered with the same keys as the socket (pass them as query parameters). event in each item is exactly what
the socket sent, so dedupe on event.event_id; pass next_cursor back as cursor while has_more is true. A window in
which the channel was idle (nobody subscribed) comes as an item with a gap in its place. The channels and the filters
each takes are listed under the parameters below.
Live is the socket, missed is this route
Subscribe on the WebSocket for events as they happen; call this route only to fill a disconnect. Events are kept three days: an older cursor is a 410 naming the oldest cursor accepted.
# the oldest 50 stored events of the channel; add the socket's filters as query parameters
curl -H "X-API-Key: $VIKE_API_KEY" \
"https://data.vike.io/v1/hl-cohorts/stream-events?channel=hl.cohort_bias&limit=50"channelqueryrequiredhl.cohort_bias, hl.cohort_flow, hl.cohort_leverage, hl.indicescursorqueryoptionalnext_cursor of the previous page or the cursor of a stream frame. Empty: the oldest retained eventlimitqueryoptional