Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

339
Vistas
Check if a Twitch Stream Is Live Using node js

I don't know how to combine them. I made a code by referring to the link below. Please Help me...

Android - Checking if a twitch stream is online

Is There Any Way To Check if a Twitch Stream Is Live Using Python?

setting

export const CHANNEL_NAME = ["daXXXXXX", "gmXXXXXXX"];
export const OAUTH_TOKEN = 'oauth:bn1rXXXXXXXXXXXXXXXXX';
export const CLIENT_ID = 'bxqtXXXXXXXXXXXXXXXXX';
export const BOT_USERNAME = 'gaXXXXt';

my code

async function test2() {
    var theUrl = `https://api.twitch.tv/kraken/streams/${CHANNEL_NAME[0]}`
    var headers = {
        "Client-ID": CLIENT_ID

    };
    fetch(theUrl, headers).then(data =>{
        console.log(data)
    })
  }
test2()

debug data

Response {
  size: 0,
  timeout: 0,
  [Symbol(Body internals)]: {
    body: PassThrough {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 5,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: true,
      [Symbol(kCapture)]: false,
      [Symbol(kCallback)]: null
    },
    disturbed: false,
    error: null
  },
  [Symbol(Response internals)]: {
    url: 'https://api.twitch.tv/kraken/streams/#daXXXXXX',
    status: 400,
    statusText: 'Bad Request',
    headers: Headers { [Symbol(map)]: [Object: null prototype] },
    counter: 0
  }
}
about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

The twitch kraken has been decommissioned, you need to use the helix api instead.

async function isStreamerLive(username) {
    const theUrl = `https://api.twitch.tv/helix/streams?user_login=${username}`
    const headers = {
        "Client-Id": CLIENT_ID,
        "Authorization": OAUTH_TOKEN
    };

    const response = await fetch(theUrl, headers);
    const data = await response.json();

    return data?.data?.find(s => s.user_login === username.toLocaleLowerCase())
  }
about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda