npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@scrappy-scraper/youtube_scraper

v1.0.30

Published

YouTube Scraper. Video subtitle and metadata. Channel info and list of videos

Readme

Youtube Scraper

| feature | Video | Channel | |--------------------|:------------------------------------:|:--------------:| | title | ✅ | ✅ | | description | ✅ | ✅ | | thumbnail | ✅ | ✅ | | transcripts | ✅ | N / A | | video download url | ✅ | N / A | | other fields | views, duration, viewCount, and more | list of videos |

Also supports YouTube search

Try out this scraper for free on Apify.com

Install

npm install @scrappy-scraper/youtube_scraper    # npm
yarn add @scrappy-scraper/youtube_scraper       # yarn

Environment

Works in Node.js and react-native

Works in Chrome extension when running on youtube.com page.

Does not work in browser due to limited CORS setting from YouTube

Sample Code

/* Get VideoInfo and Download Captions */

import { VideoParser } from '@scrappy-scraper/youtube_scraper';
const videoParser = new VideoParser();
await videoParser.load({videoId: "dQw4w9WgXcQ"}); // Rick Roll

// show the available caption tracks
console.log(videoParser.availableCaptions);     // example: [ { name: 'English', languageCode: 'en', isGenerated: false } ]

// fetch transcripts
await videoParser.fetchTranscripts({languageLimit: 3, preferredLanguages: ['en']})

// show all the data
console.log(JSON.stringify(videoParser.toJSON())) // captions are inside this JSON, along with other data
/* Get ChannelInfo and list of videos */

import { ChannelParser } from '@scrappy-scraper/youtube_scraper';
const channelParser = new ChannelParser();
await channelParser.load({ channelId: "@RickAstleyYT" }); // channelId can be a handle or a regular id

if(channelParser.hasMoreVideos()) await channelParser.fetchMoreVideos(); // can use "while" instead of "if"

console.log(channelParser.toJSON())
/* Perform YouTube Search */

import { SearchHandler } from '@scrappy-scraper/youtube_scraper';
let searchHandler = new SearchHandler();
await searchHandler.search({ query: "Rick Astley" });

if(searchHandler.hasMoreItems()) await searchHandler.fetchMoreItems(); // can use "while" instead of "if"
console.log(searchHandler.toJSON())

proxyUrlGenerator

Please put in Rotating Residential proxy url.

Session is supported by putting in :sessionId into the randomized segment of the url.

For example:

// Provided by Proxy provider:
"http://my_user_name_sid-adsfasdf:[email protected]:port"
"http://my_user_name_sid-qwerqwer:[email protected]:port"
"http://my_user_name_sid-zxcvzxcv:[email protected]:port"

// What you put in:
"http://my_user_name_sid-:sessionId:[email protected]:port"

// create proxyUrlGenerator 
const proxyUrlGenerator = async (sessionId: string|null|undefined): Promise<string> => {
    return "http://username:password@host:port"
        .replace(":sessionId", sessionId || Math.round(Math.random() * 10**6).toString());
}

// instantiate parsers with the proxyUrlGenerator
let videoParser = new VideoParser({ proxyUrlGenerator });
let channelParser = new ChannelParser({ proxyUrlGenerator });
let searchHandler = new SearchHandler({ proxyUrlGenerator });

Local Build and Test

If you want to make modification and test it, look for the test file index.test.ts The main code is in src/index.ts

Clone the Repository

git clone https://github.com/Scrappy-Scraper/YoutubeScraper.git
cd YoutubeScraper
npm install

To Test Run

npm run test       # npm
yarn run test      # yarn

To Build JS File

npm run build       # npm
yarn run build      # yarn