A lightweight library to interact with YouTube API using InnerTube.
npm install innertubeconst InnerTube = require('innertube');
async function example() {
const yt = new InnerTube();
try {
// Get video player information
const playerInfo = await yt.player({ videoId: 'dQw4w9WgXcQ' });
// Search videos
const searchResults = await yt.search({ query: 'JavaScript tutorials' });
// Browse recommendations
const browseResults = await yt.browse({ browseId: 'FEwhat_to_watch' });
} catch (error) {
console.error(error);
}
}player(options): Fetch video player informationsearch(options): Search YouTube videosbrowse(options): Get recommendationsnext(options): Fetch related content
MIT