Quick Start
-
Open Tools → Scripts in OBS and add
Youtube Live Stats.lua. - Create or type in three Text source names for Likes, Views, and Viewers.
- Enter your YouTube Video ID and API Key.
- Click 🔄 Refresh and create sources then 🎨 Apply Formatting.
Youtube Live Stats.lua
Tip Learn how to get a free YouTube API key at obscountdown.com.
Install
OBS Steps (All platforms)
- Open Tools → Scripts in OBS Studio.
-
Click the + Add button and select
Youtube Live Stats.lua. - The script will appear in the list; select it to configure.
Recommended Store the Lua file in a dedicated folder so it doesn’t get lost when cleaning project files:
Preferred location (create obs-scripts)
-
Windows:
%AppData%\obs-studio\obs-scripts\ -
macOS:
~/Library/Application Support/obs-studio/obs-scripts/ -
Linux:
~/.config/obs-studio/obs-scripts/
Example layout
obs-studio/
└─ obs-scripts/
└─ Youtube Live Stats.lua
obs-scripts folder.
Configure
| Field | Description |
|---|---|
| YouTube Video ID | ID of the live video whose stats you want. |
| YouTube API Key | Your YouTube Data API v3 key. |
| Polling interval (s) | How often to refresh stats (min 5s). |
| Likes / Views / Viewers Source | OBS Text sources to receive values. |
| Font / Color | Optional: set consistent visual style for all three sources. |
How It Works
The script queries the YouTube Data API for
statistics and liveStreamingDetails. It
updates three text sources with Likes, Views, and concurrent live
Viewers. If a source is missing, the script can create it
automatically and add it to your active scene.
Troubleshooting
-
Empty values: If the stream isn’t live,
concurrentViewersmay be-. - No updates: Verify Video ID / API key; ensure Polling interval ≥ 5s.
- Sources missing: Click Refresh and create sources and re‑select them.
FAQ
Q. Does it run on all platforms?
A. Yes Windows, macOS, and Linux.
Q. Can I change fonts/colors later?
A. Yes adjust the font and color picker and click
🎨 Apply Formatting.
Q. Where do I get the API key?
A. See the tutorial on
obscountdown.com.