Stream

@Serializable
data class Stream(val id: String, val userId: String, val userLogin: String, val userName: String, val gameId: String = "", val gameName: String = "", val type: String = "", val title: String = "", val tags: List<String>? = null, val viewerCount: Int = 0, val startedAt: Instant? = null, val language: String = "", val thumbnailUrl: String = "", val isMature: Boolean = false)

Represents a live stream on Twitch.

See also

Constructors

Link copied to clipboard
constructor(id: String, userId: String, userLogin: String, userName: String, gameId: String = "", gameName: String = "", type: String = "", title: String = "", tags: List<String>? = null, viewerCount: Int = 0, startedAt: Instant? = null, language: String = "", thumbnailUrl: String = "", isMature: Boolean = false)

Properties

Link copied to clipboard
@SerialName(value = "game_id")
val gameId: String

the ID of the category or game being played.

Link copied to clipboard
@SerialName(value = "game_name")
val gameName: String

the name of the category or game being played.

Link copied to clipboard
val id: String

an ID that identifies the stream. You can use this ID later to look up the video on demand (VOD).

Link copied to clipboard
@SerialName(value = "is_mature")
val isMature: Boolean

Deprecated. This field is deprecated and returns only false.

Link copied to clipboard

the language that the stream uses. This is an ISO 639-1 two-letter language code or other if the stream uses a language not in the list of supported stream languages.

Link copied to clipboard
@SerialName(value = "started_at")
val startedAt: Instant?

the UTC date and time of when the broadcast began.

Link copied to clipboard

the tags applied to the stream.

Link copied to clipboard
@SerialName(value = "thumbnail_url")
val thumbnailUrl: String

a URL to an image of a frame from the last 5 minutes of the stream. Replace the width and height placeholders in the URL ({width}x{height}) with the size of the image you want, in pixels.

Link copied to clipboard

the stream's title. Is an empty string if not set.

Link copied to clipboard

the type of stream. Possible values are: live. If an error occurs, this field is set to an empty string.

Link copied to clipboard
@SerialName(value = "user_id")
val userId: String

the ID of the user that's broadcasting the stream.

Link copied to clipboard
@SerialName(value = "user_login")
val userLogin: String

the user's login name.

Link copied to clipboard
@SerialName(value = "user_name")
val userName: String

the user's display name.

Link copied to clipboard
@SerialName(value = "viewer_count")
val viewerCount: Int

the number of users watching the stream.