Skip to content

HasStreamMethods ​

php
trait Zairakai\LaravelTwitch\Services\Concerns\HasStreamMethods

Twitch Stream, Clip, and Video API methods.

Source: src/Services/Concerns/HasStreamMethods.php

Methods ​

createClip() ​

php
public function createClip(string $broadcasterId, string $title = null, float $duration = null): ClipEdit

Create a clip from a broadcaster's stream.

ParameterDescription
$durationClip length in seconds, 5-60, precision 0.1. Defaults to 30.

createClipFromVod() ​

php
public function createClipFromVod(string $editorId, string $broadcasterId, string $vodId, int $vodOffset, string $title, float $duration = null): ClipEdit

Create a clip from a broadcaster's VOD (or the current live stream's in-progress VOD) at a specific offset.

ParameterDescription
$editorIdThe editor's user ID - same as $broadcasterId when using the broadcaster's own token
$broadcasterIdThe editor's user ID - same as $broadcasterId when using the broadcaster's own token
$vodOffsetZero-based offset, in seconds, where the clip ends
$durationClip length in seconds, 5-60, precision 0.1. Defaults to 30.

createStreamMarker() ​

php
public function createStreamMarker(string $userId, string $description = null): StreamMarker

Add a marker to a live stream at the current timestamp.

deleteVideo() ​

php
public function deleteVideo(string|array $videoIds): array

Delete one or more videos from a broadcaster's channel.

ParameterDescription
$videoIdsVideo ID(s) to delete

Returns array<string> IDs of the deleted videos

getClips() ​

php
public function getClips(string $broadcasterId, string|array|null $clipIds = null, int $first = 20, string $after = null, string $startedAt = null, string $endedAt = null): PaginatedResult

Get clips from a broadcaster's channel.

ParameterDescription
$clipIdsFilter by specific clip ID(s)

Returns PaginatedResult<Clip>

getClipsDownloads() ​

php
public function getClipsDownloads(string $editorId, string $broadcasterId, string|array $clipIds): DataCollection

Get download URLs for one or more clips.

ParameterDescription
$clipIdsOne or more clip IDs to download (max 10)

Returns DataCollection<int, ClipDownload>

getFollowedStreams() ​

php
public function getFollowedStreams(string $userId, int $first = 20, string $after = null): PaginatedResult

Get streams from channels that the authenticated user follows.

Returns PaginatedResult<Stream>

getStreamKey() ​

php
public function getStreamKey(string $broadcasterId): StreamKey

Get the stream key for the broadcaster's channel.

getStreamMarkers() ​

php
public function getStreamMarkers(string $userId, string $videoId = null, int $first = 20, string $after = null): PaginatedResult

Get stream markers from a VOD or live stream.

Returns PaginatedResult<StreamMarkerGroup>

getStreams() ​

php
public function getStreams(string|array|null $userIds = null, string|array|null $gameIds = null, string|array|null $languages = null, int $first = 20, string $after = null): PaginatedResult

Get information about active streams.

ParameterDescription
$userIdsFilter by user ID(s)
$gameIdsFilter by game ID(s)
$languagesFilter by language(s)

Returns PaginatedResult<Stream>

getVideos() ​

php
public function getVideos(string $userId = null, string $gameId = null, string|array|null $videoIds = null, string $type = 'all', int $first = 20, string $after = null): PaginatedResult

Get videos (past broadcasts, highlights, uploads) for a broadcaster.

ParameterDescription
$videoIdsFilter by specific video ID(s)
$typeall, upload, archive, or highlight

Returns PaginatedResult<Video>

Documentation of 4.1.4 , built from a03e949 on 4.1.4 by pipeline #2949087255 on 2026-10-11.