youtube-search-api
Version:
Node.js and TypeScript library to get YouTube search results with playlist by provided keywords, no Login or API key required!
62 lines (61 loc) • 1.81 kB
TypeScript
interface SearchItem {
id: string;
type: string;
thumbnail: any;
title: string;
channelTitle?: string;
shortBylineText?: string;
length?: string | any;
isLive?: boolean;
videos?: any[];
videoCount?: string;
}
export interface SearchResult {
items: SearchItem[];
nextPage: {
nextPageToken: string | null;
nextPageContext: any;
};
}
export interface PlaylistResult {
items: SearchItem[];
metadata: any;
}
export interface ChannelResult {
title: string;
content: any;
}
export interface VideoDetails {
id: string;
title: string;
thumbnail: any;
isLive: boolean;
channel: string;
channelId: string;
description: string;
keywords: string[];
suggestion: SearchItem[];
}
export interface ShortVideo {
id: string;
type: string;
thumbnail: any;
title: string;
inlinePlaybackEndpoint: any;
}
interface SearchOptions {
type: string;
}
declare const GetData: (keyword: string, withPlaylist?: boolean, limit?: number, options?: SearchOptions[]) => Promise<SearchResult>;
declare const nextPage: (nextPage: {
nextPageToken: string | null;
nextPageContext: any;
}, withPlaylist?: boolean, limit?: number) => Promise<SearchResult>;
declare const GetPlaylistData: (playlistId: string, limit?: number) => Promise<PlaylistResult>;
declare const GetSuggestData: (limit?: number) => Promise<{
items: SearchItem[];
}>;
declare const GetChannelById: (channelId: string) => Promise<ChannelResult[]>;
declare const GetVideoDetails: (videoId: string) => Promise<VideoDetails>;
declare const GetShortVideo: () => Promise<ShortVideo[]>;
export { GetData as GetListByKeyword, nextPage as NextPage, GetPlaylistData, GetSuggestData, GetChannelById, GetVideoDetails, GetShortVideo };