Skip to content

Live chat

YouTube Live Chat API

Poll YouTube live stream chat messages and stream status as structured context for your agent.

Pass a live stream URL with type set to livechat and get the current chat messages plus stream status. Use top chat for moderated messages or live chat for every message YouTube exposes.

Follow the continuationToken to poll for the next batch. Agents can monitor active streams, collect questions, summarize reactions, or watch chat for signals while a launch or event is live.

Endpoint

POST https://api.stophy.dev/v1/video

Request
1curl -X POST https://api.stophy.dev/v1/video \
2 -H "Authorization: Bearer $STOPHY_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{"videoUrl":"https://www.youtube.com/watch?v=D7liwdjvhWc","type":"livechat","chatType":"top"}'
Response
1{
2 "videoId": "D7liwdjvhWc",
3 "status": "live",
4 "isLive": true,
5 "messages": [
6 {
7 "id": "LCC.EhwKGkN...",
8 "author": "@example",
9 "text": "Can you show the dashboard again?",
10 "timestampText": "1:23",
11 "isOwner": false,
12 "isModerator": false
13 }
14 ],
15 "continuationToken": "QAA..."
16}

What you can do

Top chat or live chat

Choose chatType: top for moderated Top chat or chatType: live for the full live message stream.

Poll with continuation tokens

Use the continuationToken from each response to fetch the next batch of messages without resetting the stream.

Stream status included

Responses include whether the stream is live, upcoming, ended, or unavailable, so agents know what to do next.

Common use cases

  • Monitor questions during a live product demo or creator stream
  • Summarize audience reactions while an event is happening
  • Collect live chat messages for moderation, QA, or post-stream analysis
  • Trigger an agent workflow when a stream becomes active

Frequently asked questions

How do I poll for new live chat messages?
Call type: livechat once, then pass the continuationToken from each response into the next request to fetch the next batch of messages.
Can I choose Top chat or Live chat?
Yes. Set chatType to top for YouTube's moderated Top chat or live for every message YouTube exposes. Keep the same mode when polling.
Does live chat work after the stream ends?
The response includes status so your agent can tell whether the stream is live, upcoming, ended, or unavailable and handle that branch directly.