Gets all scheduled broadcasts or specific scheduled broadcasts from a channel’s stream schedule. Scheduled broadcasts are defined as “stream segments” in the API.

get_schedule(
  broadcaster_id = NULL,
  id = NULL,
  start_time = NULL,
  utc_offset = NULL,
  first = NULL,
  after = NULL,
  clean_json = TRUE
)

Arguments

broadcaster_id

A string. User ID of the broadcaster who owns the channel streaming schedule. Provided broadcaster_id must match the user_id in the user OAuth token. Maximum: 1

id

A string. The ID of the stream segment to return. Maximum: 100.

start_time

A string. A timestamp in RFC3339 format to start returning stream segments from. If not specified, the current date and time is used.

utc_offset

A string. A timezone offset for the requester specified in minutes. This is recommended to ensure stream segments are returned for the correct week. For example, a timezone that is +4 hours from GMT would be “240.” If not specified, “0” is used for GMT.

first

A numeric. Maximum number of stream segments to return. Maximum: 25. Default: 20.

after

A string. Cursor for forward pagination: tells the server where to start fetching the next set of results in a multi-page response. The cursor value specified here is from the pagination response field of a prior query.

clean_json

A logical. If TRUE, clean and tidy the data. If FALSE, return the result of httr::content.

Value

A named list. data (tibble): the users schedule, NULL if no schudule. vacation (tibble): the users vacation dates, NULL if no vacation. pagination (character): Pagination value for the after parameter to get more data.

Details

If a Twitch streamer uses recurring scheduling the pagination will be infinite.

See also

Examples

if (FALSE) {
library(twitchr)

twitch_auth()

## I set my account to be on vacation from "July 16, 2021"
## to "July 16, 2026" for testing. There are also 4 days
## of recurring streams with different values for testing.
users <- get_users(login = "KoderKow")

schedule <- get_schedule(users$id)
}