TWITCH TV Checking user online or offline

What field and in which of these links should I be checking? I was able to see the users data and I don’t see anything relating to online or offline.
"_links": {
“teams”: “”,
“channel”: “”,
“user”: “”,
“ingests”: “”,
“streams”: “”,
“search”: “


_links doesn’t apear to be much use, it looks like a collection of generic links.

In my solution, I queried<userName> and checked if stream in the response was null or not.

For example, in this screenshot, OgamingSC2 is online because stream is not null, whereas cretetion is offline:

I then used to access the users’ actual streams if they were online.

You can use my pen at and inspect what’s going on there in the network tab of your browser’s dev tools.

I’m not saying that my method is particularly elegant, though. I discovered this method by experimenting with users I knew were online or offline, respectively.

1 Like


I checked the actual actual object structure of the response from calling streams.

[details=spoiler]if (response.hasOwnProperty('stream') && ( !== null)) { //if channel is online {object}


else if (response.hasOwnProperty('stream') && ( === null)) { //if channel is offline {object}[/details]



edit - which is exactly what @janschreiber said :blush:

1 Like

Hi @janschreiber,
Thanks for the information. I will give it a try.

Hi janshchreider,
Where did you learn the HTML and CSS in such detail? Also, how did you know to use streams and channels? This was really difficult to find information. Thanks.

Thanks Markj78 for your response to calling the object.

1 Like

That was the hardest part to figure out. Truth be told, I was two steps shy of quitting Free Code Camp because of this very project. In my opinion, it is the most difficult one required for the front-end certification.

The requirement of an app id had been introduced by the Twitch people just a few days before I started working on it and it was a somewhat messy experience because I was totally new to using AJAX/JSON. But I kept checking back on this forum and GitHub and managed to piece it all together somehow. It was reassuring to see that the FCC team on GitHub was already working on solutions while I was struggling with the challenge.

Well, after some struggling it turned out that the most important piece of information had been there all the time on the page It says in instruction #8:

Hint: The relevant documentation about this API call is here:

The link above is where I got the crucial information that I had to use streams to determine the online status of a user. It is a bit cryptic, but I relied on my experience that FCC challenges always supply you with enough information to get you started, and yes, the necessary information was right there, it was just a bit harder to identify than usual.

Everything else fell into place somehow after I was able to get a useful response from the server. I had the developer tools of my browser open most of the time.

1 Like

Well, the short answer is: I am 43 years old and started learning HTML 4.01 back in 2003 or something as a hobby. I worked through an online course back then and built a few (now defunct) websites. That gives me a bit of background knowledge so I know what to google for.

But basically, I just google everything I don’t know. A few example searches:

These searches will usually refer me to a number of trustworthy websites:

1 Like