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

tiktermux

v1.0.0

Published

Scraper for downloading media in the form of videos, images and audio from Tiktok. Also for stalking Tiktok Users

Readme

Table of Contents

Description

Note : This project uses the API from Tiktok. This project is made for educational purposes only. This project is not affiliated with Tiktok. This project is not intended to harm or damage the Tiktok platform.

  • This project is made to help users to download videos, images / slides and music from Tiktok.
  • This project is also made to help users to view someone's profile from Tiktok.
  • This project is also made to help users to view comments from a video on Tiktok.

Quick Installation

Install using our automated script:

curl -o install.sh https://raw.githubusercontent.com/TobyG74/tiktok-api-dl/master/install.sh
chmod +x install.sh
./install.sh

The script automatically:

  • Verifies Node.js installation and version
  • Installs the library using npm or yarn
  • Provides usage examples

Installation Methods

Using NPM

npm install @tobyg74/tiktok-api-dl

Using Yarn

yarn add @tobyg74/tiktok-api-dl

Using Github

npm install github:TobyG74/tiktok-api-dl

Usage Guide

Getting Tiktok Cookie

  1. Install Cookie-Editor
  2. Login to Tiktok
  3. Open Cookie-Editor
  4. Copy the cookie and use it in your code: COOKIE: "YOUR_COOKIE"

Using CLI

Global Installation

npm install -g @tobyg74/tiktok-api-dl
tiktokdl [command] [options]

Direct Usage

git clone https://github.com/TobyG74/tiktok-api-dl.git
cd tiktok-api-dl
npm install
npx ts-node src/cli/index.ts [command] [options]

NPM Script

npm run cli -- [command] [options]

Examples

$ tiktokdl -h
Usage: tiktokdl [options] [command]

Tiktok downloader and search CLI tool

Options:
  -V, --version                output the version number
  -h, --help                   display help for command

Commands:
  download [options] <url>     Download Tiktok Video / Slide / Music
  cookie                       Cookie Manager
  search                       Search Tiktok users or live streams
  getcomments [options] <url>  Get comments from a Tiktok video
  stalk [options] <username>   Stalk a Tiktok user
  help [command]               display help for command

Building from Source

git clone https://github.com/TobyG74/tiktok-api-dl.git
cd tiktok-api-dl
npm install
npm run build

Features

Tiktok Downloader

const Tiktok = require("@tobyg74/tiktok-api-dl")

const url = "https://vt.tiktok.com/xxxxxxxx"
Tiktok.Downloader(url, {
  version: "v1", // "v1" | "v2" | "v3"
  proxy: "YOUR_PROXY", // optional
  showOriginalResponse: true // optional, v1 only
}).then((result) => console.log(result))

Tiktok Search

const Tiktok = require("@tobyg74/tiktok-api-dl")

Tiktok.Search("username", {
  type: "user", // "user" | "live"
  page: 1,
  cookie: "YOUR_COOKIE", // needed
  proxy: "YOUR_PROXY" // optional
}).then((result) => console.log(result))

Tiktok Stalk User Profile

const Tiktok = require("@tobyg74/tiktok-api-dl")

const username = "Tobz2k19"
Tiktok.Stalker(username, {
  cookie: "YOUR_COOKIE", // optional, if response null
  proxy: "YOUR_PROXY" // optional
}).then((result) => console.log(result))

Tiktok Video Comments

const Tiktok = require("@tobyg74/tiktok-api-dl")

const url = "https://vt.tiktok.com/xxxxxxxx"
Tiktok.GetVideoComments(url, {
  commentLimit: 10, // optional, default is 30
  proxy: "YOUR_PROXY" // optional
}).then((result) => console.log(result))

Tiktok Get User Posts

const Tiktok = require("@tobyg74/tiktok-api-dl")

const username = "Tobz2k19"
Tiktok.GetUserPosts(username, {
  postLimit: 10, // optional, default is 30
  proxy: "YOUR_PROXY" // optional
}).then((result) => console.log(result))

Tiktok Get User Liked Videos

  • Note: To use this feature, you must be logged in with valid TikTok cookies to access user's liked videos
const Tiktok = require("@tobyg74/tiktok-api-dl")

const username = "Tobz2k19"
Tiktok.GetUserLiked(username, {
  postLimit: 10, // optional, default is 30
  cookie: "YOUR_COOKIE", // needed
  proxy: "YOUR_PROXY" // optional
})

API Response Types

Tiktok Downloader

Version 1 Response

interface TiktokAPIResponse {
  status: "success" | "error"
  message?: string
  result?: {
    type: "video" | "image"
    id: string
    createTime: number
    description: string
    author: {
      uid: number
      username: string
      nickname: string
      signature: string
      region: string
      avatarThumb: string[]
      avatarMedium: string[]
      url: string
    }
    statistics: {
      playCount: number
      downloadCount: number
      shareCount: number
      commentCount: number
      diggCount: number
      collectCount: number
      forwardCount: number
      whatsappShareCount: number
      loseCount: number
      loseCommentCount: number
      repostCount: number
    }
    hashtag: string[]
    isTurnOffComment: boolean
    isADS: boolean
    cover?: string[]
    dynamicCover?: string[]
    originCover?: string[]
    video?: {
      ratio: string
      duration: number
      playAddr: string[]
      downloadAddr: string[]
      cover: string[]
      dynamicCover: string[]
      originCover: string[]
    }
    images?: string[]
    music: {
      id: number
      title: string
      author: string
      album: string
      playUrl: string[]
      coverLarge: string[]
      coverMedium: string[]
      coverThumb: string[]
      duration: number
      isCommerceMusic: boolean
      isOriginalSound: boolean
      isAuthorArtist: boolean
    }
  }
  resultNotParsed?: any
}

Version 2 Response

interface SSSTikResponse {
  status: "success" | "error"
  message?: string
  result?: {
    type: "image" | "video" | "music"
    desc?: string
    author?: {
      avatar: string
      nickname: string
    }
    statistics?: {
      likeCount: string
      commentCount: string
      shareCount: string
    }
    images?: string[]
    video?: string
    music?: string
    direct?: string
  }
}

Version 3 Response

interface MusicalDownResponse {
  status: "success" | "error"
  message?: string
  result?: {
    type: "video" | "image"
    desc?: string
    author?: {
      avatar?: string
      nickname?: string
    }
    music?: string
    images?: string[]
    videoHD?: string
    videoWatermark?: string
  }
}

Tiktok Search

User Search Response

interface TiktokUserSearchResponse {
  status: "success" | "error"
  message?: string
  result?: Array<{
    uid: string
    username: string
    nickname: string
    signature: string
    followerCount: number
    avatarThumb: string
    isVerified: boolean
    secUid: string
    url: string
  }>
  page?: number
  totalResults?: number
}

Live Search Response

interface TiktokLiveSearchResponse {
  status: "success" | "error"
  message?: string
  result?: Array<{
    id: string
    title: string
    cover: string[]
    squareCover: string[]
    rectangleCover: string[]
    liveTypeThirdParty: boolean
    hashtag: string
    startTime: number
    stats: {
      totalUser: number
      viewerCount: number
      likeCount: number
    }
    owner: {
      id: string
      nickname: string
      username: string
      signature: string
      avatarThumb: string[]
      avatarMedium: string[]
      avatarLarge: string[]
      modifyTime: number
      stats: {
        followingCount: number
        followerCount: number
      }
      isVerified: boolean
    }
  }>
  page?: number
  totalResults?: number
}

Video Search Response

interface TiktokVideoSearchResponse {
  status: "success" | "error"
  message?: string
  result?: Array<{
    id: string
    desc: string
    createTime: number
    author: {
      id: string
      uniqueId: string
      nickname: string
      avatarThumb: string
      avatarMedium: string
      avatarLarger: string
      signature: string
      verified: boolean
      secUid: string
      openFavorite: boolean
      privateAccount: boolean
      isADVirtual: boolean
      tiktokSeller: boolean
      isEmbedBanned: boolean
    }
    stats: {
      collectCount: number
      commentCount: number
      diggCount: number
      playCount: number
      shareCount: number
    }
    video: {
      id: string
      ratio: string
      cover: string
      originCover: string
      dynamicCover: string
      playAddr: string
      downloadAddr: string
      format: string
    }
    music: {
      id: string
      title: string
      playUrl: string
      coverThumb: string
      coverMedium: string
      coverLarge: string
      authorName: string
      original: boolean
      album: string
      duration: number
      isCopyrighted: boolean
    }
  }>
  page?: number
  totalResults?: number
}

Tiktok Stalk User Profile

Profile Response

interface TiktokStalkUserResponse {
  status: "success" | "error"
  message?: string
  result?: {
    user: {
      username: string
      nickname: string
      avatar: string
      signature: string
      verified: boolean
      region: string
    }
    stats: {
      followerCount: number
      followingCount: number
      heartCount: number
      videoCount: number
      likeCount: number
    }
  }
}

Tiktok Video Comments

Comments Response

interface TiktokVideoCommentsResponse {
  status: "success" | "error"
  message?: string
  result?: Array<{
    cid: string
    text: string
    commentLanguage: string
    createTime: number
    likeCount: number
    isAuthorLiked: boolean
    isCommentTranslatable: boolean
    replyCommentTotal: number
    replyComment: []
    user: User
    url: string
  }>
  totalComments?: number
}

Tiktok User Posts

User Posts Response

interface TiktokUserPostsResponse {
  status: "success" | "error"
  message?: string
  result?: Array<{
    id: string
    desc: string
    createTime: number
    digged: number
    duetEnabled: number
    forFriend: number
    officalItem: number
    originalItem: number
    privateItem: number
    shareEnabled: number
    stitchEnabled: number
    stats: {
      collectCount: number
      commentCount: number
      diggCount: number
      playCount: number
      shareCount: number
    }
    author: {
      id: string
      username: string
      nickname: string
      avatarLarger: string
      avatarThumb: string
      avatarMedium: string
      signature: string
      verified: boolean
      openFavorite: boolean
      privateAccount: boolean
      isADVirtual: boolean
      isEmbedBanned: boolean
    }
    video?: {
      id: string
      duration: number
      ratio: string
      cover: string
      originCover: string
      dynamicCover: string
      playAddr: string
      downloadAddr: string
      format: string
      bitrate: number
    }
    music: {
      authorName: string
      coverLarge: string
      coverMedium: string
      coverThumb: string
      duration: number
      id: string
      title: string
      playUrl: string
      original: boolean
    }
    images?: string[]
  }>
  totalPosts?: number
}

Tiktok User Liked Videos

User Liked Videos Response

interface TiktokUserFavoriteVideosResponse {
  status: "success" | "error"
  message?: string
  result?: Array<{
    id: string
    desc: string
    createTime: string
    duetEnabled: boolean
    digged: boolean
    forFriend: boolean
    isAd: boolean
    originalItem: boolean
    privateItem: boolean
    officialItem: boolean
    secret: boolean
    shareEnabled: boolean
    stitchEanbled: boolean
    textTranslatable: boolean
    author: {
      id: string
      username: string
      nickname: string
      avatarLarger: string
      avatarThumb: string
      avatarMedium: string
      signature: string
      verified: string
      openFavorite: string
      privateAccount: string
      isADVirtual: string
      isEmbedBanned: string
      stats: {
        likeCount: string
        followerCount: string
        followingCount: string
        friendCount: string
        heartCount: string
        postsCount: string
      }
    }
    stats: {
      collectCount: string
      commentCount: string
      diggCount: string
      playCount: string
      repostCount: string
      shareCount: string
    }
    video?: {
      id: string
      videoID: string
      duration: number
      ratio: string
      cover: string
      originCover: string
      dynamicCover: string
      playAddr: string
      downloadAddr: string
      format: string
      bitrate: number
      bitrateInfo: any[]
    }
    imagePost?: Array<{
      title: string
      images: string[]
    }>
    music: {
      id: string
      title: string
      playUrl: string
      coverThumb: string
      coverMedium: string
      coverLarge: string
      authorName: string
      original: boolean
      album: string
      duration: number
      isCopyrighted: boolean
      private: boolean
    }
  }>
  totalPosts?: number
}

Changelog

Contributing

  • This repository is open source. We really appreciate it if you want to participate in developing this repository...
  • Please read our CONTRIBUTING.md and CODE_OF_CONDUCT.md before contributing.

License

  • This project is licensed under the Apache License - see the LICENSE file for details.