I’m working with VB.NET to fetch streamer data from Twitch’s API but running into weird issues. Most of the time everything works perfectly, but sometimes I only get partial information back from the API call.
Here’s my current code:
Dim apiResponse As String = FetchWebContent(New Uri("https://api.twitch.tv/kraken/streams?channel=" & streamers & "&limit=1000"))
Dim jsonData As JObject = JObject.Parse(apiResponse)
Dim streamList As JToken = jsonData("streams")
For Each stream_info As JToken In streamList
Dim streamerName As String = stream_info("channel")("display_name").ToString()
Dim viewerCount As String = stream_info("viewers")
Dim isPartner As String = "False"
Dim streamTitle As String = "Unknown"
Dim gameImage As String = "http://static-cdn.jtvnw.net/ttv-boxart/Unknown-92x128.jpg"
'Workaround for the missing data problem
If stream_info("channel")("partner") Then
isPartner = stream_info("channel")("partner").ToString()
streamTitle = stream_info("channel")("status").ToString()
gameImage = "http://static-cdn.jtvnw.net/ttv-boxart/" & stream_info("channel")("game").ToString() & "-92x128.jpg"
End If
'Process the retrieved data
Next
The problem is that sometimes the API returns incomplete channel data. When it works correctly, I get the full channel object with all properties like partner status, game info, and stream title. But randomly, some channels return minimal data that looks like it’s coming from a different endpoint entirely. It’s not consistent - the same channel might work fine one request and fail the next. Has anyone experienced similar issues with Twitch API responses being inconsistent?