npm install twitcher
or
yarn add twitcher
Get your app information from https://dev.twitch.tv/console If you don't have an app, create one
Get Copy your application's CLIENT_ID and CLIENT_SECRET information
import Twtitcher from "twitcher"
const client = new Twitcher({
token:"", client_id:"YOUR CLIENT ID", client_secret:"YOUR CLIENT SECRET"
});
const token = client.getToken()
const client = new Twitcher({
token:"YOUR TOKEN", client_id:"YOUR CLIENT ID", client_secret:"YOUR CLIENT SECRET"
});
Return your token information
Paramaters
- ClipURL: Twitch Clip URL
Response
- Clip Data
import Twitcher from "twitcher"
let client = new Twitcher({
token:"YOUR TOKEN",
client_id:"YOUR CLIENT ID",
})
let clip = await client.getClip("https://clips.twitch.tv/NimbleDeadYamBIRB-drT9My-tdEwUBsZq")
console.log(clip)
{
success: true,
streamer: {
id: '51950404',
login: 'wtcn',
display_name: 'wtcN',
type: '',
broadcaster_type: 'partner',
description: 'for business inquiries : ilaydaparlak@bigbosslayf.com',
profile_image_url: 'https://static-cdn.jtvnw.net/jtv_user_pictures/28b40271-8bb1-4a27-9ad7-8e9a55e06180-profile_image-300x300.png',
offline_image_url: 'https://static-cdn.jtvnw.net/jtv_user_pictures/dd103946-4760-46c0-8f4a-838df780baaf-channel_offline_image-1920x1080.jpeg',
view_count: 0,
created_at: '2013-11-22T07:16:15Z'
},
creator: {
id: '571983883',
login: 'gweepcreative',
display_name: 'GweepCreative',
type: '',
broadcaster_type: '',
description: 'Md. Backend Developer // @Discord Employee',
profile_image_url: 'https://static-cdn.jtvnw.net/jtv_user_pictures/f618ba01-c0cb-45b1-930d-64a01b5568c9-profile_image-300x300.png',
offline_image_url: 'https://static-cdn.jtvnw.net/jtv_user_pictures/fd7758e3-fdc6-4b28-9883-1da2fe560513-channel_offline_image-1920x1080.png',
view_count: 0,
created_at: '2020-08-24T06:51:19Z'
},
clip: {
id: 'NimbleDeadYamBIRB-drT9My-tdEwUBsZq',
url: 'https://clips.twitch.tv/NimbleDeadYamBIRB-drT9My-tdEwUBsZq',
video_url: 'https://clips-media-assets2.twitch.tv/Xmupnna0_TMvrXRMFAbGag/40984345048-offset-2692.mp4',
embed_url: 'https://clips.twitch.tv/embed?clip=NimbleDeadYamBIRB-drT9My-tdEwUBsZq',
video_id: '',
game_id: '516575',
language: 'en',
title: 'neeğğğğ?? (obbserver feritin aklıyla oynuyor)',
view_count: 230,
created_at: '2023-08-12T19:37:17Z',
thumbnail_url: 'https://clips-media-assets2.twitch.tv/Xmupnna0_TMvrXRMFAbGag/40984345048-offset-2692-preview-480x272.jpg',
duration: 28,
vod_offset: null,
is_featured: false
}
}
Paramaters
- game_name(string): Twitch game name
Response
- Game Data
import Twitcher from "twitcher"
let client = new Twitcher({
token:"YOUR TOKEN",
client_id:"YOUR CLIENT ID",
})
let game = await client.getGameByName("Fortnite")
console.log(game)
{
success: true,
data: [
{
id: '33214',
name: 'Fortnite',
box_art_url: 'https://static-cdn.jtvnw.net/ttv-boxart/33214-{width}x{height}.jpg',
igdb_id: '1905'
}
]
}
Paramaters
- game_id(Number): Twitch game id
Response
- Game Data
import Twitcher from "twitcher"
let client = new Twitcher({
token:"YOUR TOKEN",
client_id:"YOUR CLIENT ID",
})
let game = await client.getGameById("509658")
console.log(game)
{
success: true,
data: [
{
id: '509658',
name: 'Just Chatting',
box_art_url: 'https://static-cdn.jtvnw.net/ttv-boxart/509658-{width}x{height}.jpg',
igdb_id: ''
}
]
}
Paramaters
- query: Twitch channel name
- type: String
Response
- Channel Data (Array)
import Twitcher from "twitcher"
let client = new Twitcher({
token:"YOUR TOKEN",
client_id:"YOUR CLIENT ID",
})
let channels = await client.searchChannel("gweepcreative")
console.log(channels)
[
{
broadcaster_language: 'tr',
broadcaster_login: 'gweepcreative',
display_name: 'GweepCreative',
game_id: '516575',
game_name: 'VALORANT',
id: '571983883',
is_live: false,
tag_ids: [],
tags: [ 'oyun', 'ghosts', 'valorant', 'espor', 'ESports', 'Türkçe' ],
thumbnail_url: 'https://static-cdn.jtvnw.net/jtv_user_pictures/f618ba01-c0cb-45b1-930d-64a01b5568c9-profile_image-300x300.png',
title: 'RANKED VALO',
started_at: ''
},
{
broadcaster_language: '',
broadcaster_login: 'gweep_creative',
display_name: 'gweep_creative',
game_id: '0',
game_name: '',
id: '606695369',
is_live: false,
tag_ids: [],
tags: [],
thumbnail_url: 'https://static-cdn.jtvnw.net/user-default-pictures-uv/ce57700a-def9-11e9-842d-784f43822e80-profile_image-300x300.png',
title: '',
started_at: ''
},
{
broadcaster_language: '',
broadcaster_login: 'gweepcreative2',
display_name: 'gweepcreative2',
game_id: '0',
game_name: '',
id: '678460694',
is_live: false,
tag_ids: [],
tags: [],
thumbnail_url: 'https://static-cdn.jtvnw.net/user-default-pictures-uv/294c98b5-e34d-42cd-a8f0-140b72fba9b0-profile_image-300x300.png',
title: '',
started_at: ''
},
{
broadcaster_language: '',
broadcaster_login: 'gweepcreative22',
display_name: 'gweepcreative22',
game_id: '0',
game_name: '',
id: '720647790',
is_live: false,
tag_ids: [],
tags: [],
thumbnail_url: 'https://static-cdn.jtvnw.net/user-default-pictures-uv/75305d54-c7cc-40d1-bb9c-91fbe85943c7-profile_image-300x300.png',
title: '',
started_at: ''
}
]
Paramaters
- query: Twitch channel/user name
- type: String
Response
- Channel/User Data
import Twitcher from "twitcher"
let client = new Twitcher({
token:"YOUR TOKEN",
client_id:"YOUR CLIENT ID",
})
let user = await client.searchUserByName("gweepcreative")
console.log(user)
{
success: true,
data: [
{
id: '571983883',
login: 'gweepcreative',
display_name: 'GweepCreative',
type: '',
broadcaster_type: '',
description: 'Md. Backend Developer // @Discord Employee',
profile_image_url: 'https://static-cdn.jtvnw.net/jtv_user_pictures/f618ba01-c0cb-45b1-930d-64a01b5568c9-profile_image-300x300.png',
offline_image_url: 'https://static-cdn.jtvnw.net/jtv_user_pictures/fd7758e3-fdc6-4b28-9883-1da2fe560513-channel_offline_image-1920x1080.png',
view_count: 0,
created_at: '2020-08-24T06:51:19Z'
}
]
}
Paramaters
- query: Twitch channel/user id
- type: String
Response
- Channel/User Data
import Twitcher from "twitcher"
let client = new Twitcher({
token:"YOUR TOKEN",
client_id:"YOUR CLIENT ID",
})
let user = await client.searchUserByUserId("571983883")
console.log(user)
{
success: true,
data: [
{
id: '571983883',
login: 'gweepcreative',
display_name: 'GweepCreative',
type: '',
broadcaster_type: '',
description: 'Md. Backend Developer // @Discord Employee',
profile_image_url: 'https://static-cdn.jtvnw.net/jtv_user_pictures/f618ba01-c0cb-45b1-930d-64a01b5568c9-profile_image-300x300.png',
offline_image_url: 'https://static-cdn.jtvnw.net/jtv_user_pictures/fd7758e3-fdc6-4b28-9883-1da2fe560513-channel_offline_image-1920x1080.png',
view_count: 0,
created_at: '2020-08-24T06:51:19Z'
}
]
}