Establishes 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.
HTTP request
GET https://youtube.googleapis.com/youtube/v3/liveChat/messages/stream
The URL uses gRPC Transcoding syntax.
Query parameters
| Parameters | |
|---|---|
liveChatId |
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 |
hl |
Specifies the localization language in which system messages, Super Sticker and gift text, and currency display strings are returned. For example, English ( The value must be a language code returned by i18nLanguages.list. |
profileImageSize |
Specifies the square dimensions, in pixels, of user profile images returned in |
maxResults |
Specifies the maximum number of items returned in the result set. Acceptable values are An initial request made without a |
pageToken |
Identifies a specific page in the result set to retrieve. Pass the |
part[] |
Required. Specifies a comma-separated list of |
Request body
The request body must be empty.
Response body
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{ "kind": string, "etag": string, "pollingIntervalMillis": integer, "offlineAt": string, "pageInfo": { "totalResults": integer, "resultsPerPage": integer }, "nextPageToken": string, "items": [ { object ( |
| Fields | |
|---|---|
kind |
Output only. Identifies what kind of resource this is. Value: the fixed string |
etag |
Output only. Etag of this resource. |
pollingIntervalMillis |
The amount of time, in milliseconds, that the client should wait before polling again. Returned by |
offlineAt |
The date and time when the underlying livestream went offline. Only present if the stream is already offline. The value is specified in ISO 8601 ( |
pageInfo |
General pagination information. |
pageInfo.totalResults |
The total number of results in the result set. |
pageInfo.resultsPerPage |
The number of results included in the API response. |
nextPageToken |
The token to pass as the |
items[] |
A list of messages. Each item is a |
activePollItem |
The active poll, returned as a |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/youtubehttps://www.googleapis.com/auth/youtube.readonlyhttps://www.googleapis.com/auth/youtube.force-ssl
For more information, see the OAuth 2.0 Overview.