Online Twitch Code - Please help

This is a copy of a code i am looking to use on a website, however i have two username that i know are live and one that is not how ever it shows off line or account closed!!

Can you help

//I toggle this to alternate flip style
var flipX = true;

//This seems like it could be refactored into several smaller functions…
function addStreamer(name){

//Request channel data
var url = “”+name;

//Get channel info
var stream =,
    pic = response.logo ? response.logo : "",
    status = response.status,
    link = response.url;

//Request streaming data
var url=""+name;
  //Streaming status
  var online = == null ? "offline" : "online";
  //Build streamer card html & add to list
  flipX = !flipX;
  var flipType = flipX ? "flipper" : "flipperX";
  var container = $("<div></div>",{title:status,class:"streamer "+flipType}),
      l = $("<a>",{href:link}),
      r = $("<div>",{class:"row"}),
      n = "<div class='streamer-name'>"+name+"</div>",
      p = "<img class='streamer-pic cell' src='"+pic+"'>",
      o = $("<div>",{class:'streamer-online cell'}).append(online);
  if (online != "online") o.css("color","#ccc");


var container = $("

",{title:status,class:“streamer flipper”}),
l = $("",{href:"#"}),
r = $("
n = “
p = “”,
o = $("
",{class:‘streamer-online cell’}).append(“account closed”);

function showAll(){

function showOnline(){
if ($(this).text() == “offline” || $(this).text() == “account closed”) $(this).parent().parent().hide();
else $(this).parent().parent().show();

function showOffline(){
if ($(this).text() == “offline” || $(this).text() == “account closed”) $(this).parent().parent().show();
else $(this).parent().parent().hide();

function search(str){
var n = $(this).text().toLowerCase();
if (n.indexOf(str.toLowerCase()) > -1){

function initialStreamers(){
var streamers = [“MedryBW”,“freecodecamp”, “storbeck”, “johnnymccrum”, “habathcx”,“RobotCaleb”,“jax_macky”,“noobs2ninjas”,“NoCopyrightSounds”,“brunofin”,“comster404”];
var delay=400;,i,a){

//Create Default streamers



You’re missing client id.

Okay, im a little confused, i have my API Key,

But which one of the codes.


type: ‘GET’,
url: ‘’,
headers: {
‘Client-ID’: ‘axjhfp777tflhy0yjb5sftsil’
success: function(data) {
curl -i -H ‘Accept: application/vnd.twitchtv.v3+json’\
-H ‘Client-ID: axjhfp777tflhy0yjb5sftsil’\

<?php $channelsApi = ''; $channelName = 'twitch'; $clientId = 'axjhfp777tflhy0yjb5sftsil'; $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_HTTPHEADER => array( 'Client-ID: ' . $clientId ), CURLOPT_RETURNTRANSFER => true, CURLOPT_URL => $channelsApi . $channelName )); $response = curl_exec($ch); curl_close($ch); ?>

And where do i put the code???

The easiest way is

var url=""+name+"?client_id=your_client_id";

The Client-ID in the code above isn’t valid. It was used for illustration purposes in the v3 documentation. You’ll need to register a developer application and get your own Client-ID as shown in the Using the Twitch API documentation.


Yeah i copied the original streamid from the actual template.
I have my code i just had no idea where in the code above to put it

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.