Overview

VMSC integrates with YouTube through the YouTube Data API v3, specifically the Live Chat Messages and Live Broadcasts endpoints. After authorizing your Google account, VMSC detects your active live broadcast and begins polling the live chat for events.

All YouTube events are normalized into the VMSC StreamEvent format with source set to "youtube".

Live Chat Polling Mechanism

Unlike Twitch's EventSub (which pushes events over WebSocket), YouTube uses a polling model. VMSC polls the liveChatMessages.list endpoint at regular intervals.

Setting Value
API Endpoint youtube.googleapis.com/youtube/v3/liveChat/messages
Poll Interval Determined by YouTube's pollingIntervalMillis response header (typically 5–10 seconds)
Auth Google OAuth 2.0 with youtube.readonly scope
Rate Limits YouTube API quota: 10,000 units/day by default. Each poll costs ~5 units.
API quota limits

YouTube's daily quota can be consumed quickly during long streams. VMSC respects the pollingIntervalMillis value returned by YouTube to minimize quota usage. If you run out of quota, chat events stop until the quota resets at midnight Pacific time.

YouTube Events

The following events are extracted from YouTube Live Chat messages based on their snippet.type field.

YouTube Message Type VMSC Event Type Description
textMessageEvent chat A viewer sends a regular chat message.
superChatEvent superchat A viewer sends a paid Super Chat message.
superStickerEvent supersticker A viewer sends a paid Super Sticker.
membershipGiftingEvent membership_gift A viewer gifts channel memberships to other viewers.
memberMilestoneChatEvent member_milestone A member reaches a membership milestone (e.g., 6 months).
newSponsorEvent new_subscriber A viewer becomes a new channel member.
messageDeletedEvent / userBannedEvent user_banned A user is banned or timed out from the live chat.

Per-Event Data Fields

chat (textMessageEvent)

FieldTypeDescription
messagestringFull text of the chat message.
isChatOwnerbooleanWhether the message author is the channel owner.
isChatModeratorbooleanWhether the message author is a moderator.
isChatSponsorbooleanWhether the message author is a channel member.

superchat (superChatEvent)

FieldTypeDescription
amountnumberMonetary amount in micros (divide by 1,000,000 for the display value).
currencystringISO 4217 currency code (e.g., "USD").
displayAmountstringFormatted amount string (e.g., "$5.00").
messagestringText accompanying the Super Chat.
tiernumberSuper Chat color tier (1–7).

supersticker (superStickerEvent)

FieldTypeDescription
amountnumberMonetary amount in micros.
currencystringISO 4217 currency code.
displayAmountstringFormatted amount string.
stickerIdstringID of the Super Sticker image.
stickerDisplayUrlstringURL to the sticker image.

membership_gift (membershipGiftingEvent)

FieldTypeDescription
giftCountnumberNumber of memberships gifted.
membershipLevelstringName of the membership tier gifted.

member_milestone (memberMilestoneChatEvent)

FieldTypeDescription
memberMonthnumberTotal months as a member.
membershipLevelstringName of the membership tier.
messagestringMilestone message (if any).

new_subscriber (newSponsorEvent)

FieldTypeDescription
membershipLevelstringName of the membership tier joined.
isUpgradebooleanWhether this is an upgrade from a lower tier.

user_banned (userBannedEvent)

FieldTypeDescription
banTypestring"permanent" or "temporary".
banDurationSecondsnumberDuration for temporary bans (0 for permanent).