Embed YouTube Live Chat
To put a YouTube live stream's chat on your own website, use an iframe whose address is youtube.com/live_chat?v= followed by the stream's video ID and &embed_domain= followed by your site's host name. In Vi.ki's test on Nov 21, 2026 YouTube let the chat into a frame only when that host matched the page exactly, www included.
To embed a YouTube live stream's chat on your website, use https://www.youtube.com/live_chat?v=VIDEO_ID&embed_domain=YOUR_HOST as the src of an iframe, with the stream's video ID and the host name of the page the chat sits on. For Lofi Girl's stream 4t4AQ15yj1M on a page at www.example.com, the code is:
<iframe src="https://www.youtube.com/live_chat?v=4t4AQ15yj1M&embed_domain=www.example.com" width="400" height="600"></iframe>
YouTube Help gives the same form, with the warning that "The embed_domain must match the URL of the page you're embedding the chat on" and that otherwise "the embedded chat will not open" (Use live chat during your live stream or Premiere, read Nov 21, 2026). Our test that day showed how strict "match" is: www.example.com and example.com are two different hosts to YouTube, and so are www.example.com and WWW.EXAMPLE.COM.
Next: the same chat in a window of its own, for OBS, one link that always opens your current stream or the embed code for the stream's video beside the chat.
The parts of the address
| Part | What it does |
|---|---|
youtube.com/live_chat |
The page that holds a stream's chat and nothing else |
?v=4t4AQ15yj1M |
The live stream's video ID, the 11 characters after watch?v= on its page |
&embed_domain=www.example.com |
The host of the page the iframe is on: no https://, no path, lower case |
Help's own example spells out the host rule: chat embedded on www.example.com/youtube_chat takes www.example.com. The path after the host is left out.
Maxmedia Creates built the same iframe by hand for a WordPress page in Feb 2018 and found the embed_domain part was the one that could not be skipped: without the site's domain there, the chat would not show. With it, the chat sat under the embedded stream, and a test message typed on YouTube appeared in the page's chat, which could be typed into as well.
What YouTube sent back for each host
A browser refuses to show a page in a frame when the page answers with the header X-Frame-Options: SAMEORIGIN. On Nov 21, 2026 Vi.ki requested Lofi Girl's chat as a browser's iframe would, sending the address of the embedding page as the Referer, and noted whether that header came back. A row with no header is a chat the frame can show.
embed_domain= |
Embedding page | X-Frame-Options |
In a frame |
|---|---|---|---|
www.example.com |
https://www.example.com/chat |
None | Shown |
www.example.com |
http://www.example.com/chat |
None | Shown |
localhost |
http://localhost:8080/ |
None | Shown |
www.example.com |
https://example.com/chat |
SAMEORIGIN | Blocked |
example.com |
https://www.example.com/chat |
SAMEORIGIN | Blocked |
WWW.EXAMPLE.COM |
https://www.example.com/chat |
SAMEORIGIN | Blocked |
https://www.example.com |
https://www.example.com/chat |
SAMEORIGIN | Blocked |
www.example.com |
https://another-site.com/ |
SAMEORIGIN | Blocked |
| left out | https://www.example.com/chat |
SAMEORIGIN | Blocked |
Three things follow. The scheme does not matter, but writing it into embed_domain breaks the match. A port on the page does not matter either: localhost matched a page on port 8080, which is how to test the embed on your own computer before it goes live. And every blocked row still returned the chat's 41 latest messages in the page itself, so a blocked embed is a browser refusing the frame, not YouTube refusing the chat: a blank box means the host is wrong, not the stream.
Before you paste it
- The stream must be live, with chat on. The same request for "Me at the zoo", a 2005 video that was never live, answered "Chat is disabled for this live stream."; a request with no
v=at all was a 400 error. - A new stream is a new ID. Each broadcast is its own video, so the iframe needs the new ID every time, as the pop-out address does (Pop Out Live Chat). A stream that never ends, such as Lofi Girl's, keeps its ID.
- Not on phones. Help says "Embedding Live Chat isn't available on mobile web", so mobile visitors need a link to the stream instead; the channel's
/liveaddress is the one that does not change (Share the Live Link). - Put the video next to it yourself. The chat iframe carries no player. Embed the stream's own video in a second iframe (Share > Embed on its page; YouTube Embeds).
Bridget Bartlett of Develop Like A Girl walked through the domain step in a Feb 1, 2023 video: she pasted the stream's ID into the address, then the domain the page is served from, and pointed out that a page in her membership area needed its own subdomain, training.myvisionagency.com, rather than her main site's name. Later in the same video her page builder's preview showed no chat, which she put down to the preview not running on that domain: the same rule as the blocked rows above.
What we think
We think the embed_domain check will still be exact, host for host, a year from now. It is the only thing that stops any site from framing a stream's chat, and loosening it to let example.com cover www.example.com would be a security change YouTube has had no reason to make.
Confidence: Likely. Check by: Nov 21, 2027.
How we will check: request a live stream's live_chat?v= page with embed_domain=www.example.com once with a Referer of https://www.example.com/ and once with https://example.com/, and compare the X-Frame-Options header.
Sources
- Use live chat during your live stream or Premiere, YouTube Help, "Embed a Live Chat", read Nov 21, 2026
- Embed YouTube Live Chat Into Your Website (Part 2), Bridget Bartlett, Develop Like A Girl, Feb 1, 2023 (video)
- Vi.ki's requests to youtube.com/live_chat for Lofi Girl's stream
4t4AQ15yj1Mand for "Me at the zoo", with and withoutembed_domainand with each Referer in the table, Nov 21, 2026 - How to Embed a Youtube Live Stream with Chat Onto a Wordpress Website, Maxmedia Creates, Feb 27, 2018 (video)
Moments
How to Embed a Youtube Live Stream with Chat Onto a Wordpress Website
Maxmedia Creates
Embed YouTube Live Chat Into Your Website (Part 2)
Bridget Bartlett | Develop Like A Girl™
See also
-
Pop Out Live ChatA YouTube live stream's chat opens on its own at youtube.com/live_chat?is_popout=1&v= followed by the stream's video ID, the address OBS and other streaming tools take as a browser source. It works only while the stream has chat on, and a new stream means a new ID.
-
Share the Live LinkShare youtube.com/@yourhandle/live instead of one stream's watch link: while the channel is live, YouTube opens the current stream, and when it is not, the channel page.
-
YouTube EmbedsTo embed a YouTube video, click Share under it, then Embed, and paste the HTML code into your site; swap youtube.com for youtube-nocookie.com for privacy-enhanced mode, add ?start= to begin at a second, and creators can stop others embedding by unticking Allow embedding in YouTube Studio.
-
Block a Video by CountryAn ordinary YouTube channel cannot block its own video in chosen countries. The setting exists only in Studio Content Manager, the tool of networks and rights holders, and it is built for licensing, not for hiding from an audience.
-
Channel Membership Join LinkA YouTube channel's membership link is its address with /join added, such as youtube.com/@LofiGirl/join, which YouTube Help says links "directly to your membership window". It works after a handle or a channel ID; in Vi.ki's test on Nov 19, 2026 a channel without memberships answered the same address with its plain channel page.
-
Channel RSS FeedEvery YouTube channel has an RSS feed at youtube.com/feeds/videos.xml?channel_id= plus the channel ID. It lists the 15 newest uploads, Shorts included; in Vi.ki's test on Nov 13, 2026, swapping in playlist_id=UULF plus the rest of the ID gave a feed of long videos only.