Clips - Get
Description
Gets clip information by clip ID (one or more), broadcaster ID (one only), or game ID (one only).
The response has a JSON payload with a data
field containing an array of clip information elements and a pagination
field containing information required to query for more streams.
Method Definition
@RequestLine("GET /clips?broadcaster_id={broadcaster_id}&game_id={game_id}&id={id}&after={after}&before={before}&first={first}&started_at={started_at}&ended_at={ended_at}&is_featured={is_featured}")
@Headers("Authorization: Bearer {token}")
HystrixCommand<ClipList> getClips(
@Param("token") String authToken,
@Param("broadcaster_id") String broadcasterId,
@Param("game_id") String gameId,
@Param("id") List<String> ids,
@Param("after") String after,
@Param("before") String before,
@Param("first") Integer limit,
@Param("started_at") Instant startedAt,
@Param("ended_at") Instant endedAt,
@Param("is_featured") Boolean isFeatured
);
Required Parameters (one of)
Name | Type | Description |
---|---|---|
broadcaster_id | string | ID of the broadcaster for whom clips are returned. The number of clips returned is determined by the first query-string parameter (default: 20). Results are ordered by view count. |
game_id | string | ID of the game for which clips are returned. The number of clips returned is determined by the first query-string parameter (default: 20). Results are ordered by view count. |
id | string | ID of the clip being queried. Limit: 100. |
Optional Parameters
Name | Type | Description |
---|---|---|
authToken | string | User or App Access Token (or null if authentication was passed to the module builder). |
after | string | Cursor for forward pagination: tells the server where to start fetching the next set of results, in a multi-page response. This applies only to queries specifying broadcaster_id or game_id. The cursor value specified here is from the pagination response field of a prior query. |
before | string | Cursor for backward pagination: tells the server where to start fetching the next set of results, in a multi-page response. This applies only to queries specifying broadcaster_id or game_id. The cursor value specified here is from the pagination response field of a prior query. |
limit | integer | Maximum number of objects to return. Maximum: 100. Default: 20. |
started_at | string | Starting date/time for returned clips, in RFC3339 format. (Note that the seconds value is ignored.) If this is specified, ended_at also should be specified; otherwise, the ended_at date/time will be 1 week after the started_at value. |
ended_at | string | Ending date/time for returned clips, in RFC3339 format. (Note that the seconds value is ignored.) If this is specified, started_at also must be specified; otherwise, the time period is ignored. |
is_featured | boolean | Whether the response includes featured clips. If true, returns only clips that are featured. If false, returns only clips that aren’t featured. All clips are returned if this parameter is not specified. |
Code-Snippets
print clip id's
- Java
- Kotlin
- Groovy
ClipList clipList = twitchClient.getHelix().getClips(null, "488552", null, null, null, null, null, null, null, null).execute();
clipList.getData().forEach(clip -> {
System.out.println("Found Clip: " + clip.getId());
});
val clipList = twitchClient.helix.getClips(null, "488552", null, null, null, null, null, null, null, null).execute();
clipList.`data`.forEach { clip ->
println("Found Clip: ${clip.id}")
}
def clipList = twitchClient.helix.getClips(null, "488552", null, null, null, null, null, null, null, null).execute();
clipList.data.each { clip ->
System.out.println "Found Clip: ${clip.id}"
}