Skip to content

Connecting: REST and streaming

There are two ways to get your channel’s donations, goals, top donors, donation totals, and Twitch and YouTube events:

  • REST: your program requests data from the API. Use it for websites, reports or bots that can poll every few seconds.
  • Centrifugo stream: the API sends events over an open WebSocket or HTTP connection. Use it for overlays, stream alerts or bots that need events without polling.
REST Centrifugo stream
When you need it a website, a report, a simple bot an overlay, an alert on stream, a bot
How new data arrives in the response to the next request as an event in the open connection
What happens on a drop repeat the request; read what you missed page by page the channel history or a REST catch-up covers the gap: conditions
Key secret; public for the profile, goals and stats secret only
Key scopes the scope required by the method the scope required by the channel

Platform delays apply to both REST and the stream. Twitch subscriptions arrive later than other events; YouTube events arrive after polling. See Twitch conditions and YouTube conditions.

For what channel history can recover, when to catch up over REST and which timestamp to start from, see History and catch-up. For the steps and requests, see the Stream and catch-up example.

For the scope required by each source, see Keys and scopes. For dashboard setup and when Donation Alerts, Twitch and YouTube events become available, see Source conditions.