InnerTube 2.0.0-rc.19

This is a prerelease version of InnerTube.
dotnet add package InnerTube --version 2.0.0-rc.19                
NuGet\Install-Package InnerTube -Version 2.0.0-rc.19                
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="2.0.0-rc.19" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add InnerTube --version 2.0.0-rc.19                
#r "nuget: InnerTube, 2.0.0-rc.19"                
#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=2.0.0-rc.19&prerelease

// Install InnerTube as a Cake Tool
#tool nuget:?package=InnerTube&version=2.0.0-rc.19&prerelease                

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 net8.0 is compatible.  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
2.0.0-rc.19 104 9/13/2024
2.0.0-rc.18 134 8/6/2024
2.0.0-rc.17 38 8/5/2024
2.0.0-rc.16 41 8/2/2024
2.0.0-rc.15 40 7/30/2024
2.0.0-rc.14 54 7/29/2024
2.0.0-rc.13 49 7/29/2024
2.0.0-rc.12 63 6/6/2024
2.0.0-rc.11 56 6/4/2024
2.0.0-rc.10 57 6/3/2024
2.0.0-rc.9 57 6/3/2024
2.0.0-rc.8 65 6/1/2024
2.0.0-rc.7 63 5/31/2024
2.0.0-rc.6 54 5/28/2024
2.0.0-rc.5 57 5/26/2024
2.0.0-rc.4 74 5/24/2024
2.0.0-rc.3 63 5/23/2024
2.0.0-rc.2 48 5/23/2024
2.0.0-rc.1 67 5/17/2024
1.1.4 1,114 4/2/2024
1.1.3 234 3/9/2024
1.1.2 270 2/1/2024
1.1.1 407 12/28/2023
1.1.0 225 10/30/2023
1.0.29 214 4/2/2024
1.0.28 154 3/9/2024
1.0.27 532 10/30/2023
1.0.26 183 10/13/2023
1.0.25 244 8/27/2023
1.0.24 336 8/23/2023
1.0.23 309 7/20/2023
1.0.22 180 7/19/2023
1.0.21 262 6/27/2023
1.0.20 180 6/22/2023
1.0.19 203 6/20/2023
1.0.18 190 6/11/2023
1.0.17 197 5/3/2023
1.0.16 201 4/23/2023
1.0.15 211 4/20/2023
1.0.14 206 4/11/2023
1.0.13 228 4/4/2023
1.0.12 259 3/16/2023
1.0.11 246 3/16/2023
1.0.10 348 2/2/2023
1.0.9 304 1/20/2023
1.0.8 346 12/21/2022
1.0.7 326 12/8/2022
1.0.6 315 12/8/2022
1.0.5 351 12/4/2022
1.0.4 362 11/30/2022
1.0.3 359 11/24/2022
1.0.2 365 11/16/2022
1.0.1 407 11/5/2022
1.0.0 421 9/3/2022