InnerTube 1.0.18

There is a newer version of this package available.
See the version list below for details.
dotnet add package InnerTube --version 1.0.18                
NuGet\Install-Package InnerTube -Version 1.0.18                
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.0.18" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add InnerTube --version 1.0.18                
#r "nuget: InnerTube, 1.0.18"                
#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.0.18

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

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 net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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
2.0.0-rc.19 79 9/13/2024
2.0.0-rc.18 131 8/6/2024
2.0.0-rc.17 35 8/5/2024
2.0.0-rc.16 38 8/2/2024
2.0.0-rc.15 37 7/30/2024
2.0.0-rc.14 51 7/29/2024
2.0.0-rc.13 46 7/29/2024
2.0.0-rc.12 60 6/6/2024
2.0.0-rc.11 53 6/4/2024
2.0.0-rc.10 54 6/3/2024
2.0.0-rc.9 54 6/3/2024
2.0.0-rc.8 62 6/1/2024
2.0.0-rc.7 60 5/31/2024
2.0.0-rc.6 51 5/28/2024
2.0.0-rc.5 54 5/26/2024
2.0.0-rc.4 71 5/24/2024
2.0.0-rc.3 60 5/23/2024
2.0.0-rc.2 45 5/23/2024
2.0.0-rc.1 64 5/17/2024
1.1.4 1,085 4/2/2024
1.1.3 231 3/9/2024
1.1.2 267 2/1/2024
1.1.1 404 12/28/2023
1.1.0 222 10/30/2023
1.0.29 211 4/2/2024
1.0.28 151 3/9/2024
1.0.27 529 10/30/2023
1.0.26 180 10/13/2023
1.0.25 241 8/27/2023
1.0.24 333 8/23/2023
1.0.23 306 7/20/2023
1.0.22 177 7/19/2023
1.0.21 259 6/27/2023
1.0.20 177 6/22/2023
1.0.19 200 6/20/2023
1.0.18 187 6/11/2023
1.0.17 192 5/3/2023
1.0.16 198 4/23/2023
1.0.15 208 4/20/2023
1.0.14 203 4/11/2023
1.0.13 225 4/4/2023
1.0.12 256 3/16/2023
1.0.11 243 3/16/2023
1.0.10 345 2/2/2023
1.0.9 301 1/20/2023
1.0.8 343 12/21/2022
1.0.7 323 12/8/2022
1.0.6 312 12/8/2022
1.0.5 348 12/4/2022
1.0.4 359 11/30/2022
1.0.3 356 11/24/2022
1.0.2 362 11/16/2022
1.0.1 404 11/5/2022
1.0.0 418 9/3/2022