{
  "id": 3012967,
  "title": "Reverse-Engineering YouTube's InnerTube Search API (WEB Client + Continuations)",
  "url": "https://urgent.news/2026/08/24/reverse-engineering-youtubes-innertube-search-api-web-client",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-24T12:07:08.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/primesieve/reverse-engineering-youtubes-innertube-search-api-web-client-continuations-480m"
  },
  "original_language": "en",
  "account": "YouTube's InnerTube search API can be reverse-engineered through both the web client and continuations. The web client loads HTML and sends JSON, while the continuation path costs only one fetch. The JSON path is more efficient, requiring just one fetch to retrieve search results. This article focuses on the web client side of YouTube's InnerTube search API.\n\nWhen accessing YouTube, entering \"golang tutorial\" in the search bar triggers a POST request with the query and a client block. A JSON response with a tree structure is returned, containing a tree of videoRenderer objects with information such as title, owner, view count, length, publish date, thumbnail, and videoId. This data is the only necessary information for extracting video details.\n\nThe InnerTube search API supports multiple clients, including WEB, MWEB, ANDROID, IOS, and TV. Each client negotiates a different shape and policy for the search results. The WEB client is chosen for this implementation because it answers without a login or consent wall, returns 20 videos per page, and provides visitorData that can be reused. The search results are paginated using a single opaque continuation string sent in the next POST request. No cursor math is required.\n\nThe search process can be summarized in the following pseudocode:\n1. Initialize token and page variables\n2. While page is within maximum pages and results are within maximum results:\na. Send a POST request with the keyword and continuation token (if available)\nb. Parse the JSON response using a recursive function (walkTree)\nc. Append the parsed videos to the results array\nd. Update the token with the next continuation string\ne. Sleep for 350 milliseconds\nf. Increment the page variable\n3. Handle shorts shelves located in the same parent list as regular shelves\n4. Check each section's type and visit the itemSectionRenderer.contents bag if present\n5. Terminate the loop when there are no videos and no continuation\n\nContinuation tokens are long opaque strings that should not be decoded, trimmed, or modified in any way. The implementation omits specific details such as INNERTUBE_API_KEY, client version string, visitorData regex, header map, and exact JSON path for the token, as they are prone to change. The stable contract revolves around the shape of the tree and the fact that it pages by token.\n\nThe implementation uses a fetch-clean approach, which involves making one fetch with a desktop user-agent against the homepage and one POST against the search endpoint. This approach avoids the need for Playwright, Puppeteer, and minimizes RAM usage. A Node.js script with the Apify SDK, native fetch, and Node 20 is used for the implementation.",
  "summary": "Reverse-Engineering YouTube's InnerTube Search API (WEB Client + Continuations) YouTube search in a browser loads HTML. YouTube search as a client sends JSON. Same query, two paths. The HTML path costs a browser, a consent click, and 2 GB of RAM. The JSON path costs one fetch . I picked the second. This is the shape of YouTube's InnerTube search from the WEB client side — what it sends, what it…",
  "key_points": [
    "YouTube InnerTube search API can be reverse-engineered via web client and continuations",
    "WEB client loads HTML and sends JSON, while continuation path costs only one fetch",
    "JSON path is more efficient, requiring just one fetch to retrieve search results"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}