New Twitch API - Beginner Q

First of all greetings to all ,

Second sorry for my question , it seems stupid but i struggle to understand from the new twitch api documentations how to setup my my environment to fetch data . I will use axios to fetch data and combine it with js css and html to build a simple app . I cant find out which is the correct url to fetch data from , and when iam using my client_id=XXXX its still decline my request. Can someone please guide me through to set this up .

Appreciate .

1 Like
const client_id = 'xxxxx';

const helix = axios.create({
  baseURL: 'https://api.twitch.tv/helix/',
  headers: {'Client-ID': client_id}
});

const kraken = axios.create({
  baseURL: 'https://api.twitch.tv/kraken/',
  headers: {'Client-ID': client_id}
});


// ...

helix.get('path/to/a/helix/endpoint').then(function (response) {
	console.log(response);
});

kraken.get('path/to/a/kraken/endpoint').then(function (response) {
	console.log(response);
});

3 Likes

thank you so much !

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