GET /youtube/v3/liveChat/messages/stream
Changed onEstablishes a server-streaming connection to receive live chat messages for a specific chat with low latency. When you connect, the API sends recent chat history and continues pushing new messages over the open connection, ordered from oldest to newest within each response. Each stream is short-lived and closes from the server side after about 10 seconds (with a 30-second RPC deadline). Each response includes a nextPageToken; call liveChatMessages.streamList in a loop, passing the latest nextPageToken as pageToken whenever the server ends the stream or your client disconnects. For a Python gRPC streaming example, see the Streaming Live Chat guide. Public live chats can be read with an API key or OAuth 2.0 authorization. Private, members-only, or paygated live chats, and viewing active poll tallies as the channel owner or a voter, require OAuth 2.0 authorization. For method-specific HTTP REST and gRPC error responses, see liveChatMessages.streamList errors.
Request
- Base URLhttps://youtube.googleapis.com
- Auth
- OAuth 2 and OAuth 2Implicithttps://accounts.google.com/o/oauth2/authScopeshttps://www.googleapis.com/auth/youtubeAuthorization codehttps://accounts.google.com/o/oauth2/authToken URLhttps://accounts.google.com/o/oauth2/tokenScopeshttps://www.googleapis.com/auth/youtube
- or OAuth 2 and OAuth 2Implicithttps://accounts.google.com/o/oauth2/authScopeshttps://www.googleapis.com/auth/youtube.force-sslAuthorization codehttps://accounts.google.com/o/oauth2/authToken URLhttps://accounts.google.com/o/oauth2/tokenScopeshttps://www.googleapis.com/auth/youtube.force-ssl
- or OAuth 2 and OAuth 2Implicithttps://accounts.google.com/o/oauth2/authScopeshttps://www.googleapis.com/auth/youtube.readonlyAuthorization codehttps://accounts.google.com/o/oauth2/authToken URLhttps://accounts.google.com/o/oauth2/tokenScopeshttps://www.googleapis.com/auth/youtube.readonly
Query parameters
V1 error format.
OAuth access token.
Data format for response.
JSONP
Selector specifying which fields to include in a partial response.
API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
OAuth 2.0 token for the current user.
Returns response with indentations and line breaks.
Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
Legacy upload protocol for media (e.g. "media", "multipart").
Upload protocol for media (e.g. "raw", "multipart").
Specifies the localization language in which system messages, Super Sticker and gift text, and currency display strings are returned. For example, English (en-US, the default) formats currency as $1.50, whereas French (fr) formats it as 1,50 $. The value must be a language code returned by i18nLanguages.list.
Required. The ID of the live chat for which messages should be returned. The live chat ID associated with a broadcast is returned in the liveBroadcast resource's snippet.liveChatId property or the video resource's liveStreamingDetails.activeLiveChatId property.
Specifies the maximum number of items returned in the result set. Acceptable values are 200 to 2000, inclusive (enforced on liveChatMessages.list), and the default value is 500. On liveChatMessages.streamList, this caps each streamed response batch. An initial request made without a pageToken returns only the most recent messages (up to 75 messages plus ticker and gift events, which can be fewer than maxResults) and doesn't retrieve older messages.
Identifies a specific page in the result set to retrieve. Pass the nextPageToken property from a previous response to fetch subsequent messages, or to reopen liveChatMessages.streamList in a loop after the server closes the stream or your client disconnects.
Required. Specifies a comma-separated list of liveChatMessage resource parts that the API response includes. Supported values are id, snippet, and authorDetails.
Specifies the square dimensions, in pixels, of user profile images returned in authorDetails.profileImageUrl. Acceptable values are 16 to 720, inclusive. The default value is 88 (88px by 88px); out-of-range values on liveChatMessages.streamList fall back to 88.
Response
Successful response
A liveChatMessage resource represents a chat message in a YouTube live chat. The resource can contain details about several types of messages, such as text messages, Super Chats, Super Stickers, membership events, live polls, and virtual gifts. Live chat is enabled by default for live broadcasts and is available while the live broadcast is active. After the broadcast ends, live chat is no longer available for that event.
Output only. Etag of this resource.
Serialized EventId of the request which produced this response.
A list of messages. Each item is a liveChatMessage resource.
Output only. Identifies what kind of resource this is. Value: the fixed string "youtube#liveChatMessageListResponse".
The token to pass as the pageToken parameter to retrieve the next page of messages, or to reopen liveChatMessages.streamList after the server closes the stream or your client disconnects.
The date and time when the underlying stream went offline.
Paging details for lists of resources, including total number of items available and number of resources returned in a single page.
The amount of time, in milliseconds, that the client should wait before polling again. Returned by liveChatMessages.list only; omitted by liveChatMessages.streamList.
Stub token pagination template to suppress results.
Identifies the visitor.
Changes
- info
the security scope
https://www.googleapis.com/auth/youtubewas added to the endpoint's security schemeOauth2 - info
the security scope
https://www.googleapis.com/auth/youtubewas added to the endpoint's security schemeOauth2c - info
the security scope
https://www.googleapis.com/auth/youtube.readonlywas removed from the endpoint's security schemeOauth2
1 more change in this revision
- info