Skip to content
twitch.apiv2.0

Reference / API groups

twitch.clips

Clips: create, look up and download clips.

Every method of twitch.clips, with its parameters, what it returns and the token it needs.

twitch.clips.create(params, options?): Promise<CreatedClip>

Clips the last seconds of a live stream. The clip is made in the background: look it up with get to know when it is ready, and consider it failed when it is still missing after 60 seconds.

Token: user, scope clips:edit.

NameTypeDescription
broadcaster_id requiredstringBroadcaster whose live stream to clip.
titlestringTitle of the clip. Twitch picks one when left out.
durationnumberLength of the clip in seconds, 5 to 60 with one decimal. Twitch defaults to 30.

options: Request options for this call: as, token, signal, timeout, retries.

Promise<CreatedClip>

Fields of CreatedClip
NameTypeDescription
idstringID of the clip.
edit_urlstringURL of the page where the clip can be trimmed, renamed and published.
const clip = await twitch.clips.create({ broadcaster_id: "141981764", title: "What a save" });
console.log(clip.edit_url);

Twitch reference

twitch.clips.createFromVod(params, options?): Promise<CreatedClip>

Clips a passage of a video, as the broadcaster or one of the channel’s editors. It also works on the video of a stream that is still live.

Token: app or user, scope editor:manage:clips or channel:manage:clips.

NameTypeDescription
editor_idstringEditor of the channel who creates the clip, or the broadcaster. Defaults to the user making the call.
broadcaster_id requiredstringBroadcaster who owns the video.
vod_id requiredstringID of the video to clip.
vod_offset requirednumberWhere the clip ends, in seconds from the start of the video. The clip covers the duration seconds before this point, so it cannot be smaller than duration.
durationnumberLength of the clip in seconds, 5 to 60 with one decimal. Twitch defaults to 30.
title requiredstringTitle of the clip.

options: Request options for this call: as, token, signal, timeout, retries.

Promise<CreatedClip>

Fields of CreatedClip
NameTypeDescription
idstringID of the clip.
edit_urlstringURL of the page where the clip can be trimmed, renamed and published.
const clip = await twitch.clips.createFromVod({
editor_id: "141981764",
broadcaster_id: "141981764",
vod_id: "2301456789",
vod_offset: 600,
title: "Opening",
});

Twitch reference

twitch.clips.get(params, options?): Paginator<Clip>

Lists the clips of a broadcaster or of a category, most viewed first, or gets clips by ID. Twitch stops paging after about 1000 results: narrow the dates to reach more.

Token: app or user.

NameTypeDescription
broadcaster_idstringClips taken from the streams of this broadcaster.
game_idstringClips taken from streams in this category.
idstring | readonly string[]These clips. Up to 100 IDs.
started_atstring | DateOnly clips created from this moment on.
ended_atstring | DateOnly clips created before this moment. Twitch defaults to one week after started_at.
firstnumberItems per page, 1 to 100. Twitch defaults to 20.
beforestringCursor of the previous page.
afterstringCursor of the next page.
is_featuredbooleantrue for featured clips only, false for the others only. Both kinds when left out.

options: Request options for this call: as, token, signal, timeout, retries.

Paginator<Clip>

Fields of Clip
NameTypeDescription
idstringID of the clip.
urlstringURL of the clip page.
embed_urlstringURL to put in an iframe to embed the clip.
broadcaster_idstringID of the broadcaster the clip was taken from.
broadcaster_namestringDisplay name of the broadcaster.
creator_idstringID of the user who made the clip.
creator_namestringDisplay name of the user who made the clip.
video_idstringID of the video the clip comes from. An empty string when the video is gone.
game_idstringID of the category that was being streamed.
languagestringLanguage of the broadcaster: an ISO 639-1 code, or "other".
titlestringTitle of the clip.
view_countnumberNumber of views.
created_atstringWhen the clip was created, as an RFC 3339 timestamp.
thumbnail_urlstringURL of a preview image.
durationnumberLength of the clip in seconds, with one decimal.
vod_offsetnumber | nullWhere the clip starts in the video, in seconds. null when the video is not available, and for the first minutes after a clip is made live.
is_featuredbooleanWhether the broadcaster featured the clip.
const top = await twitch.clips.get({ broadcaster_id: "141981764" }).take(10);
const [clip] = (await twitch.clips.get({ id: "BraveQuietHeronPogChamp" })).data;

Twitch reference

twitch.clips.downloads(params, options?): Promise<ClipDownload[]>

Gets temporary links to the video files of clips, as the broadcaster or one of the channel’s editors.

Token: app or user, scope editor:manage:clips or channel:manage:clips.

NameTypeDescription
editor_idstringEditor of the channel who asks for the files, or the broadcaster. Defaults to the user making the call.
broadcaster_id requiredstringBroadcaster who owns the clips.
clip_id requiredstring | readonly string[]IDs of the clips to download. Any number: long lists are split for you.

options: Request options for this call: as, token, signal, timeout, retries.

Promise<ClipDownload[]>

Fields of ClipDownload
NameTypeDescription
clip_idstringID of the clip.
landscape_download_urlstring | nullURL of the landscape video file, or null when there is none.
portrait_download_urlstring | nullURL of the portrait video file, or null when there is none.
const [file] = await twitch.clips.downloads({
editor_id: "141981764",
broadcaster_id: "141981764",
clip_id: "BraveQuietHeronPogChamp",
});

Twitch reference