Twitch with supplied data

I came across the post that provided the data that the Twitch API would return. I’m using that in my project but I dont see any field that indicates whether the user is streaming or not (online or offline). How do we make that determination?

The response will contain a property call stream. If it is null (like in the case for freecodcamp right now), it means it is not streaming and will look like:

  "stream": null,
  "_links": {
    "self": "",
    "channel": ""

If stream is not null, then it is streaming and you will get more information about the stream like in the following response:

  "stream": {
    "_id": 27708760768,
    "game": "Overwatch",
    "viewers": 151205,
    "video_height": 1080,
    "average_fps": 59.9400599401,
    "delay": 0,
    "created_at": "2018-02-23T23:45:58Z",
    "is_playlist": false,
    "stream_type": "live",
    "preview": {
      "small": "",
      "medium": "",
      "large": "",
      "template": "{width}x{height}.jpg"
    "channel": {
      "mature": false,
      "partner": true,
      "status": "Stage 2 Week 1 Day 3 | London Spitfire vs. New York Excelsior\n",
      "broadcaster_language": "en",
      "display_name": "OverwatchLeague",
      "game": "Overwatch",
      "language": "en",
      "_id": 137512364,
      "name": "overwatchleague",
      "created_at": "2016-10-20T21:24:38Z",
      "updated_at": "2018-02-24T01:06:42Z",
      "delay": null,
      "logo": "",
      "banner": null,
      "video_banner": "",
      "background": null,
      "profile_banner": "",
      "profile_banner_background_color": "",
      "url": "",
      "views": 31888490,
      "followers": 689281,
      "_links": {
        "self": "",
        "follows": "",
        "commercial": "",
        "stream_key": "",
        "chat": "",
        "features": "",
        "subscriptions": "",
        "editors": "",
        "teams": "",
        "videos": ""
    "_links": {
      "self": ""
  "_links": {
    "self": "",
    "channel": ""
1 Like

Yes, I saw all that. In the sample application that we are reverse engineering, there were 2 users showing as offline but they both showed icons. In the case where stream = null, there is no icon element so that threw me off. I guess I’ll just force a default icon along with the user name and an “offline” indication in this case. Thanks.

If you want to get the actual icon for the username, then you can use the other endpoint ( and it has a logo property you could use.