ExtendedYouTubeAPI 1.0.3

.NET Standard 2.1 .NET Framework 4.6.1
There is a newer version of this package available.
See the version list below for details.
dotnet add package ExtendedYouTubeAPI --version 1.0.3
NuGet\Install-Package ExtendedYouTubeAPI -Version 1.0.3
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="ExtendedYouTubeAPI" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ExtendedYouTubeAPI --version 1.0.3
#r "nuget: ExtendedYouTubeAPI, 1.0.3"
#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 ExtendedYouTubeAPI as a Cake Addin
#addin nuget:?package=ExtendedYouTubeAPI&version=1.0.3

// Install ExtendedYouTubeAPI as a Cake Tool
#tool nuget:?package=ExtendedYouTubeAPI&version=1.0.3


Nuget License: GPL v3 Platforms

Twitter Follow GitHub followers

C# library which is used to extend the abilities of YouTube API v3


  • DASH manifests generation for videos
  • HLS livestreams URLs extraction
  • User's history management (list, add, delete, update)
  • Watch later playlist management (list, add, delete)
  • Video captions retrieval
  • User's recommendations listing
  • User's subscriptions videos listing
  • Videos' URLs retrieval
  • UWP authorization helpers

Get started

  • Download and install package from NuGet

Authorization (UWP)

using System;
using Google.Apis.Auth.OAuth2;
using YouTube.Authorization;
using Windows.Security.Authentication.Web;


ClientSecrets secrets = new ClientSecrets	// Initialize your project secrets
	ClientId = "%CLIENT_ID%",
	ClientSecret = "%CLIENT_SECRET%"

string[] scopes = new string[]			// Define scopes you wanna access

Uri requestString = AuthorizationHelpers.FormQueryString(secrets, scopes);	// Generate authorization link

WebAuthenticationResult result = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.UseTitle, requestString, AuthorizationHelpers.Endpoint);	// Call authentication broker with generated query string and predefined endpoint. WebAuthenticationOptions.UseTitle is required

if (result.ResponseStatus == WebAuthenticationStatus.Success)	// Process response
	string successCode = AuthorizationHelpers.ParseSuccessCode(result.ResponseData);	// Retrieve success code
	YouTube.Authorization.UserCredential credential = await AuthorizationHelpers.ExchangeToken(ClientSecrets, successCode);	// Excahnge success token for UserCredential
	// Use UserCredential to create YouTube.ExtendedYouTubeService

	// Save refresh token for future use. Recommended way: PasswordVault
	PasswordVault passwordVault = new PasswordVault();
	PasswordCredential tokenData = new PasswordCredential("%ANY_ID%", "%AUTHORIZED_USER_ID%", credential.Token.RefreshToken)

	// Update stored refresh token on renew
	credential.RefreshTokenUpdated += (s, e) =>
		tokenData.Password = credential.Token.RefreshToken
	// Do something

Service retrieval

using YouTube;
using YouTube.Authorization;
using Google.Apis.Services;


YouTubeExtendedService GetService(UserCredential credential = null)
	BaseClientService.Initializer initializer = new BaseClientService.Initializer
		ApplicationName = "%APP_NAME%",
		ApiKey = "%API_KEY%",		// In case there's no UserCredential and usage is anonymous
		HttpClientInitializer = credential

	ExtendedYouTubeService service = new ExtendedYouTubeService(initializer);

	returnt service

DASH manifest retrieval

using YouTube;
using YouTube.Models;
using System.Collections.Generic;
using Windows.Media.Playback;


ExtendedYouTubeService service = new ExtendedYouTubeService();	// Get the Service
var request = service.DashManifests.List("%VIDEO_ID%");
// request.Id = "%VIDEO_ID%";	// Change video ID after request initialization

IReadOnlyList<DashManifest> manifests = await request.ExecuteAsync();	// Execute request. There will be manifests for all available qualities, including "Auto"

// DashManifest.Label - Quality label
// DashManifest.ValidUntil - After this date URLs in the manifest will be invalid
// DashManifest.Xml - XmlDocument instance of the manifest

Uri manifestUri = manifests[0].WriteManifest(TempFileStream);	// Save manifest to temporary file to access it with MediaPlayer


// Play video with manifest
MediaPlayer mediaPlayer = new MediaPlayer();
mediaPlayer.Source = MediaSource.CreateFromUri(manifestUri);

Other data

Other resources are retrieved pretty much the same as in the vanilia library


  • Create API Reference page
  • Document code
  • Setup CI/CD
  • Add more tests
  • Implement user history management
  • Implement search history management
  • Implement video recommendations/subscirptions listing

Special thanks


©2020 Michael "XFox" Gordeev

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.4 441 9/13/2020
1.0.3 367 5/10/2020