InnerTube 1.1.4

dotnet add package InnerTube --version 1.1.4
NuGet\Install-Package InnerTube -Version 1.1.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="InnerTube" Version="1.1.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add InnerTube --version 1.1.4
#r "nuget: InnerTube, 1.1.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install InnerTube as a Cake Addin
#addin nuget:?package=InnerTube&version=1.1.4

// Install InnerTube as a Cake Tool
#tool nuget:?package=InnerTube&version=1.1.4

InnerTube

A wrapper for the private YouTube API used in the YouTube website and the mobile apps.

Comparison to the YouTube Data v3 API

The official API requires a Google account to use, while the InnerTube API can do it without the need of one.

The official API has a request quota and a request rate limit, while the InnerTube API does not have any limitations.

The official API is designed to be used by 3rd parties, thus, the data is formatted well. Since the InnerTube API is made to be used in the official YouTube apps, it is formatted to render elements on a screen. This makes it slightly harder to parse the output to a human readable format, which this library tries to do.

Authentication

There's no straightforward way to authenticate with this library. You will either have to extract cookies from a browser session, or extract a refresh token. See the wiki page for more details.

Usage

Getting the video streams of a video

InnerTube innerTube = new InnerTube();
InnerTubePlayer player = await innerTube.GetPlayerAsync("VIDEO_ID");
Console.WriteLine(player.Formats.First().Url);
// https://rr4---sn-u0g3uxax3-txpl.googlevideo.com/videoplayback?expire=166...

Getting comments of a video

InnerTubeNextResponse next = await _innerTube.GetVideoAsync(videoId);
InnerTubeContinuationResponse comments = await _innerTube.GetVideoCommentsAsync(next.CommentsContinuation!);
foreach (IRenderer renderer in comments.Contents)
    Console.WriteLine(renderer.ToString());
// [COMMENT_ID] [USER_ID] CoolUser: "This is a really cool video and this is definitely a real comment!" | 22.7M likes

Searching for videos

InnerTubeSearchResults search = await _innerTube.SearchAsync(query, param);
foreach (IRenderer renderer in results.Results)
    Console.WriteLine(renderer.ToString());
// [videoRenderer] Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film
// - Id: aqz-KE-bpKQ
// - Duration: 00:10:35
// - Published: 7 years ago
// - ViewCount: 15,839,114 views
// - Thumbnail count: 2
// - Channel: [UCSMOQeBJ2RAnuFungnQOxLg] Blender | Avatar: https://yt3.ggpht.com/ytc/AMLnZu-1MGeaE5pvjNQytK6_O9fjbUEcr2xmmM1XBbOHGQ=s68-c-k-c0x00ffffff-no-rj | Badges: [BADGE_STYLE_TYPE_VERIFIED] (CHECK_CIRCLE_THICK) (no label), Verified
// - Badges: [BADGE_STYLE_TYPE_SIMPLE] , 4K
// Enjoy this UHD High Frame rate version of one of the iconic short films produced by Blender Institute! Learn more about the...
// ...

More examples can be found in the InnerTube.Tests folder

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on InnerTube:

Repository Stars
lighttube-org/LightTube
An alternative YouTube front end written in ASP.NET
Version Downloads Last updated
1.1.4 285 4/2/2024
1.1.3 191 3/9/2024
1.1.2 238 2/1/2024
1.1.1 369 12/28/2023
1.1.0 187 10/30/2023
1.0.29 154 4/2/2024
1.0.28 117 3/9/2024
1.0.27 498 10/30/2023
1.0.26 149 10/13/2023
1.0.25 211 8/27/2023
1.0.24 309 8/23/2023
1.0.23 294 7/20/2023
1.0.22 149 7/19/2023
1.0.21 229 6/27/2023
1.0.20 153 6/22/2023
1.0.19 160 6/20/2023
1.0.18 156 6/11/2023
1.0.17 176 5/3/2023
1.0.16 173 4/23/2023
1.0.15 179 4/20/2023
1.0.14 178 4/11/2023
1.0.13 193 4/4/2023
1.0.12 230 3/16/2023
1.0.11 214 3/16/2023
1.0.10 314 2/2/2023
1.0.9 271 1/20/2023
1.0.8 313 12/21/2022
1.0.7 310 12/8/2022
1.0.6 289 12/8/2022
1.0.5 322 12/4/2022
1.0.4 328 11/30/2022
1.0.3 332 11/24/2022
1.0.2 344 11/16/2022
1.0.1 375 11/5/2022
1.0.0 381 9/3/2022