Get Twitch Stream Viewer Count by Channel Login

View all Twitch Channel, Clips, Videos & Stream Data endpoints →

Returns the viewer-count information available for the current stream of one Twitch channel, as a snapshot taken at request time. Input: channel (required) is the channel login shown in the public Twitch URL, for example ninja, not a display title. Observed in a live probe for channel ninja while the channel was offline: HTTP 200 with the standard envelope {status, request_id, message, data}; status was 'ok', message was null, and data.user held id (a string), stream set to null and __typename 'User'. With a null stream there was no viewer figure in the response, which is a documented valid result. The populated live-stream branch was not observed in the probe, so the name of the viewer-count field is not documented here; inspect a response from a live channel before mapping it, and keep a missing value distinct from numeric zero. The number is the audience of the current stream, which is different from historical video views or total channel followers. The operation provides no audience history or time series, so record your own retrieval timestamp with every snapshot.

API Features

Concurrent viewer snapshot Send a channel login and get the viewer-count information for that channel's current stream as it stands at request time, without a Twitch developer app or token refresh.
Absent value is not zero In the probe an offline channel returned status 'ok' with data.user.stream set to null and no viewer figure, so you can store NULL for offline samples instead of recording a false zero.
Not followers, not video views The figure describes the live audience of the current stream only, so it stays separate from follower totals in channel details and from historical video views.
Flat request built for samplers A single required string parameter and a small data.user payload make it cheap to call on a timer for a whole roster and write channel, timestamp and value rows.
Time series is yours to build The endpoint returns no audience history, so the peak, average and trend you compute come from the snapshots you collect, each stamped with your own retrieval time.

Live API Demo

GET /api/project/twitch-scraper/get-stream-viewer-count

Request cost is temporarily unavailable. No price is assumed.

View pricing

API Response (JSON)

{}
curl -X GET 'https://api.opendata-api.com/api/project/twitch-scraper/get-stream-viewer-count?key=<API_KEY>&channel=ninja'
📢
Need Help?
If you encounter API issues or need other API requirements, please contact us.
Contact Us

Use Cases

Frequently asked questions

What does the viewer count call return for an offline channel?

In the probe for channel ninja the channel was offline and the response was status 'ok' with a null message and data.user.stream set to null. No viewer figure was present, so treat the value as unavailable rather than zero.

What is the name of the viewer-count field when a channel is live?

The populated live-stream branch was not observed in the probe, so the field name is not documented here. Call the endpoint while the channel is broadcasting and read the field from data.user.stream before you build your schema.

How do I record an offline sample?

Store NULL (or a separate offline flag) with the retrieval timestamp. Keep an absent or unavailable value distinct from numeric zero, because zero would claim that a live stream had no viewers.

Is this the same as total views or followers?

No. It reflects the audience of the current stream, which is different from historical video views and from the follower total returned by Get Channel Details. Keep them in separate columns.

Can I get viewer history or a time series from this endpoint?

No. It is a snapshot at request time and does not provide historical audience trends. Poll on your own schedule and store each result with the time you retrieved it.

Does the viewer count update in real time?

Treat it as a point-in-time value at the moment of the call. Channel offline status or Twitch availability can affect the result, so sample at an interval that suits your use case and do not assume continuity between calls.

What do I pass as the channel parameter?

Pass the channel login from the public Twitch URL, for example ninja. If you only know a display name, find the login with Search Channels first and reuse it here.

Related operations

Guides

View Subscription Plans →