Thanks for the reply!!
That’s weird. One example is https://sullygnome.com/
I can just select any channel, no login required and I can get a bunch of analytics info.
Also. What I need in order to get a list of followers by channel name ?
I was generating the Access_Token
, but I found your old response here and I got confused. So I need NO TOKEN at all?
I was generating token like (my own info from my dashboard):
async function getToken() {
const clientId = ENV.CLIENT_ID
const secret = ENV.SECRET
const url = `https://id.twitch.tv/oauth2/token?client_id=${clientId}&client_secret=${secret}&grant_type=client_credentials`
const { data } = await axios.post(url)
console.log(data)
return data
}
Reading get-users endpoint, I do need to pass as Authorization
value.
Here I was trying to get user info
async function getData() {
const url = "https://api.twitch.tv/helix/users?login=ghaleon_rlz"
const { access_token } = await getToken()
const data = await axios.get(url, {
headers: { Authorization: `Bearer ${access_token}` }
})
return data
}
But it returns
data: {
error: 'Unauthorized',
status: 401,
message: 'Client ID and OAuth token do not match'
}
Could you give me some light?