0.0.20241031 • Published 10 months ago

@maxim_mazurok/gapi.client.youtube-v3 v0.0.20241031

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

TypeScript typings for YouTube Data API v3 v3

The YouTube Data API v3 is an API that provides access to YouTube data, such as videos, playlists, and channels. For detailed description please check documentation.

Installing

Install typings for YouTube Data API v3:

npm install @types/gapi.client.youtube-v3 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load(
  'https://youtube.googleapis.com/$discovery/rest?version=v3',
  () => {
    // now we can use:
    // gapi.client.youtube
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('youtube', 'v3', () => {
  // now we can use:
  // gapi.client.youtube
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [
    // Manage your YouTube account
    'https://www.googleapis.com/auth/youtube',

    // See a list of your current active channel members, their current level, and when they became a member
    'https://www.googleapis.com/auth/youtube.channel-memberships.creator',

    // See, edit, and permanently delete your YouTube videos, ratings, comments and captions
    'https://www.googleapis.com/auth/youtube.force-ssl',

    // View your YouTube account
    'https://www.googleapis.com/auth/youtube.readonly',

    // Manage your YouTube videos
    'https://www.googleapis.com/auth/youtube.upload',

    // View and manage your assets and associated content on YouTube
    'https://www.googleapis.com/auth/youtubepartner',

    // View private information of your YouTube channel relevant during the audit process with a YouTube partner
    'https://www.googleapis.com/auth/youtubepartner-channel-audit',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  }
);

After that you can use YouTube Data API v3 resources:

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.abuseReports.insert({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.activities.list({part: 'part'});

/*
Deletes a resource.
*/
await gapi.client.youtube.captions.delete({id: 'id'});

/*
Downloads a caption track.
*/
await gapi.client.youtube.captions.download({id: 'id'});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.captions.insert({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.captions.list({part: 'part', videoId: 'videoId'});

/*
Updates an existing resource.
*/
await gapi.client.youtube.captions.update({part: 'part'});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.channelBanners.insert({});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.channels.list({part: 'part'});

/*
Updates an existing resource.
*/
await gapi.client.youtube.channels.update({part: 'part'});

/*
Deletes a resource.
*/
await gapi.client.youtube.channelSections.delete({id: 'id'});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.channelSections.insert({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.channelSections.list({part: 'part'});

/*
Updates an existing resource.
*/
await gapi.client.youtube.channelSections.update({part: 'part'});

/*
Deletes a resource.
*/
await gapi.client.youtube.comments.delete({id: 'id'});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.comments.insert({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.comments.list({part: 'part'});

/*
Expresses the caller's opinion that one or more comments should be flagged as spam.
*/
await gapi.client.youtube.comments.markAsSpam({id: 'id'});

/*
Sets the moderation status of one or more comments.
*/
await gapi.client.youtube.comments.setModerationStatus({
  id: 'id',
  moderationStatus: 'moderationStatus',
});

/*
Updates an existing resource.
*/
await gapi.client.youtube.comments.update({part: 'part'});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.commentThreads.insert({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.commentThreads.list({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.i18nLanguages.list({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.i18nRegions.list({part: 'part'});

/*
Bind a broadcast to a stream.
*/
await gapi.client.youtube.liveBroadcasts.bind({id: 'id', part: 'part'});

/*
Delete a given broadcast.
*/
await gapi.client.youtube.liveBroadcasts.delete({id: 'id'});

/*
Inserts a new stream for the authenticated user.
*/
await gapi.client.youtube.liveBroadcasts.insert({part: 'part'});

/*
Insert cuepoints in a broadcast
*/
await gapi.client.youtube.liveBroadcasts.insertCuepoint({});

/*
Retrieve the list of broadcasts associated with the given channel.
*/
await gapi.client.youtube.liveBroadcasts.list({part: 'part'});

/*
Transition a broadcast to a given status.
*/
await gapi.client.youtube.liveBroadcasts.transition({
  broadcastStatus: 'broadcastStatus',
  id: 'id',
  part: 'part',
});

/*
Updates an existing broadcast for the authenticated user.
*/
await gapi.client.youtube.liveBroadcasts.update({part: 'part'});

/*
Deletes a chat ban.
*/
await gapi.client.youtube.liveChatBans.delete({id: 'id'});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.liveChatBans.insert({part: 'part'});

/*
Deletes a chat message.
*/
await gapi.client.youtube.liveChatMessages.delete({id: 'id'});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.liveChatMessages.insert({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.liveChatMessages.list({
  liveChatId: 'liveChatId',
  part: 'part',
});

/*
Transition a durable chat event.
*/
await gapi.client.youtube.liveChatMessages.transition({});

/*
Deletes a chat moderator.
*/
await gapi.client.youtube.liveChatModerators.delete({id: 'id'});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.liveChatModerators.insert({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.liveChatModerators.list({
  liveChatId: 'liveChatId',
  part: 'part',
});

/*
Deletes an existing stream for the authenticated user.
*/
await gapi.client.youtube.liveStreams.delete({id: 'id'});

/*
Inserts a new stream for the authenticated user.
*/
await gapi.client.youtube.liveStreams.insert({part: 'part'});

/*
Retrieve the list of streams associated with the given channel. --
*/
await gapi.client.youtube.liveStreams.list({part: 'part'});

/*
Updates an existing stream for the authenticated user.
*/
await gapi.client.youtube.liveStreams.update({part: 'part'});

/*
Retrieves a list of members that match the request criteria for a channel.
*/
await gapi.client.youtube.members.list({part: 'part'});

/*
Retrieves a list of all pricing levels offered by a creator to the fans.
*/
await gapi.client.youtube.membershipsLevels.list({part: 'part'});

/*
Deletes a resource.
*/
await gapi.client.youtube.playlistImages.delete({});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.playlistImages.insert({});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.playlistImages.list({});

/*
Updates an existing resource.
*/
await gapi.client.youtube.playlistImages.update({});

/*
Deletes a resource.
*/
await gapi.client.youtube.playlistItems.delete({id: 'id'});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.playlistItems.insert({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.playlistItems.list({part: 'part'});

/*
Updates an existing resource.
*/
await gapi.client.youtube.playlistItems.update({part: 'part'});

/*
Deletes a resource.
*/
await gapi.client.youtube.playlists.delete({id: 'id'});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.playlists.insert({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.playlists.list({part: 'part'});

/*
Updates an existing resource.
*/
await gapi.client.youtube.playlists.update({part: 'part'});

/*
Retrieves a list of search resources
*/
await gapi.client.youtube.search.list({part: 'part'});

/*
Deletes a resource.
*/
await gapi.client.youtube.subscriptions.delete({id: 'id'});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.subscriptions.insert({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.subscriptions.list({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.superChatEvents.list({part: 'part'});

/*
POST method.
*/
await gapi.client.youtube.tests.insert({part: 'part'});

/*
Deletes a resource.
*/
await gapi.client.youtube.thirdPartyLinks.delete({
  linkingToken: 'linkingToken',
  type: 'type',
});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.thirdPartyLinks.insert({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.thirdPartyLinks.list({part: 'part'});

/*
Updates an existing resource.
*/
await gapi.client.youtube.thirdPartyLinks.update({part: 'part'});

/*
As this is not an insert in a strict sense (it supports uploading/setting of a thumbnail for multiple videos, which doesn't result in creation of a single resource), I use a custom verb here.
*/
await gapi.client.youtube.thumbnails.set({videoId: 'videoId'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.videoAbuseReportReasons.list({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.videoCategories.list({part: 'part'});

/*
Deletes a resource.
*/
await gapi.client.youtube.videos.delete({id: 'id'});

/*
Retrieves the ratings that the authorized user gave to a list of specified videos.
*/
await gapi.client.youtube.videos.getRating({id: 'id'});

/*
Inserts a new resource into this collection.
*/
await gapi.client.youtube.videos.insert({part: 'part'});

/*
Retrieves a list of resources, possibly filtered.
*/
await gapi.client.youtube.videos.list({part: 'part'});

/*
Adds a like or dislike rating to a video or removes a rating from a video.
*/
await gapi.client.youtube.videos.rate({id: 'id', rating: 'rating'});

/*
Report abuse for a video.
*/
await gapi.client.youtube.videos.reportAbuse({});

/*
Updates an existing resource.
*/
await gapi.client.youtube.videos.update({part: 'part'});

/*
Allows upload of watermark image and setting it for a channel.
*/
await gapi.client.youtube.watermarks.set({channelId: 'channelId'});

/*
Allows removal of channel watermark.
*/
await gapi.client.youtube.watermarks.unset({channelId: 'channelId'});
0.0.20241031

10 months ago

0.0.20241030

10 months ago

0.0.20241029

10 months ago

0.0.20241028

10 months ago

0.0.20241024

10 months ago

0.0.20241023

10 months ago

0.0.20241022

10 months ago

0.0.20241021

10 months ago

0.0.20241017

10 months ago

0.0.20241016

10 months ago

0.0.20240925

11 months ago

0.0.20240926

11 months ago

0.0.20240930

11 months ago

0.0.20241003

11 months ago

0.0.20241002

11 months ago

0.0.20241001

11 months ago

0.0.20241010

10 months ago

0.0.20241014

10 months ago

0.0.20241008

11 months ago

0.0.20241007

11 months ago

0.0.20241009

10 months ago

0.0.20240909

11 months ago

0.0.20240918

11 months ago

0.0.20240919

11 months ago

0.0.20240916

11 months ago

0.0.20240910

11 months ago

0.0.20240911

11 months ago

0.0.20240912

11 months ago

0.0.20240923

11 months ago

0.0.20240924

11 months ago

0.0.20240903

12 months ago

0.0.20240904

12 months ago

0.0.20240905

12 months ago

0.0.20240827

12 months ago

0.0.20240828

12 months ago

0.0.20240829

12 months ago

0.0.20240824

12 months ago

0.0.20240609

1 year ago

0.0.20240723

1 year ago

0.0.20240602

1 year ago

0.0.20240724

1 year ago

0.0.20240603

1 year ago

0.0.20240604

1 year ago

0.0.20240605

1 year ago

0.0.20240722

1 year ago

0.0.20240619

1 year ago

0.0.20240616

1 year ago

0.0.20240730

1 year ago

0.0.20240610

1 year ago

0.0.20240611

1 year ago

0.0.20240612

1 year ago

0.0.20240630

1 year ago

0.0.20240624

1 year ago

0.0.20240626

1 year ago

0.0.20240623

1 year ago

0.0.20240520

1 year ago

0.0.20240529

1 year ago

0.0.20240527

1 year ago

0.0.20240528

1 year ago

0.0.20240521

1 year ago

0.0.20240804

1 year ago

0.0.20240805

1 year ago

0.0.20240806

1 year ago

0.0.20240807

1 year ago

0.0.20240819

12 months ago

0.0.20240818

1 year ago

0.0.20240811

1 year ago

0.0.20240812

1 year ago

0.0.20240813

1 year ago

0.0.20240814

1 year ago

0.0.20240709

1 year ago

0.0.20240707

1 year ago

0.0.20240708

1 year ago

0.0.20240822

12 months ago

0.0.20240701

1 year ago

0.0.20240821

12 months ago

0.0.20240716

1 year ago

0.0.20240719

1 year ago

0.0.20240714

1 year ago

0.0.20240715

1 year ago

0.0.20240710

1 year ago

0.0.20240514

1 year ago

0.0.20240513

1 year ago

0.0.20240512

1 year ago

0.0.20240507

1 year ago

0.0.20240505

1 year ago

0.0.20240501

1 year ago

0.0.20240429

1 year ago

0.0.20240428

1 year ago

0.0.20240424

1 year ago

0.0.20240423

1 year ago

0.0.20240422

1 year ago

0.0.20240421

1 year ago

0.0.20240417

1 year ago

0.0.20240414

1 year ago

0.0.20240409

1 year ago

0.0.20240407

1 year ago

0.0.20240403

1 year ago

0.0.20240401

1 year ago

0.0.20240326

1 year ago

0.0.20240325

1 year ago

0.0.20240324

1 year ago

0.0.20240320

1 year ago

0.0.20240319

1 year ago

0.0.20240318

1 year ago

0.0.20240317

1 year ago

0.0.20240310

1 year ago

0.0.20240312

1 year ago

0.0.20240307

1 year ago

0.0.20240305

1 year ago

0.0.20240304

1 year ago

0.0.20240303

1 year ago

0.0.20240226

1 year ago

0.0.20240225

1 year ago

0.0.20240221

1 year ago

0.0.20240220

1 year ago

0.0.20240213

2 years ago

0.0.20240211

2 years ago

0.0.20240207

2 years ago

0.0.20240206

2 years ago

0.0.20240205

2 years ago

0.0.20240204

2 years ago

0.0.20240130

2 years ago

0.0.20240131

2 years ago

0.0.20240129

2 years ago

0.0.20240128

2 years ago

0.0.20240123

2 years ago

0.0.20240121

2 years ago

0.0.20240115

2 years ago

0.0.20240110

2 years ago

0.0.20240109

2 years ago

0.0.20240108

2 years ago

0.0.20240107

2 years ago

0.0.20240103

2 years ago

0.0.20240101

2 years ago

0.0.20240102

2 years ago

0.0.20231219

2 years ago

0.0.20231215

2 years ago

0.0.20231213

2 years ago

0.0.20231212

2 years ago

0.0.20231210

2 years ago

0.0.20231211

2 years ago

0.0.20231205

2 years ago

0.0.20231204

2 years ago

0.0.20231203

2 years ago

0.0.20231128

2 years ago

0.0.20230818

2 years ago

0.0.20230816

2 years ago

0.0.20231106

2 years ago

0.0.20231105

2 years ago

0.0.20231108

2 years ago

0.0.20231107

2 years ago

0.0.20230814

2 years ago

0.0.20230813

2 years ago

0.0.20231113

2 years ago

0.0.20231112

2 years ago

0.0.20231115

2 years ago

0.0.20231114

2 years ago

0.0.20230807

2 years ago

0.0.20230808

2 years ago

0.0.20230926

2 years ago

0.0.20230927

2 years ago

0.0.20230806

2 years ago

0.0.20230809

2 years ago

0.0.20230920

2 years ago

0.0.20230924

2 years ago

0.0.20230925

2 years ago

0.0.20230801

2 years ago

0.0.20231101

2 years ago

0.0.20230719

2 years ago

0.0.20230717

2 years ago

0.0.20230718

2 years ago

0.0.20230711

2 years ago

0.0.20231127

2 years ago

0.0.20230712

2 years ago

0.0.20231009

2 years ago

0.0.20230830

2 years ago

0.0.20231008

2 years ago

0.0.20230710

2 years ago

0.0.20230716

2 years ago

0.0.20231011

2 years ago

0.0.20230829

2 years ago

0.0.20230708

2 years ago

0.0.20230827

2 years ago

0.0.20230828

2 years ago

0.0.20230822

2 years ago

0.0.20231119

2 years ago

0.0.20230704

2 years ago

0.0.20230705

2 years ago

0.0.20230823

2 years ago

0.0.20231120

2 years ago

0.0.20231003

2 years ago

0.0.20231002

2 years ago

0.0.20231126

2 years ago

0.0.20231004

2 years ago

0.0.20231029

2 years ago

0.0.20231031

2 years ago

0.0.20231030

2 years ago

0.0.20231018

2 years ago

0.0.20231017

2 years ago

0.0.20230723

2 years ago

0.0.20230726

2 years ago

0.0.20230724

2 years ago

0.0.20230725

2 years ago

0.0.20231023

2 years ago

0.0.20231022

2 years ago

0.0.20231024

2 years ago

0.0.20230730

2 years ago

0.0.20231026

2 years ago

0.0.20230628

2 years ago

0.0.20230917

2 years ago

0.0.20230918

2 years ago

0.0.20230910

2 years ago

0.0.20230913

2 years ago

0.0.20230911

2 years ago

0.0.20230912

2 years ago

0.0.20230906

2 years ago

0.0.20230904

2 years ago

0.0.20230905

2 years ago

0.0.20230627

2 years ago

0.0.20230524

2 years ago

0.0.20230522

2 years ago

0.0.20230523

2 years ago

0.0.20230529

2 years ago

0.0.20230531

2 years ago

0.0.20230530

2 years ago

0.0.20230619

2 years ago

0.0.20230612

2 years ago

0.0.20230613

2 years ago

0.0.20230611

2 years ago

0.0.20230614

2 years ago

0.0.20230620

2 years ago

0.0.20230607

2 years ago

0.0.20230605

2 years ago

0.0.20230606

2 years ago

0.0.20230604

2 years ago

0.0.20230514

2 years ago

0.0.20230515

2 years ago

0.0.20230516

2 years ago

0.0.20230521

2 years ago

0.0.20230508

2 years ago

0.0.20230509

2 years ago

0.0.20230502

2 years ago

0.0.20230503

2 years ago

0.0.20230501

2 years ago

0.0.20230505

2 years ago

0.0.20230510

2 years ago

0.0.20230412

2 years ago

0.0.20230418

2 years ago

0.0.20230419

2 years ago

0.0.20230416

2 years ago

0.0.20230417

2 years ago

0.0.20230301

2 years ago

0.0.20230404

2 years ago

0.0.20230402

2 years ago

0.0.20230410

2 years ago

0.0.20230315

2 years ago

0.0.20230316

2 years ago

0.0.20230314

2 years ago

0.0.20230319

2 years ago

0.0.20230322

2 years ago

0.0.20230323

2 years ago

0.0.20230321

2 years ago

0.0.20230426

2 years ago

0.0.20230305

2 years ago

0.0.20230302

2 years ago

0.0.20230424

2 years ago

0.0.20230308

2 years ago

0.0.20230309

2 years ago

0.0.20230307

2 years ago

0.0.20230326

2 years ago

0.0.20230328

2 years ago

0.0.20230329

2 years ago

0.0.20230330

2 years ago

0.0.20230227

2 years ago

0.0.20230216

3 years ago

0.0.20230214

3 years ago

0.0.20230220

2 years ago

0.0.20230223

2 years ago

0.0.20230222

2 years ago

0.0.20230206

3 years ago

0.0.20230129

3 years ago

0.0.20230209

3 years ago

0.0.20230207

3 years ago

0.0.20230208

3 years ago

0.0.20230131

3 years ago

0.0.20230202

3 years ago

0.0.20221115

3 years ago

0.0.20221114

3 years ago

0.0.20221112

3 years ago

0.0.20230102

3 years ago

0.0.20221109

3 years ago

0.0.20230103

3 years ago

0.0.20221108

3 years ago

0.0.20221107

3 years ago

0.0.20221106

3 years ago

0.0.20221220

3 years ago

0.0.20221215

3 years ago

0.0.20230118

3 years ago

0.0.20221213

3 years ago

0.0.20230116

3 years ago

0.0.20221212

3 years ago

0.0.20221211

3 years ago

0.0.20230124

3 years ago

0.0.20221207

3 years ago

0.0.20230122

3 years ago

0.0.20221206

3 years ago

0.0.20230123

3 years ago

0.0.20221205

3 years ago

0.0.20221204

3 years ago

0.0.20230104

3 years ago

0.0.20221201

3 years ago

0.0.20221031

3 years ago

0.0.20221017

3 years ago

0.0.20221016

3 years ago

0.0.20221013

3 years ago

0.0.20221011

3 years ago

0.0.20221009

3 years ago

0.0.20221029

3 years ago

0.0.20221006

3 years ago

0.0.20221005

3 years ago

0.0.20221026

3 years ago

0.0.20221004

3 years ago

0.0.20221102

3 years ago

0.0.20221025

3 years ago

0.0.20221101

3 years ago

0.0.20221024

3 years ago

0.0.20221023

3 years ago

0.0.20221001

3 years ago

0.0.20220928

3 years ago

0.0.20220929

3 years ago

0.0.20221019

3 years ago

0.0.20221018

3 years ago

0.0.20220917

3 years ago

0.0.20220919

3 years ago

0.0.20220831

3 years ago

0.0.20220910

3 years ago

0.0.20220912

3 years ago

0.0.20220913

3 years ago

0.0.20220914

3 years ago

0.0.20220830

3 years ago

0.0.20220905

3 years ago

0.0.20220906

3 years ago

0.0.20220829

3 years ago

0.0.20220907

3 years ago

0.0.20220920

3 years ago

0.0.20220821

3 years ago

0.0.20220921

3 years ago

0.0.20220822

3 years ago

0.0.20220823

3 years ago

0.0.20220824

3 years ago

0.0.20220826

3 years ago

0.0.20220926

3 years ago

0.0.20220817

3 years ago

0.0.20220816

3 years ago

0.0.20220813

3 years ago

0.0.20220809

3 years ago