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

tiktok-api-unofficial

v0.1.0

Published

Unofficial TikTok API library: scrape video/user metadata and optionally download media (no API key required)

Readme

tiktok-api-unofficial (TypeScript)

npm version License: MIT Node 18+

Unofficial TikTok API library (TypeScript/Node): scrape video and user profile metadata, and optionally download videos, slides, and audio. No official API key required.

Install

From npm:

npm install tiktok-api-unofficial

From GitHub:

git clone https://github.com/8dazo/tiktok_scrapper.git
cd tiktok_scrapper/tiktok-api-ts
npm install
npm run build

Requirements: Node.js 18+ (for native fetch). If you see Could not locate the bindings file for better-sqlite3, run:

npm rebuild better-sqlite3

Usage

import { TTContentScraper } from "tiktok-api-unofficial";

const scraper = new TTContentScraper({
  waitTime: 0.35,
  outputDir: "data/",
  progressDbPath: "progress_tracking/scraping_progress.db",
  clearConsole: false,
});

// Add video IDs (from TikTok URL) and/or usernames
scraper.addObjects(["7398323154424171806"], "batch1", "content");
scraper.addObjects(["tiktok", "tagesschau"], "users", "user");

// Scrape: metadata only, or with media (mp4/jpeg/mp3)
await scraper.scrapePending({ scrapeFiles: false });   // metadata only
// await scraper.scrapePending({ scrapeFiles: true }); // also download videos/slides/audio
  • Content: use type: "content" and video IDs from the video URL.
  • Users: use type: "user" and usernames (with or without @).

Output is written under outputDir:

  • content_metadata/<video_id>.json – video/post metadata
  • user_metadata/<username>.json – user profile metadata
  • content_files/ – mp4, jpeg, mp3 when scrapeFiles: true

Progress is stored in the SQLite database at progressDbPath (pending/completed/error per ID).

Test

npm test

Runs a metadata-only scrape of 1 video + 1 user and checks output files.

API (TypeScript)

  • TTContentScraper – Main scraper (extends ObjectTracker). Options: waitTime, outputDir, progressDbPath, clearConsole.
  • ObjectTracker – SQLite progress DB: addObject, addObjects, markCompleted, markError, getPendingObjects, getStats, getObjectStatus, getErrorObjects, resetErrorsToPending, resetAllToPending, clearAllData, close.
  • BaseScraper – Low-level: scrapeMetadata(videoId), scrapeUser(username), scrapeBinaries(links).
  • filterTiktokData(raw) – Normalize raw TikTok itemStruct into typed metadata.
  • ObjectStatus – Enum: PENDING, COMPLETED, ERROR, RETRY.

Publish to npm

  1. Log in: npm login
  2. From tiktok-api-ts: npm publish (or npm publish --access public for a scoped package like @your-scope/tiktok-api-unofficial).

If the name tiktok-api-unofficial is taken, set a different name in package.json (e.g. tiktok-scraper-unofficial or @your-username/tiktok-api-unofficial).

Push to GitHub

  1. Create a new repository on GitHub (e.g. tiktok_scrapper).
  2. In your project root:
    git remote add origin https://github.com/8dazo/tiktok_scrapper.git
    git push -u origin main
    (Use master instead of main if your default branch is master.)

License

MIT.