
YouTube Has a Hidden API — Here's How to Use It (No Key, No Quotas)
Most developers use the YouTube Data API v3. It requires an API key, has strict quotas (10,000 units/day), and charges for heavy usage. But YouTube.com itself doesn't use that API. It uses something called Innertube — an internal API that powers the YouTube website and mobile apps. And you can use it too. No API key. No quotas. No OAuth. What is Innertube? Innertube is YouTube's internal API. When you visit youtube.com, every video load, every comment section, every search result — all of it goes through Innertube. The endpoints are public (they have to be — your browser calls them). They just aren't documented. Get Video Comments (No API Key) import requests import json def get_comments ( video_id , max_comments = 20 ): """ Get comments from a YouTube video using Innertube. """ url = " https://www.youtube.com/youtubei/v1/next " payload = { " context " : { " client " : { " clientName " : " WEB " , " clientVersion " : " 2.20240101.00.00 " } }, " videoId " : video_id } resp = requests .
Continue reading on Dev.to Webdev
Opens in a new tab




