Last active
April 17, 2025 16:37
-
-
Save aik0aaac/042b8b071e4f315189b8e30cb7202aae to your computer and use it in GitHub Desktop.
Youtube Data API v3のRequest/Response内容。(TypeScript-Interface)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Youtube Data API > `activities`のリクエスト。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/activities/list?hl=ja | |
* | |
* 取得対象のチャンネルの選び方は大きく分けてつ: | |
* - チャンネルIDを指定する方法(`channelId`) | |
* - 認証ユーザーのHOMEページのアクティビティのみにする(`home`=`true`) | |
* - 認証ユーザーが所有するチャンネルのみにする(`mine`=`true`) | |
*/ | |
export interface IActivitiesRequest { | |
/** | |
* 情報取得対象箇所。 | |
* 以下の項目を指定可能。 | |
* 複数指定でき、カンマ区切りでリクエスト可能。 | |
* - `id` | |
* - `snippet`: チャンネルの基本情報 | |
* - `contentDetails`: | |
*/ | |
part: string; | |
/** | |
* 取得対象のチャンネルID。 | |
* チャンネルIDはそのチャンネルのURLを見ればわかる: | |
* `https://www.youtube.com/channel/[チャンネルID]` | |
*/ | |
channelId?: string; | |
/** | |
* 認証ユーザーのHOMEページに表示されるアクティビティフィードを取得するかどうか。 | |
* OAuth認証時のリクエストのみ有効。 | |
*/ | |
home?: boolean; | |
/** | |
* `true`にすると、認証されたユーザーが所有するチャンネルのみを返す様になる。 | |
* OAuth認証時のリクエストのみ有効。 | |
*/ | |
mine?: boolean; | |
/** | |
* 1回のリクエストで取得できるチャンネル数を指定できる。 | |
* 0〜50まで指定可能、デフォルト値: `5` | |
*/ | |
maxResults?: number; | |
/** | |
* paging機能を使う場合に使用。 | |
*/ | |
pageToken?: string; | |
/** | |
* アクティビティ取得期間対象を指定。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式で指定。 | |
* - 日時を指定: その日時以降の全てのアクティビティを取得 | |
* - 日付のみ指定: その日に発生したアクティビティを取得 | |
*/ | |
publishedAfter?: string; | |
/** | |
* アクティビティ取得期間対象を指定。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式で指定。 | |
* - 日時を指定: その日時以前の全てのアクティビティを取得 | |
* - 日付のみ指定: その日に発生したアクティビティが除外 | |
*/ | |
publishedBefore?: string; | |
/** | |
* 指定した国のみにフィルタリングする。 | |
* 国コードの指定方法は[ISO 3166-1 alpha-2](https://www.iso.org/iso-3166-country-codes.html)形式。 | |
* 例: `JP`/`US`/`CN`/`KR` | |
*/ | |
regionCode?: string; | |
/** | |
* APIアクセスキー。 | |
*/ | |
key: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
IBasePageInfoResponse, | |
IBaseResponse, | |
IBaseThumbnail, | |
} from "./IBaseResponse"; | |
/** | |
* Youtube Data API > `activities`のレスポンス。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/activities/list?hl=ja | |
*/ | |
export interface IActivitiesResponse | |
extends IBaseResponse, | |
IBasePageInfoResponse { | |
/** | |
* 結果は配列形式で格納される。 | |
*/ | |
items: { | |
kind: string; | |
etag: string; | |
id: string; | |
/** | |
* アクティビティの基本情報。 | |
*/ | |
snippet: IActivitiesResponse_Snippet; | |
/** | |
* アクティビティ対象のコンテンツ情報。 | |
* 例: `snippet.type`が`videoRated`である場合、当情報は評価された動画情報を指す。 | |
*/ | |
contentDetails: IActivitiesResponse_ContentDetail; | |
}[]; | |
} | |
/** | |
* Youtube Data API > `activities`の`snippet`partのデータ型。 | |
*/ | |
export interface IActivitiesResponse_Snippet { | |
/** | |
* アクティビティ発生日時。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式で返却。 | |
*/ | |
publishedAt: string; | |
/** | |
* アクティビティ種別。以下が指定される: | |
* - `bulletin`: お知らせメッセージ | |
* - `channelItem`: チャンネルへリソース追加 | |
* - `comment`: 動画orチャンネルへコメントを行った | |
* - `favorite`: 動画をお気に入りにした | |
* - `like`: 高評価を押した | |
* - `playlistItem`: 再生リストに追加した | |
* - `recommendation`: 動画等のリソースをお勧めされた | |
* - `social`: SNSヘ投稿 | |
* - `subscription`: チャンネル登録した | |
* - `upload`: 動画アップロード | |
*/ | |
type: string; | |
/** | |
* アクティビティが発生したチャンネルID。 | |
*/ | |
channelId: string; | |
/** | |
* アクティビティが発生したチャンネルのタイトル。 | |
*/ | |
channelTitle: string; | |
/** | |
* アクティビティに紐づくリソース(動画など)のタイトル。 | |
*/ | |
title: string; | |
/** | |
* アクティビティに紐づくリソース(動画など)の説明。 | |
*/ | |
description: string; | |
thumbnails: IBaseThumbnail; | |
/** | |
* アクティビティに紐づくグループID。以下公式Docs原文ママ: | |
* グループ ID は、同じユーザーとリソースに関連付けられているユーザー イベントを特定します。たとえばユーザーが動画を評価し、その動画をお気に入りにした場合、そのユーザーのアクティビティ フィードではこれらのイベントのグループ ID は同じになります。ユーザー インターフェースでは、同じ groupId 値でイベントをグループ化することによって、繰り返しを避けることができます。 | |
*/ | |
groupId: string; | |
} | |
/** | |
* Youtube Data API > `activities`の`contentDetails`partのデータ型。 | |
*/ | |
export interface IActivitiesResponse_ContentDetail { | |
/** | |
* アップロード済み動画の情報。 | |
* `snippet.type`が`upload`の場合格納される。 | |
*/ | |
upload: { | |
/** | |
* Youtube動画ID。 | |
*/ | |
videoId: string; | |
}; | |
/** | |
* 高評価対象の情報。 | |
* `snippet.type`が`like`の場合格納される。 | |
*/ | |
like: { | |
resourceId: { | |
/** | |
* リソース種別。 | |
*/ | |
kind: string; | |
/** | |
* 対象の動画ID。 | |
* `resourceId.kind`が`youtube#video`の場合のみ格納。 | |
*/ | |
videoId: string; | |
}; | |
}; | |
/** | |
* 高評価対象の情報。 | |
* `snippet.type`が`favorite`の場合格納される。 | |
*/ | |
favorite: { | |
resourceId: { | |
/** | |
* リソース種別。 | |
*/ | |
kind: string; | |
/** | |
* 高評価対象の動画ID。 | |
* `resourceId.kind`が`youtube#video`の場合のみ格納。 | |
*/ | |
videoId: string; | |
}; | |
}; | |
/** | |
* コメント対象の情報。 | |
* `snippet.type`が`comment`の場合格納される。 | |
*/ | |
comment: { | |
resourceId: { | |
/** | |
* リソース種別。 | |
*/ | |
kind: string; | |
/** | |
* 対象の動画ID。 | |
* `resourceId.kind`が`youtube#video`の場合のみ格納。 | |
*/ | |
videoId: string; | |
/** | |
* 対象のチャンネルID。 | |
* `resourceId.kind`が`youtube#channel`の場合のみ格納。 | |
*/ | |
channelId: string; | |
}; | |
}; | |
/** | |
* サブスクリプションした対象チャンネルの情報。 | |
* `snippet.type`が`subscription`の場合格納される。 | |
*/ | |
subscription: { | |
resourceId: { | |
/** | |
* リソース種別。 | |
*/ | |
kind: string; | |
/** | |
* 対象のチャンネルID。 | |
* `resourceId.kind`が`youtube#channel`の場合のみ格納。 | |
*/ | |
channelId: string; | |
}; | |
}; | |
/** | |
* 再生リスト追加対象の情報。 | |
* `snippet.type`が`playlistItem`の場合格納される。 | |
*/ | |
playlistItem: { | |
resourceId: { | |
/** | |
* リソース種別。 | |
*/ | |
kind: string; | |
/** | |
* 対象の動画ID。 | |
* `resourceId.kind`が`youtube#video`の場合のみ格納。 | |
*/ | |
videoId: string; | |
}; | |
/** | |
* 追加対象の再生リストID。 | |
*/ | |
playlistId: string; | |
/** | |
* 追加対象の再生リストアイテムID。 | |
*/ | |
playlistItemId: string; | |
}; | |
/** | |
* 再生リスト追加対象の情報。 | |
* `snippet.type`が`recommendation`の場合格納される。 | |
*/ | |
recommendation: { | |
resourceId: { | |
/** | |
* リソース種別。 | |
*/ | |
kind: string; | |
/** | |
* 対象の動画ID。 | |
* `resourceId.kind`が`youtube#video`の場合のみ格納。 | |
*/ | |
videoId: string; | |
/** | |
* 対象のチャンネルID。 | |
* `resourceId.kind`が`youtube#channel`の場合のみ格納。 | |
*/ | |
channelId: string; | |
}; | |
/** | |
* そのリソースがお勧めされた理由。以下が指定される: | |
* - `unspecified` | |
* - `videoFavorited` | |
* - `videoLiked` | |
* - `videoWatched` | |
*/ | |
reason: "unspecified" | "videoFavorited" | "videoLiked" | "videoWatched"; | |
/** | |
* お勧め発生元のリソース情報。 | |
*/ | |
seedResourceId: { | |
/** | |
* リソース種別。 | |
*/ | |
kind: string; | |
/** | |
* 対象の動画ID。 | |
* `seedResourceId.kind`が`youtube#video`の場合のみ格納。 | |
*/ | |
videoId: string; | |
/** | |
* 対象のチャンネルID。 | |
* `seedResourceId.kind`が`youtube#channel`の場合のみ格納。 | |
*/ | |
channelId: string; | |
/** | |
* 対象の動画ID。 | |
* `seedResourceId.kind`が`youtube#playlist`の場合のみ格納。 | |
*/ | |
playlistId: string; | |
}; | |
}; | |
/** | |
* お知らせメッセージ対象の情報。 | |
* `snippet.type`が`bulletin`の場合格納される。 | |
*/ | |
bulletin: { | |
resourceId: { | |
/** | |
* リソース種別。 | |
*/ | |
kind: string; | |
/** | |
* 対象の動画ID。 | |
* `resourceId.kind`が`youtube#video`の場合のみ格納。 | |
*/ | |
videoId: string; | |
/** | |
* 対象のチャンネルID。 | |
* `resourceId.kind`が`youtube#channel`の場合のみ格納。 | |
*/ | |
channelId: string; | |
/** | |
* 対象の動画ID。 | |
* `resourceId.kind`が`youtube#playlist`の場合のみ格納。 | |
*/ | |
playlistId: string; | |
}; | |
/** | |
* 追加対象の再生リストID。 | |
*/ | |
playlistId: string; | |
/** | |
* 追加対象の再生リストアイテムID。 | |
*/ | |
playlistItemId: string; | |
}; | |
/** | |
* SNSメッセージ投稿対象の情報。 | |
* `snippet.type`が`social`の場合格納される。 | |
*/ | |
social: { | |
/** | |
* SNSの種別。 | |
*/ | |
type: "facebook" | "googlePlus" | "twitter" | "unspecified"; | |
/** | |
* SNSメッセージ投稿に関連づけられているリソース情報。 | |
*/ | |
resourceId: { | |
/** | |
* リソース種別。 | |
*/ | |
kind: string; | |
/** | |
* 対象の動画ID。 | |
* `resourceId.kind`が`youtube#video`の場合のみ格納。 | |
*/ | |
videoId: string; | |
/** | |
* 対象のチャンネルID。 | |
* `resourceId.kind`が`youtube#channel`の場合のみ格納。 | |
*/ | |
channelId: string; | |
/** | |
* 対象の動画ID。 | |
* `resourceId.kind`が`youtube#playlist`の場合のみ格納。 | |
*/ | |
playlistId: string; | |
}; | |
/** | |
* SNS投稿作成者。 | |
*/ | |
author: string; | |
/** | |
* SNS投稿作成者画像。 | |
*/ | |
imageUrl: string; | |
/** | |
* SNS投稿URL。 | |
*/ | |
referenceUrl: string; | |
}; | |
/** | |
* チャンネルへリソースを追加した際の追加対象リソース情報。 | |
* `snippet.type`が`channelItem`の場合格納される。 | |
*/ | |
channelItem: { | |
/** | |
* リソース情報が格納。 | |
* 2023/05/28現在、公式Docsに詳細説明がないためany型で定義。 | |
*/ | |
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |
resourceId: any; | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Youtube Data APIの共通レスポンス。 | |
*/ | |
export interface IBaseResponse { | |
/** | |
* APIリソースタイプ。 | |
* 例: `youtube#channelListResponse` | |
*/ | |
kind: string; | |
/** | |
* このリソースのEtag。 | |
*/ | |
etag: string; | |
} | |
/** | |
* ページングが備わっているコンテンツの場合付与されるレスポンス型。 | |
*/ | |
export interface IBasePageInfoResponse { | |
/** | |
* 結果セットのページング情報。 | |
*/ | |
pageInfo: { | |
/** | |
* 結果セット内の結果の総数。 | |
*/ | |
totalResults: number; | |
/** | |
* APIレスポンスに含まれる結果の数。 | |
*/ | |
resultsPerPage: number; | |
}; | |
/** | |
* 次ページへのページングトークン。 | |
*/ | |
nextPageToken: string; | |
/** | |
* 前ページへのページングトークン。 | |
*/ | |
prevPageToken: string; | |
} | |
/** | |
* サムネイル情報。 | |
*/ | |
export interface IBaseThumbnail { | |
/** | |
* デフォルトのサムネイル画像。 | |
* - 動画: 120px x 90px | |
* - チャンネル: 88px x 88px | |
*/ | |
default: IBaseThumbnailItem; | |
/** | |
* 低解像度のサムネイル画像。 | |
* - 動画: 320px x 180px | |
* - チャンネル: 240px x 240px | |
*/ | |
medium: IBaseThumbnailItem; | |
/** | |
* 高解像度のサムネイル画像。 | |
* - 動画: 480px x 360px | |
* - チャンネル: 800px x 800px | |
*/ | |
high: IBaseThumbnailItem; | |
} | |
export interface IBaseThumbnailItem { | |
/** | |
* 画像URL。 | |
*/ | |
url: string; | |
/** | |
* 画像幅。 | |
*/ | |
width: number; | |
/** | |
* 画像の高さ。 | |
*/ | |
height: number; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Youtube Data API > `channels`のリクエスト。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/channels/list?hl=ja | |
* | |
* 取得対象のチャンネルの選び方は大きく分けてつ: | |
* - チャンネルIDを指定する方法(`id`) | |
* - Youtubeガイドカテゴリを指定する方法(`categoryId`) | |
* - Youtubeユーザー名を指定する方法(`forUsername`) | |
*/ | |
export interface IChannelsRequest { | |
/** | |
* 情報取得対象箇所。 | |
* 以下の項目を指定可能。 | |
* 複数指定でき、カンマ区切りでリクエスト可能。 | |
* - `id` | |
* - `snippet`: チャンネルの基本情報 | |
* - `brandingSettings`: チャンネルのブランディング情報 | |
* - `contentDetails`: チャンネルのコンテンツ情報 | |
* - `statistics`: チャンネルの統計情報 | |
* - `topicDetails`: チャンネルに関連づけられているFreebaseのトピック情報 | |
* - `status`: チャンネルのプライバシーステータス情報 | |
* - `invideoPromotion`: チャンネルのプロモーション情報(なぜかリクエストできなかった…APIトークン形式では取得不可能なのかも?) | |
*/ | |
part: string; | |
/** | |
* 取得対象のチャンネルID。 | |
* チャンネルIDはそのチャンネルのURLを見ればわかる: | |
* `https://www.youtube.com/channel/[チャンネルID]` | |
*/ | |
id?: string; | |
/** | |
* 取得対象のYoutubeガイドカテゴリ、この形式ではそのカテゴリに属するチャンネルが取得できる。 | |
* Youtubeガイドカテゴリとは: Youtube側が割り当てるカテゴリ、ユーザー側では割り当て不可能。 | |
* 詳しくは[こちら](https://developers.google.com/youtube/v3/docs/guideCategories?hl=ja) | |
*/ | |
categoryId?: string; | |
/** | |
* 取得対象のYoutubeユーザー名。 | |
*/ | |
forUsername?: string; | |
/** | |
* `true`にすると、認証されたユーザーが所有するチャンネルのみを返す様になる。 | |
* OAuth認証時のリクエストのみ有効。 | |
*/ | |
mine?: boolean; | |
/** | |
* OAuth認証時のリクエストのみ有効。 | |
* Youtubeコンテンツパートナー専用プロパティ。 | |
* 詳しくは公式Docs参照。 | |
*/ | |
onBehalfOfContentOwner?: string; | |
/** | |
* 1回のリクエストで取得できるチャンネル数を指定できる。 | |
* 0〜50まで指定可能、デフォルト値: `5` | |
*/ | |
maxResults?: number; | |
/** | |
* paging機能を使う場合に使用。 | |
*/ | |
pageToken?: string; | |
/** | |
* APIアクセスキー。 | |
*/ | |
key: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
IBasePageInfoResponse, | |
IBaseResponse, | |
IBaseThumbnail, | |
} from "./IBaseResponse"; | |
/** | |
* Youtube Data API > `channels`のレスポンス。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/channels/list?hl=ja | |
*/ | |
export interface IChannelsResponse | |
extends IBaseResponse, | |
IBasePageInfoResponse { | |
/** | |
* 結果は配列形式で格納される。 | |
*/ | |
items: { | |
kind: string; | |
etag: string; | |
id: string; | |
/** | |
* チャンネルの基本情報。 | |
*/ | |
snippet: IChannelsResponse_Snippet; | |
/** | |
* チャンネルのコンテンツ情報。 | |
*/ | |
contentDetails: IChannelsResponse_ContentDetail; | |
/** | |
* チャンネルの統計情報。 | |
*/ | |
statistics: IChannelsResponse_Statistic; | |
/** | |
* チャンネルのプライバシーステータス情報。 | |
*/ | |
status: IChannelsResponse_Status; | |
/** | |
* チャンネルに関連づけられているFreebaseのトピック情報。 | |
* Freebase: かつて存在していたオンラインデータベース、Googleに買収後公開された。 | |
*/ | |
topicDetails: IChannelsResponse_TopicDetail; | |
/** | |
* チャンネルのブランディング情報。 | |
*/ | |
brandingSettings: IChannelsResponse_BrandingSetting; | |
}[]; | |
} | |
/** | |
* Youtube Data API > `channels`の`snippet`partのデータ型。 | |
*/ | |
export interface IChannelsResponse_Snippet { | |
/** | |
* チャンネルタイトル。 | |
*/ | |
title: string; | |
/** | |
* チャンネルの説明。 | |
*/ | |
description: string; | |
/** | |
* カスタムURL。 | |
* `https://youtube.com/[カスタムURL]`で該当チャンネルへアクセス可能。 | |
*/ | |
customUrl: string; | |
/** | |
* チャンネル作成日時。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式で返却。 | |
*/ | |
publishedAt: string; | |
thumbnails: IBaseThumbnail; | |
/** | |
* チャンネルの国。 | |
*/ | |
country: string; | |
} | |
/** | |
* Youtube Data API > `channels`の`contentDetails`partのデータ型。 | |
*/ | |
export interface IChannelsResponse_ContentDetail { | |
/** | |
* Youtube側で自動生成される?再生リストのID群。 | |
*/ | |
relatedPlaylists: { | |
/** | |
* 「高く評価した動画」の再生リストID。 | |
* 非公開の場合は空文字が入る。 | |
*/ | |
likes: string; | |
/** | |
* 「アップロードした動画」の再生リストID。 | |
*/ | |
uploads: string; | |
}; | |
} | |
/** | |
* Youtube Data API > `channels`の`statistics`partのデータ型。 | |
*/ | |
export interface IChannelsResponse_Statistic { | |
/** | |
* チャンネルの総再生回数。 | |
*/ | |
viewCount: string; | |
/** | |
* チャンネル登録者数。 | |
*/ | |
subscriberCount: string; | |
/** | |
* チャンネル登録者数を公開しているかどうか。 | |
* `true`:公開している / `false`:公開していない | |
*/ | |
hiddenSubscriberCount: boolean; | |
/** | |
* チャンネルへアップロードされた動画数。 | |
* ライブ配信もカウントされる。 | |
* 公開設定が「公開」のみがカウントされる。 | |
*/ | |
videoCount: string; | |
} | |
/** | |
* Youtube Data API > `channels`の`topicDetails`partのデータ型。 | |
*/ | |
export interface IChannelsResponse_TopicDetail { | |
/** | |
* FreebaseのトピックID。 | |
* Freebase APIを使ってトピックの情報を得れる様だが…。 | |
*/ | |
topicIds: string[]; | |
/** | |
* トピックのカテゴリ。 | |
*/ | |
topicCategories: string[]; | |
} | |
/** | |
* Youtube Data API > `channels`の`status`partのデータ型。 | |
*/ | |
export interface IChannelsResponse_Status { | |
/** | |
* チャンネルのプライバシーステータス。 | |
* - `private`: 非公開 | |
* - `public`: 公開 | |
* - `unlisted`: 限定公開(多分) | |
*/ | |
privacyStatus: string; | |
/** | |
* チャンネルへYouTubeユーザー名 or Google+アカウントが関連付けられている稼働かを示す。 | |
*/ | |
isLinked: boolean; | |
/** | |
* 謎値。 | |
* `longUploadsUnspecified`となっていることを確認。 | |
*/ | |
longUploadsStatus: string; | |
/** | |
* 子供向けチャンネルかどうか。 | |
*/ | |
madeForKids: boolean; | |
} | |
/** | |
* Youtube Data API > `channels`の`brandingSettings`partのデータ型。 | |
*/ | |
export interface IChannelsResponse_BrandingSetting { | |
/** | |
* チャンネルページのブランディング情報。 | |
*/ | |
channel: { | |
/** | |
* チャンネルタイトル。 | |
* タイトルの文字数は全角15文字(半角30文字)以内。 | |
*/ | |
title: string; | |
/** | |
* チャンネル説明。 | |
*/ | |
description: string; | |
/** | |
* チャンネルに設定されているキーワード。 | |
* 未設定だとプロパティごと無くなる。 | |
*/ | |
keywords: string; | |
/** | |
* 視聴者がチャンネルページに遷移した時、デフォルトで遷移するタブ名。 | |
* 未設定だとプロパティごと無くなる。 | |
*/ | |
defaultTab: string; | |
/** | |
* チャンネルへのトラフィック追跡/測定用のGoogleAnalyticsアカウントID。 | |
* 未設定だとプロパティごと無くなる。 | |
*/ | |
trackingAnalyticsAccountId: string; | |
/** | |
* チャンネル登録していない視聴者に対して、おすすめ動画で再生する動画ID。 | |
*/ | |
unsubscribedTrailer: string; | |
/** | |
* チャンネルの国。 | |
*/ | |
country: string; | |
}; | |
image: { | |
/** | |
* チャンネルに合わせてさまざまなサイズのバナー画像を生成するために YouTube が使用するバナー画像の場所を指定。(?) | |
* ※詳しくはDocs参照。 | |
*/ | |
bannerExternalUrl: string; | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Youtube Data API > `guideCategories`のリクエスト。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/guideCategories/list?hl=ja | |
*/ | |
export interface IGuideCategoriesRequest { | |
/** | |
* 情報取得対象箇所。 | |
* 以下の項目を指定可能。 | |
* 複数指定でき、カンマ区切りでリクエスト可能。 | |
* - `id` | |
* - `snippet`: ガイドカテゴリの基本情報 | |
*/ | |
part: string; | |
/** | |
* チャンネルのカテゴリIDでフィルタリングする。 | |
* 複数指定でき、カンマ区切りでリクエスト可能。 | |
*/ | |
id?: string; | |
/** | |
* 指定した国で使用可能なカテゴリのみにフィルタリングする。 | |
* 国コードの指定方法は[ISO 3166-1 alpha-2](https://www.iso.org/iso-3166-country-codes.html)形式。 | |
* 例: `JP`/`US`/`CN`/`KR` | |
*/ | |
regionCode?: string; | |
/** | |
* APIレスポンスのテキスト値で使用する言語を指定。 | |
* デフォルトは`en-US`。 | |
*/ | |
hl?: string; | |
/** | |
* APIアクセスキー。 | |
*/ | |
key: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { IBaseResponse } from "./IBaseResponse"; | |
/** | |
* Youtube Data API > `guideCategories`のレスポンス。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/guideCategories/list?hl=ja | |
*/ | |
export interface IGuideCategoriesResponse extends IBaseResponse { | |
/** | |
* 結果は配列形式で格納される。 | |
*/ | |
items: { | |
kind: "youtube#guideCategory"; | |
etag: string; | |
/** | |
* ガイドカテゴリID。 | |
*/ | |
id: string; | |
/** | |
* 基本情報。 | |
*/ | |
snippet: { | |
/** | |
* ガイドカテゴリを発行しているチャンネルID。 | |
*/ | |
channelId: string; | |
/** | |
* カテゴリタイトル。 | |
*/ | |
title: string; | |
}; | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Youtube Data API > `playlists`のリクエスト。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/playlists/list?hl=ja | |
* | |
* 取得対象のチャンネルの選び方は大きく分けてつ: | |
* - チャンネルIDを指定する方法(`channelId`) | |
* - 再生リストIDを指定する方法(`id`) | |
* - 認証ユーザーが所有するチャンネルのみにする(`mine`=`true`) | |
*/ | |
export interface IPlaylistsRequest { | |
/** | |
* 情報取得対象箇所。 | |
* 以下の項目を指定可能。 | |
* 複数指定でき、カンマ区切りでリクエスト可能。 | |
* - `id` | |
* - `snippet`: 再生リストの基本情報 | |
* - `status`: 再生リストのステータス情報 | |
* - `contentDetails`: 再生リストのコンテンツ情報(動画数など) | |
* - `player`: 再生リストの動画プレイヤー情報(埋め込みタグ情報など) | |
*/ | |
part: string; | |
/** | |
* 取得対象のチャンネルID。 | |
* チャンネルIDはそのチャンネルのURLを見ればわかる: | |
* `https://www.youtube.com/channel/[チャンネルID]` | |
*/ | |
channelId?: string; | |
/** | |
* 取得対象の再生リストID。 | |
* 複数指定でき、カンマ区切りでリクエスト可能。 | |
*/ | |
id?: boolean; | |
/** | |
* `true`にすると、認証されたユーザーが所有するチャンネルのみを返す様になる。 | |
* OAuth認証時のリクエストのみ有効。 | |
*/ | |
mine?: boolean; | |
/** | |
* 1回のリクエストで取得できるチャンネル数を指定できる。 | |
* 0〜50まで指定可能、デフォルト値: `5` | |
*/ | |
maxResults?: number; | |
/** | |
* paging機能を使う場合に使用。 | |
*/ | |
pageToken?: string; | |
/** | |
* APIアクセスキー。 | |
*/ | |
key: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
IBasePageInfoResponse, | |
IBaseResponse, | |
IBaseThumbnail, | |
} from "./IBaseResponse"; | |
/** | |
* Youtube Data API > `playlists`のレスポンス | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/playlists/list?hl=ja | |
*/ | |
export interface IPlaylistsResponse | |
extends IBaseResponse, | |
IBasePageInfoResponse { | |
/** | |
* 結果は配列形式で格納される。 | |
*/ | |
items: { | |
kind: string; | |
etag: string; | |
id: string; | |
/** | |
* 再生リストの基本情報。 | |
*/ | |
snippet: IPlaylistsResponse_Snippet; | |
/** | |
* 再生リストのステータス情報。 | |
* 例: `snippet.type`が`videoRated`である場合、当情報は評価された動画情報を指す。 | |
*/ | |
status: IPlaylistsResponse_Status; | |
/** | |
* 再生リストのコンテンツ情報(動画数など)。 | |
*/ | |
contentDetails: IPlaylistsResponse_ContentDetails; | |
/** | |
* 再生リストの動画プレイヤー情報(埋め込みタグ情報など)。 | |
*/ | |
player: IPlaylistsResponse_Player; | |
}[]; | |
} | |
export interface IPlaylistsResponse_Snippet { | |
/** | |
* アクティビティ発生日時。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式で返却。 | |
*/ | |
publishedAt: string; | |
/** | |
* アクティビティ種別。以下が指定される: | |
* - `bulletin`: お知らせメッセージ | |
* - `channelItem`: チャンネルへリソース追加 | |
* - `comment`: 動画orチャンネルへコメントを行った | |
* - `favorite`: 動画をお気に入りにした | |
* - `like`: 高評価を押した | |
* - `playlistItem`: 再生リストに追加した | |
* - `recommendation`: 動画等のリソースをお勧めされた | |
* - `social`: SNSヘ投稿 | |
* - `subscription`: チャンネル登録した | |
* - `upload`: 動画アップロード | |
*/ | |
type: string; | |
/** | |
* 再生リスト発行元のチャンネルID。 | |
*/ | |
channelId: string; | |
/** | |
* 再生リスト発行元のチャンネルのタイトル。 | |
*/ | |
channelTitle: string; | |
/** | |
* 再生リストのタイトル。 | |
*/ | |
title: string; | |
/** | |
* 再生リストの説明。 | |
*/ | |
description: string; | |
/** | |
* 再生リストのサムネイル。 | |
*/ | |
thumbnails: IBaseThumbnail; | |
/** | |
* 再生リストのタグ。 | |
*/ | |
tags: string[]; | |
} | |
export interface IPlaylistsResponse_Status { | |
/** | |
* 再生リストのプライバシーステータス。 | |
* - `private`: 非公開 | |
* - `public`: 公開 | |
* - `unlisted`: 限定公開(多分) | |
*/ | |
privacyStatus: string; | |
} | |
export interface IPlaylistsResponse_ContentDetails { | |
/** | |
* 再生リスト内部に入っている動画数。 | |
*/ | |
itemCount: number; | |
} | |
export interface IPlaylistsResponse_Player { | |
/** | |
* 動画再生プレイヤーとなる`<iframe>`タグ。 | |
*/ | |
embedHtml: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Youtube Data API > `search`のリクエスト。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/search/list?hl=ja | |
*/ | |
export interface ISearchRequest { | |
/** | |
* 情報取得対象箇所。 | |
* 以下の項目を指定可能。 | |
* 複数指定でき、カンマ区切りでリクエスト可能。 | |
* - `id` | |
* - `snippet`: 動画の基本情報 | |
*/ | |
part: string; | |
/** | |
* 検索クエリ。 | |
*/ | |
q?: string; | |
/** | |
* 動画IDを指定し、指定した動画に関連のある動画のみを返却。 | |
* `true`にする場合、`type`を`video`にする必要あり。 | |
*/ | |
relatedToVideoId?: string; | |
/** | |
* 認証ユーザーの動画のみに絞り込む。 | |
* OAuth認証時のリクエストのみ有効。 | |
* `true`にする場合、`type`を`video`にする必要あり。 | |
*/ | |
forMine?: boolean; | |
/** | |
* `onBehalfOfContentOwner`で指定されたコンテンツ所有者のデータをターゲットに絞り込むかどうか。 | |
* OAuth認証時のリクエストのみ有効。 | |
*/ | |
forContentOwner?: boolean; | |
/** | |
* OAuth認証時のリクエストのみ有効。 | |
* Youtubeコンテンツパートナー専用プロパティ。 | |
* 詳しくは公式Docs参照。 | |
*/ | |
onBehalfOfContentOwner?: string; | |
/** | |
* 指定したチャンネルのみのデータにフィルタリングする。 | |
*/ | |
channelId?: string; | |
/** | |
* 指定したチャンネル種別のみのデータにフィルタリングする。 | |
* - `any`: 全てのチャンネル | |
* - `show`: 番組のみ | |
*/ | |
channelType?: "any" | "show"; | |
/** | |
* 動画の配信ステータスに応じてフィルタリングする。 | |
* - `completed`: 配信終了したもののみ | |
* - `live`: 現在配信中のもののみ | |
* - `upcoming`: 今後配信予定のもののみ | |
*/ | |
eventType?: "completed" | "live" | "upcoming"; | |
/** | |
* 1回のリクエストで取得できるチャンネル数を指定できる。 | |
* 0〜50まで指定可能、デフォルト値: `5` | |
*/ | |
maxResults?: number; | |
/** | |
* paging機能を使う場合に使用。 | |
*/ | |
pageToken?: string; | |
/** | |
* データの並び替え方法を指定。 | |
* - `date`: 作成日の新しい順 | |
* - `rating`: 評価の高い順 | |
* - `relevance`: 検索クエリの関連度が高い順 | |
* - `title`: タイトルのアルファベット順 | |
* - `videoCount`: 動画の番号順 | |
* - `viewCount`: 再生数の多い順 | |
*/ | |
order?: | |
| "date" | |
| "rating" | |
| "relevance" | |
| "title" | |
| "videoCount" | |
| "viewCount"; | |
/** | |
* 期間対象を指定。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式で指定。 | |
* - 日時を指定: その日時以降の全ての動画を取得 | |
* - 日付のみ指定: その日に発生した動画を取得 | |
*/ | |
publishedAfter?: string; | |
/** | |
* 期間対象を指定。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式で指定。 | |
* - 日時を指定: その日時以前の全ての動画を取得 | |
* - 日付のみ指定: その日に発生した動画が除外 | |
*/ | |
publishedBefore?: string; | |
/** | |
* 指定した国で使用可能な動画のみにフィルタリングする。 | |
* 国コードの指定方法は[ISO 3166-1 alpha-2](https://www.iso.org/iso-3166-country-codes.html)形式。 | |
* 例: `JP`/`US`/`CN`/`KR` | |
*/ | |
regionCode?: string; | |
/** | |
* 検索結果に制限コンテンツも含めるかどうか。 | |
* - `moderate`: 一定のフィルタリングを行う(言語/地域での除外設定適用)、デフォルトのパラメータ | |
* - `none`: フィルタリングを一切行わない | |
* - `strict`: 制限コンテンツは全て除外 | |
*/ | |
safeSearch?: "moderate" | "none" | "strict"; | |
/** | |
* 指定した動画カテゴリIDのみでフィルタリングされる様設定。 | |
*/ | |
videoCategoryId?: string; | |
/** | |
* 指定したFreebaseのトピックIDのみでフィルタリングされる様設定。 | |
*/ | |
topicId?: string; | |
/** | |
* 検索対象を指定。 | |
* - `video`: 動画 | |
* - `channel`: チャンネル | |
* - `playlist`: 再生リスト | |
*/ | |
type?: "video" | "channel" | "playlist"; | |
/** | |
* 動画の解像度でフィルタリングする。 | |
* - `high`: HD動画のみ取得 | |
* - `standard`: SD(標準画質)動画のみ取得 | |
* - `any`: フィルタリングしない | |
*/ | |
videoDefinition?: "high" | "standard" | "any"; | |
/** | |
* 字幕の有無でフィルタリングする。 | |
* - `closedCaption`: 字幕がある動画のみを取得 | |
* - `none`: 字幕がない動画のみを取得 | |
* - `any`: フィルタリングしない | |
*/ | |
videoCaption?: "closedCaption" | "none" | "any"; | |
/** | |
* 2D/3D動画でフィルタリングする。 | |
* - `2d`: 2D動画のみを取得 | |
* - `3d`: 3D動画のみを取得 | |
* - `any`: フィルタリングしない | |
*/ | |
videoDimension?: "2d" | "3d" | "any"; | |
/** | |
* 動画の長さでフィルタリング。 | |
* - `short`: 4分未満の動画のみを取得 | |
* - `medium`: 4分〜20分の動画のみを取得 | |
* - `long`: 20分超えの動画のみを取得 | |
* - `any`: フィルタリングしない | |
*/ | |
videoDuration?: "short" | "medium" | "long" | "any"; | |
/** | |
* 埋め込み可能な動画でフィルタリング。 | |
* - `true`: 埋め込み可能な動画のみを取得。 | |
* - `any`: フィルタリングしない | |
*/ | |
videoEmbeddable?: "true" | "any"; | |
/** | |
* 動画のライセンス保持状態によってフィルタリング。 | |
* - `creativeCommon`: クリエイティブ・コモンズ ライセンスを持つ動画のみを取得 | |
* - `youtube`: 標準のYoutubeライセンスを持つ動画のみを取得 | |
* - `any`: フィルタリングしない | |
*/ | |
videoLicense?: "creativeCommon" | "youtube" | "any"; | |
/** | |
* Youtube.com以外でも再生できるかどうかでフィルタリング。 | |
* - `true`: youtube.com以外で再生できる動画のみ | |
* - `any`: フィルタリングしない | |
*/ | |
videoSyndicated?: "true" | "any"; | |
/** | |
* 動画種別でフィルタリング。 | |
* - `episode`: 番組のエピソードのみ | |
* - `movie`: 動画のみ | |
* - `any`: フィルタリングしない | |
*/ | |
videoType?: "episode" | "movie" | "any"; | |
/** | |
* APIアクセスキー。 | |
*/ | |
key: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
IBasePageInfoResponse, | |
IBaseResponse, | |
IBaseThumbnail, | |
} from "./IBaseResponse"; | |
/** | |
* Youtube Data API > `search`のレスポンス。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/search/list?hl=ja | |
*/ | |
export interface ISearchResponse extends IBaseResponse, IBasePageInfoResponse { | |
/** | |
* 結果は配列形式で格納される。 | |
*/ | |
items: { | |
kind: string; | |
etag: string; | |
id: string; | |
/** | |
* コンテンツの基本情報。 | |
*/ | |
snippet: ISearchResponse_Snippet; | |
}; | |
} | |
export interface ISearchResponse_Snippet { | |
/** | |
* コンテンツ投稿日時。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式で返却。 | |
*/ | |
publishedAt: string; | |
/** | |
* コンテンツを投稿したチャンネルID。 | |
*/ | |
channelId: string; | |
/** | |
* コンテンツを投稿したチャンネル名。 | |
*/ | |
channelTitle: string; | |
/** | |
* コンテンツのタイトル。 | |
* 動画なら動画のタイトルが入る。 | |
*/ | |
title: string; | |
/** | |
* コンテンツの説明。 | |
* 動画なら動画の説明が入る。 | |
*/ | |
description: string; | |
/** | |
* コンテンツのサムネイル情報。 | |
*/ | |
thumbnails: IBaseThumbnail; | |
/** | |
* ライブ配信ステータス。 | |
* - `live`: APIリクエスト時点でライブ配信中 | |
* - `upcoming`: ライブ配信予約されている動画であり、まだライブ配信されてない状態 | |
* - `none`: ライブ配信ではない動画orライブ配信終了済みの動画 | |
*/ | |
liveBroadcastContent: "live" | "upcoming" | "none"; | |
/** | |
* コンテンツの公開日時(?)。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式で返却。 | |
*/ | |
publishTime: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Youtube Data API > `videoCategories`のリクエスト。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/videoCategories/list?hl=ja | |
*/ | |
export interface IVideoCategoriesRequest { | |
/** | |
* 情報取得対象箇所。 | |
* 以下の項目を指定可能。 | |
* 複数指定でき、カンマ区切りでリクエスト可能。 | |
* - `id` | |
* - `snippet`: 動画カテゴリの基本情報 | |
*/ | |
part: string; | |
/** | |
* 取得対象の動画カテゴリID。 | |
*/ | |
id?: string; | |
/** | |
* 指定した国のみにフィルタリングする。 | |
* 国コードの指定方法は[ISO 3166-1 alpha-2](https://www.iso.org/iso-3166-country-codes.html)形式。 | |
* 例: `JP`/`US`/`CN`/`KR` | |
*/ | |
regionCode?: string; | |
/** | |
* APIレスポンスのテキスト値で使用する言語を指定。 | |
* デフォルトは`en-US`。 | |
*/ | |
hl?: string; | |
/** | |
* APIアクセスキー。 | |
*/ | |
key: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { IBaseResponse } from "./IBaseResponse"; | |
/** | |
* Youtube Data API > `videoCategories`のレスポンス。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/videoCategories/list?hl=ja | |
*/ | |
export interface IVideoCategoriesResponse extends IBaseResponse { | |
/** | |
* 結果は配列形式で格納される。 | |
*/ | |
items: { | |
kind: string; | |
etag: string; | |
/** | |
* 動画カテゴリID。 | |
*/ | |
id: string; | |
/** | |
* 基本情報。 | |
*/ | |
snippet: { | |
/** | |
* カテゴリ名。 | |
*/ | |
title: string; | |
/** | |
* その動画が対象の動画カテゴリに紐づけられているかを示す。 | |
*/ | |
assignable: boolean; | |
/** | |
* 動画カテゴリを作成したYoutubeチャンネルID。 | |
*/ | |
channelId: string; | |
}; | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Youtube Data API > `videos`のリクエスト。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/videos/list?hl=ja | |
* | |
* 指定方法は3通り: | |
* - 動画IDを指定: `id` | |
* - グラフで指定: `chart` | |
* - 認証ユーザーの高評価動画/低評価動画で指定: `myRating` | |
*/ | |
export interface IVideosRequest { | |
/** | |
* 情報取得対象箇所。 | |
* 以下の項目を指定可能。 | |
* 複数指定でき、カンマ区切りでリクエスト可能。 | |
* - `id` | |
* - `snippet`: 動画の基本情報 | |
* - `contentDetails`: 動画のコンテンツ情報 | |
* - `status`: 動画のアップロード、処理、プライバシーステータス情報 | |
* - `statistics`: 動画の統計情報 | |
* - `player`: 動画の埋め込み時に使用される設定 | |
* - `topicDetails`: 動画に関連づけられているFreebaseのトピック情報 | |
* - `recordingDetails`: 動画が録画された場所、日付、住所情報 | |
* - `liveStreamingDetails`: ライブ配信情報 | |
* - `fileDetails`: ファイルの解像度、長さ、オーディオと動画のコーデック、ストリーミングのビットレートなど(OAuth認証して指定動画を所有しているユーザーからでないと指定不可) | |
* - `processingDetails`: アップロード動画の処理進捗状況(OAuth認証して指定動画を所有しているユーザーからでないと指定不可) | |
* - `suggestions`: アップロード済み動画の動画品質を向上させる方法やメタデータを示す提案(OAuth認証して指定動画を所有しているユーザーからでないと指定不可) | |
*/ | |
part: string; | |
/** | |
* 取得対象の動画ID。 | |
*/ | |
id?: string; | |
/** | |
* 取得グラフ。 | |
* `mostPopular`しか指定できず、指定すると、`regionCode`で指定した地域 or `videoCategoryId`で指定した動画カテゴリ内部で、最も人気の動画を返却する。 | |
*/ | |
chart?: "mostPopular"; | |
/** | |
* 国コードを指定する。`chart`とセットで使用。 | |
* 国コードの指定方法は[ISO 3166-1 alpha-2](https://www.iso.org/iso-3166-country-codes.html)形式。 | |
* 例: `JP`/`US`/`CN`/`KR` | |
*/ | |
regionCode?: string; | |
/** | |
* 動画カテゴリIDを指定する、`chart`とセットで使用。 | |
*/ | |
videoCategoryId?: string; | |
/** | |
* 認証ユーザーの高評価動画/低評価動画をターゲットに絞り込む。 | |
* OAuth認証時のリクエストのみ有効。 | |
* - `like`: 高評価動画のみを返却 | |
* - `dislike`: 低評価動画のみを返却 | |
*/ | |
myRating?: "like" | "dislike"; | |
/** | |
* 1回のリクエストで取得できるチャンネル数を指定できる。 | |
* 0〜50まで指定可能、デフォルト値: `5` | |
*/ | |
maxResults?: number; | |
/** | |
* paging機能を使う場合に使用。 | |
*/ | |
pageToken?: string; | |
/** | |
* OAuth認証時のリクエストのみ有効。 | |
* Youtubeコンテンツパートナー専用プロパティ。 | |
* 詳しくは公式Docs参照。 | |
*/ | |
onBehalfOfContentOwner?: string; | |
/** | |
* APIアクセスキー。 | |
*/ | |
key: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
IBasePageInfoResponse, | |
IBaseResponse, | |
IBaseThumbnail, | |
} from "./IBaseResponse"; | |
/** | |
* Youtube Data API > `videos`のレスポンス。 | |
* 公式Docs: https://developers.google.com/youtube/v3/docs/videos/list?hl=ja | |
*/ | |
export interface IVideosResponse extends IBaseResponse, IBasePageInfoResponse { | |
/** | |
* 結果は配列形式で格納される。 | |
*/ | |
items: { | |
kind: string; | |
etag: string; | |
id: string; | |
/** | |
* 動画の基本情報。 | |
*/ | |
snippet: IVideosResponse_Snippet; | |
/** | |
* 動画のコンテンツ情報。 | |
*/ | |
contentDetails: IVideosResponse_ContentDetail; | |
/** | |
* 動画のアップロード、処理、プライバシーステータス情報。 | |
*/ | |
status: IVideosResponse_Status; | |
/** | |
* 動画の統計情報。 | |
*/ | |
statistics: IVideosResponse_Statistic; | |
/** | |
* 動画の埋め込み時に使用される設定。 | |
*/ | |
player: IVideosResponse_Player; | |
/** | |
* 動画に関連づけられているFreebaseのトピック情報。 | |
* Freebase: かつて存在していたオンラインデータベース、Googleに買収後公開された。 | |
*/ | |
topicDetails: IVideosResponse_TopicDetail; | |
/** | |
* 動画が録画された場所、日付、住所情報。 | |
*/ | |
recordingDetails: IVideosResponse_RecordingDetails; | |
/** | |
* ライブ配信情報。 | |
*/ | |
liveStreamingDetails: IVideosResponse_LiveStreamingDetails; | |
}[]; | |
} | |
export interface IVideosResponse_Snippet { | |
/** | |
* 動画投稿日時。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式で返却。 | |
*/ | |
publishedAt: string; | |
/** | |
* 動画を投稿したチャンネルID。 | |
*/ | |
channelId: string; | |
/** | |
* 動画を投稿したチャンネル名。 | |
*/ | |
channelTitle: string; | |
/** | |
* 動画タイトル。 | |
*/ | |
title: string; | |
/** | |
* 動画説明。 | |
*/ | |
description: string; | |
/** | |
* サムネイル情報。 | |
*/ | |
thumbnails: IBaseThumbnail; | |
/** | |
* 動画に関連づけられているタグ。 | |
*/ | |
tags: string[]; | |
/** | |
* 動画に関連づけられている動画カテゴリID。 | |
*/ | |
categoryId: string; | |
/** | |
* ライブ配信ステータス。 | |
* - `live`: APIリクエスト時点でライブ配信中 | |
* - `upcoming`: ライブ配信予約されている動画であり、まだライブ配信されてない状態 | |
* - `none`: ライブ配信ではない動画orライブ配信終了済みの動画 | |
*/ | |
liveBroadcastContent: "live" | "upcoming" | "none"; | |
/** | |
* デフォルトの言語。 | |
* 例: `ja` | |
*/ | |
defaultLanguage: string; | |
/** | |
* デフォルトのオーディオ言語。 | |
* 例: `ja` | |
*/ | |
defaultAudioLanguage: string; | |
} | |
export interface IVideosResponse_ContentDetail { | |
/** | |
* 動画の長さ。 ISO8601に倣った`PT#M#S`形式。 | |
* 例: `PT15M51S`= 15分51秒の動画、ということ。 | |
*/ | |
duration: string; | |
/** | |
* 動画が2D形式か3D形式かどうかを示す。 | |
* - `2d`: 2D形式 | |
*/ | |
dimension: string; | |
/** | |
* 高解像度(HD)版がある動画か、標準画質版のみであるかどうか。 | |
* - `hd`: 高解像度版もある | |
* - `sd`: 標準画質版のみ | |
*/ | |
definition: "hd" | "sd"; | |
/** | |
* 動画にキャプションがついているかどうか。 | |
* `true`: ついている、`false`: ついていない | |
*/ | |
caption: "true" | "false"; | |
/** | |
* YouTubeコンテンツパートナーにより申し立てが行われている動画であるかどうか。 | |
*/ | |
licensedContent: boolean; | |
/** | |
* 国別に動画の視聴制限をかけてる場合、視聴制限情報が格納。 | |
* 未設定の場合プロパティごと無くなる。 | |
*/ | |
regionRestriction: { | |
/** | |
* 動画を視聴許可している国コードリスト。 | |
* ここに入ってない国は視聴がブロックされる。 | |
* リストが空の場合、全ての国からの視聴がブロックされる。 | |
*/ | |
allowed: string[]; | |
/** | |
* 動画を視聴拒否している句にコードリスト。 | |
* ここに入ってない国は視聴できる。 | |
* リストが空の場合、全ての国で視聴可能。 | |
*/ | |
blocked: string[]; | |
}; | |
/** | |
* 動画のレーティング情報。 | |
* たくさんの種類があるため、日本のレーティング情報のみに省略。 | |
* 全部みたい場合は公式Docs参照。 | |
*/ | |
contentRating: { | |
/** | |
* 映倫によるレーティング情報。 | |
* - eirinG: G | |
* - eirinPg12: PG-12 | |
* - eirinR15plus: R15+ | |
* - eirinR18plus: R18+ | |
* - eirinUnrated | |
*/ | |
eirinRating: | |
| "eirinG" | |
| "eirinPg12" | |
| "eirinR15plus" | |
| "eirinR18plus" | |
| "eirinUnrated"; | |
/** | |
* Youtubeが年齢制限を示すために使用するレーティング。 | |
*/ | |
ytRating: "ytAgeRestricted"; | |
}; | |
/** | |
* 謎値。`rectangular`を確認。 | |
*/ | |
projection: string; | |
} | |
export interface IVideosResponse_Status { | |
/** | |
* 動画のアップロードステータス。 | |
* - `deleted`: 削除済み | |
* - `failed`: アップロード失敗 | |
* - `processed`: アップロード中 | |
* - `rejected`: アップロード却下 | |
* - `uploaded`: アップロード完了 | |
*/ | |
uploadStatus: "deleted" | "failed" | "processed" | "rejected" | "uploaded"; | |
/** | |
* アップロード失敗時の理由。 | |
* `uploadStatus`が`failed`の時のみ存在。 | |
* - `codec` | |
* - `conversion` | |
* - `emptyFile` | |
* - `invalidFile` | |
* - `tooSmall` | |
* - `uploadAborted` | |
*/ | |
failureReason: | |
| "codec" | |
| "conversion" | |
| "emptyFile" | |
| "invalidFile" | |
| "tooSmall" | |
| "uploadAborted"; | |
/** | |
* アップロードが却下された理由。 | |
* `uploadStatus`が`rejected`の時のみ存在。 | |
* - `claim` | |
* - `copyright` | |
* - `duplicate` | |
* - `inappropriate` | |
* - `length` | |
* - `termsOfUse` | |
* - `trademark` | |
* - `uploaderAccountClosed` | |
* - `uploaderAccountSuspended` | |
*/ | |
rejectionReason: | |
| "claim" | |
| "copyright" | |
| "duplicate" | |
| "inappropriate" | |
| "length" | |
| "termsOfUse" | |
| "trademark" | |
| "uploaderAccountClosed" | |
| "uploaderAccountSuspended"; | |
/** | |
* 動画のプライバシーステータス。 | |
* - `private`: 非公開 | |
* - `public`: 公開 | |
* - `unlisted` | |
*/ | |
privacyStatus: "private" | "public" | "unlisted"; | |
/** | |
* 動画のライセンス。 | |
* - `creativeCommon` | |
* - `youtube` | |
*/ | |
license: "creativeCommon" | "youtube"; | |
/** | |
* 動画の埋め込みが可能かどうか。 | |
*/ | |
embeddable: boolean; | |
/** | |
* 動画再生ページで拡張統計情報が一般公開されているかどうか。 | |
* デフォルト: 統計情報が表示。 | |
* `false`であっても、一部の統計情報(再生回数/評価など)は一般公開される。 | |
*/ | |
publicStatsViewable: boolean; | |
/** | |
* 子供向け動画として設定されているかどうか。 | |
*/ | |
madeForKids: boolean; | |
} | |
export interface IVideosResponse_Statistic { | |
/** | |
* 動画の視聴回数。 | |
*/ | |
viewCount: string; | |
/** | |
* 動画の高評価数。 | |
*/ | |
likeCount: string; | |
/** | |
* 動画の低評価数。 | |
*/ | |
dislikeCount: string; | |
/** | |
*API取得時点の、動画がお気に入りされている数。 | |
*/ | |
favoriteCount: string; | |
/** | |
* 動画に付いてるコメント数。 | |
*/ | |
commentCount: string; | |
} | |
export interface IVideosResponse_Player { | |
/** | |
* 動画の埋め込み`<iframe>`タグ。 | |
*/ | |
embedHtml: string; | |
} | |
export interface IVideosResponse_TopicDetail { | |
/** | |
* 動画に紐づく主要なFreebaseID群。 | |
* 動画を主として構成しているカテゴリが格納される。 | |
*/ | |
topicCategories: string[]; | |
/** | |
* 動画で取り上げられている可能性のあるFreebaseID群。 | |
*/ | |
relevantTopicIds: string[]; | |
} | |
export interface IVideosResponse_RecordingDetails { | |
/** | |
* 動画の録画場所の位置情報。 | |
*/ | |
location: { | |
/** | |
* 緯度。 | |
*/ | |
latitude: number; | |
/** | |
* 経度。 | |
*/ | |
longitude: number; | |
/** | |
* 準拠楕円体からの高度(単位:メートル)。 | |
*/ | |
altitude: number; | |
}; | |
/** | |
* 動画の録画日。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式。 | |
*/ | |
recordingDate: string; | |
} | |
export interface IVideosResponse_LiveStreamingDetails { | |
/** | |
* ライブ配信開始時刻。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式。 | |
*/ | |
actualStartTime: string; | |
/** | |
* ライブ配信終了時刻。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式。 | |
*/ | |
actualEndTime: string; | |
/** | |
* ライブ配信開始予定時刻。 | |
* ISO 8601(`YYYY-MM-DDThh:mm:ss.sZ`)形式。 | |
*/ | |
scheduledStartTime: string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment