Lists live chat messages for a specific chat.
To reduce polling and avoid exceeding your quota, use liveChatMessages.streamList to receive new messages pushed from the server as they become available.
On your first request, the API returns recent chat history ordered from oldest to newest. Use nextPageToken from the response as the pageToken parameter in your next request to retrieve subsequent messages after waiting at least pollingIntervalMillis milliseconds.
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 error responses, see liveChatMessages.list errors. For code examples, see liveChatMessages.list code snippets.
HTTP request
GET https://youtube.googleapis.com/youtube/v3/liveChat/messages
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.