Sounds like you are “testing” the bottom of the category, where there is general weirdness.
You should also be treating stream, user and game ID’s are strings, not integers.
It’s not something I’ve looked at too much.
Personally I’d not bother looking at the viewcount. Since it’s not a good metric.
If you have a stream
And the streams API says “10 viewers”
The view count might be “20”
As the steam have 5 viewers that are the same user for the entrie stream
And 5 viewers left and 5 new viewers joined, then another 5 reload the page
Which makes 20 views.
Thats my understanding of the counter, but th eview counter is a black box.
if you are looking at the bottom of the directory where weirdness is, Twitch might be ignoring the numbers as part of it’s viewbot/anti spam measures.
And the stream view count is accurate to who is actually watching
But the users view_count is based on a differenent statistic, IE does a user need to have watched the stream for an amount of time before it considers them as a viewer to increase the user view count?
We don’t know. And that is likely the discrepency.
Stream has 5 viewers, that are solidly watching.
Stream has another 5 viewers that keep chaning arriving/leaving.
Best bet is to “consider” the view count on a stream down + a few minutes