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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tcortega/twitter-scraper

v0.2.4

Published

Twitter Scraper & Media Downloader. Scrape info from any tweet.

Downloads

10

Readme

Twitter Scraper & Downloader

Scrape and download useful information from Twitter.

No login or password are required

This is not an official API support. This is just a scraper which uses Twitter's web API to scrape media and related meta information.


Content

Features

  • Scrape metadata from any tweet, including video & image urls.

To Do

  • [ ] Add support to scrape user-specific metadata.
  • [ ] Improve documentation

Contribution

  • Don't forget about tests
yarn test
yarn build

Installation

twitter-scraper requires Node.js v10+ to run.

Install from NPM

npm i -g @tcortega/twitter-scraper

Install from YARN

yarn global add @tcortega/twitter-scraper

USAGE

Module

Methods

.getTweetMeta(tweetUrl) // Scrape tweet metadata from a specific tweet (Promise).

Promise

const { TwitterScraper } = require("@tcortega/twitter-scraper");

// Tweet Metadata by tweet url.
(async () => {
  try {
    const twtScraper = await TwitterScraper.create();
    const tweetMeta = await twtScraper.getTweetMeta("https://twitter.com/Twitter/status/1390396166496522247");
    console.log(tweetMeta);
  } catch (error) {
    console.log(error);
  }
})();

Json Output Example

Tweet Feed

Example output for the methods: getTweetMeta

// Note that everything inside media_url is usually sorted by the bitrate descendingly
{
  id: '1379101721343975426',
  created_at: 'Mon Apr 05 16:00:47 +0000 2021',
  description: 'Hey #DisabilityTwitter, thank you so much for your feedback about captioning our videos. We hear you, we see you, we’ve added captions to this @TwitterSpaces announcement. What do you think? We’ll continue to level up our captioning process moving forward. #UntilWeAllBelong https://t.co/E3EK7MZmgR',
  isMedia: true,
  favorite_count: 2759,
  retweet_count: 489,
  reply_count: 1188,
  quote_count: 111,
  isVideo: true,
  media_url: [
    {
      bitrate: 2176000,
      content_type: 'video/mp4',
      url: 'https://video.twimg.com/ext_tw_video/1379100778439270410/pu/vid/1280x720/iUvXD6H13QiZF7mp.mp4?tag=12'
    },
    {
      bitrate: 832000,
      content_type: 'video/mp4',
      url: 'https://video.twimg.com/ext_tw_video/1379100778439270410/pu/vid/640x360/ilHR1Y8Zl6yRIXOi.mp4?tag=12'
    },
    {
      bitrate: 256000,
      content_type: 'video/mp4',
      url: 'https://video.twimg.com/ext_tw_video/1379100778439270410/pu/vid/480x270/KFG8GZ4tSTtjwwuk.mp4?tag=12'
    }
  ]
}