Developer reverse-engineers YouTube's InnerTube JSON search API and documents its structure
A developer has documented how YouTube's InnerTube API handles search queries from the WEB client, revealing that browsers send a single POST request with JSON rather than fetching full HTML pages. The API returns results in a nested tree structure, with video data stored in leaf-level videoRenderer objects containing titles, view counts, thumbnails, and video IDs. Pagination works through opaque continuation tokens returned at the bottom of each response, which must be forwarded verbatim in subsequent requests to retrieve the next page. The developer chose the WEB client over alternatives like ANDROID or IOS because it responds without requiring login or consent, consistently returns 20 results per page, and behaves predictably. The findings are accompanied by an open-source scraper project on GitHub, though the author deliberately omitted exact request headers and client version strings due to their tendency to change and break implementations.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in