Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@tutorialman7727/tiktok-api-dl

TutorialMan772753ISC1.2.1TypeScript support: included

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

tiktok-api, tiktok-downloader, tiktok-dl, tiktok-nowatermark, tiktok, musically, tiktokv, tiktok-user, tiktok-stalk

readme

Tiktok Downloader & Stalk User



Table of Contents

Description

This project uses the Unofficial API from Tiktok.

  • Can be used to download videos, images / slides and music from Tiktok
  • Can be used to view someone's profile from Tiktok
  • No login or password are required
  • It is recommended to use your own cookies on Tiktok Stalker

How to get Tiktok Cookie

You can use cookies in the form of String or JSON

  1. Download Extension Cookie-Editor
  2. Login to the Tiktok Website
  3. Open the Cookie-Editor Extension
  4. Copy the Cookie and paste it into the code COOKIE: "YOUR_COOKIE"

Build this project

  • Clone the repository
  • Install the dependencies
  • Run the build script
git clone https://github.com/TobyG74/tiktok-api-dl.git
cd tiktok-api-dl
npm install
npm run build

Install

  • This module requires Node.js v10+ to run.

From NPM

npm install @tobyg74/tiktok-api-dl

From YARN

yarn add @tobyg74/tiktok-api-dl

From Github

npm install github:TobyG74/tiktok-api-dl

Examples

Tiktok Downloader

  • V1 uses the API from TiktokAPI
    • Support Video, Images / Slide, Music
  • V2 uses the API from SSSTik

  • V3 uses the API from MusicalDown

Options

  • version : The version of the downloader you want to use
    • v1 : TiktokAPI
    • v2 : SSSTik
    • v3 : MusicalDown
  • proxy : Proxy for request
const Tiktok = require("@tobyg74/tiktok-api-dl")

const tiktok_url = "https://vt.tiktok.com/ZS84BnrU9"

Tiktok.Downloader(tiktok_url, {
  version: "v1", //  version: "v1" | "v2" | "v3"
  proxy: "YOUR_PROXY" // Support Proxy Http, Https, Socks5
}).then((result) => {
  console.log(result)
})

Note : Cookies are required for searching users or live

Options

  • type : The type of search you want to use
    • user : Search User
    • live : Search Live
  • page : The page you want to search
  • cookie : Your Tiktok Cookie
  • proxy : Proxy for request

Search User | Live

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

const username = "tobz2k19"

Tiktok.Search(username, {
  type: "user" || "live",
  page: 1,
  cookie: process.env.COOKIE || "Your Cookie",
  proxy: "YOUR_PROXY" // Support Proxy Http, Https, Socks5
}).then((result) => {
  console.log(result)
})

Tiktok Stalker

Options

  • cookie : Only needed if you want to get all user posts
  • postLimit : Limit the number of posts to display
  • proxy : Proxy for request
const Tiktok = require("@tobyg74/tiktok-api-dl")

const username = "tobz2k19"

Tiktok.StalkUser(username, {
  cookie: process.env.COOKIE || "Your Cookie"
  postLimit: 10, // Limit the number of posts to display
  proxy: "YOUR_PROXY" // Support Proxy Http, Https, Socks5
}).then((result) => {
  console.log(result)
})

Response


<summary>Tiktok Downloader V1</summary>
{
  status: "success" | "error"
  message?: string
  result?: {
    type: "video" | "image"
    id: string
    createTime: number
    description: string
    isADS: boolean
    hashtag: string[]
    author: {
      uid: string
      username: string
      nickname: string
      signature: string
      region: string
      avatarLarger: 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
      whatsappShareCount: number
      repostCount: number
    }
    video?: {
      ratio: string
      duration: number
      playAddr: string
      downloadAddr: string
      cover: string
      originCover: string
      dynamicCover: 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
    }
  }
}
<summary>Tiktok Downloader V2</summary>
{
  status: "success" | "error"
  message?: string
  result?: {
    type: "video" | "image"
    desc?: string
    author?: {
      nickname?: string
      avatar?: string
    }
    statistics: {
      likeCount: string
      commentCount: string
      shareCount: string
    }
    video?: string
    images?: string[]
    music?: string
  }
}
<summary>Tiktok Downloader V3</summary>
{
  status: "success" | "error"
  message?: string
  result?: {
    type: "video" | "image"
    desc?: string
    author?: {
      avatar?: string
      nickname?: string
    }
    music?: string
    images?: string[]
    videoSD?: string
    videoHD?: string
    videoWatermark?: string
  }
}
<summary>Tiktok Search "User"</summary>
{
  status: "success" | "error"
  message?: string
  result?: [{
    uid: string
    username: string
    nickname: string
    signature: string
    followerCount: number
    avatarThumb: string[]
    isVerified: boolean
    secUid: string
    url: string
  }]
}
<summary>Tiktok Search "Live"</summary>
{
  status: "success" | "error"
  message?: string
  result?: [{
    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
    }
  }]
}
<summary>Tiktok Stalker</summary>
{
  status: "success" | "error"
  message?: string
  result?: {
    users: {
      username: string
      nickname: string
      avatar: string
      signature: string
      verified: boolean
      region: string
    }
    stats: {
      followerCount: number
      followingCount: number
      heartCount: number
      videoCount: number
      likeCount: number
    }
    posts: Posts[]
  }
}

Changelog

All updates and changes can be viewed in the CHANGELOG.md file.

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.

changelog

Changelog

Version 1.0.0 - 16-03-2023

Added

  • Initialize the downloader function fc860d5

Version 1.0.0a - 25-03-2023

Fixed

  • Fixing code to handle errors e683e6f

Version 1.0.0b - 03-04-2023

Added

  • Add Tiktok Profile search using username 1d29989
  • Merge pull request #1 from zennn08/master 1687f82

Changed

Version 1.0.0c - 07-04-2023

Fixed

  • Changing issue handling to be more consistent b48d82b

Version 1.0.0c - 07-04-2023

Fixed

  • Changing issue handling to be more consistent b48d82b

Version 1.0.2 - 08-04-2023

Changed

  • Changing the code to camelCase a3f52ff

Version 1.0.3 - 23-06-2023

Added

  • Added Cover & Dynamic Cover to the response 2f14b9a

Changed

  • Merge pull request #3 from 3IMAD69/master cfa4385
  • Update README.md 97250c5

Version 1.0.5 - 10-09-2023

Added

Version 1.0.5a - 21-09-2023

Added

Fixed

Version 1.0.6 - 07-10-2023

Added

  • Splitting multiple files for easy reading 300530a

Changed

  • Update README.md with improved formatting and content 3bedf83

Version 1.0.7 - 08-10-2023

Added

  • Added Tiktok Downloader V2 Documentation 246c6bd
  • Added Types for Tiktok Downloader V2 & Tiktok Stalk Response f7f6d37

Version 1.0.9 - 12-10-2023

Added

  • Adding multiple types and moving the API url to the api folder e649860

Changed

  • Rename files and types of ssstik downloader 8bccf19

Version 1.0.10 - 14-10-2023

Added

  • Added Tiktok Downloader V3 Documentation 6f18c51
  • Adding Musicaldown as Tiktok Downloader V3 f5849a6
  • Merge pull request #11 from nugraizy/master d6d44e9

Changed

Fixed

  • Fix Tiktok Download V1 method where some of urls does not appear on feed endpoint 8b00a9a
  • Fixed undefined response on object url author 07fa887
  • Fix Typo 5a92162

Version 1.0.11 - 06-11-2023

Added

  • Adding multiple types to the code 4484986

Version 1.0.13 - 11-11-2023

Changed

Fixed

Version 1.0.14 - 28-02-2024

Changed

Fixed

Version 1.0.14a - 22-03-2024

Added

  • Merge pull request #15 from zennn08/master f3b3b3b

Fixed

  • Images Slide undefined in ssstik 2d598b9

Version 1.0.16 - 24-03-2024

Added

  • Added responseParser types 92d2e7a
  • Added asyncRetry to prevent empty data 5851588

Changed

  • Changing the Tiktok API (tiktokv) domain 031051a

Version 1.1.0 - 29-03-2024

Added

  • Added Tiktok Search User Documentation 4a816a8
  • Added Tiktok Search User 722f257
  • Added Contants Folder & Variable 27bee06
  • Added Types for Tiktok Search User 7b988d7

Changed

Fixed

  • Tiktok Downloader Response 8fd77ea

Version 1.1.1 - 30-03-2024

Added

  • Added page as a replacement for the cursor 5d7b538

Fixed

  • Fixed exports on tiktok objects 5d7f3db

Version 1.1.1a - 06-04-2024

Fixed

  • Fixed regex validate tiktok url f00fa49

Version 1.1.4 - 20-04-2024

Added

  • Added postLimit Options c1be62e
  • Restrict too many data requests 383570e

Version 1.1.4a - 30-04-2024

Added

  • Added lite subdomain and Merge pull request #19 from Vasolix/master 0dd7b1f

Version 1.1.4b - 19-05-2024

Added

Version 1.1.6 - 07-07-2024

Added

Changed

Fixed

  • Fixed SSSTik Response Undefined 9e4b697
  • Fixed Error in Tiktok Downloader V1 3783799

Version 1.1.7 - 08-07-2024

Added

  • Added Tiktok Search Live Documentation a79fa90
  • Added Tiktok Search Live f7d9b1b

Changed

Version 1.1.8 - 09-07-2024

Added

  • Added Proxy Options Documentation b74828d
  • Added Proxy Options 75cf47c

Version 1.1.9 - 10-07-2024

Changed

  • Updated .prettierrc and added some types b57953b

Fixed

  • Fixed Musicaldown Response 824f853

Version 1.1.9a - 05-09-2024

Added

  • Merge pull request #28 from aquariuscool/master 0dd7b1f

Version 1.2.0 - 11-10-2024

Changed

Fixed

  • Fixing Errors in Musicaldown and Undefined Response in SSSTik 8f5ddd8

Version 1.2.1 - 06-11-2024

Added

  • Add yarn-lock.json to .npmignore & .gitignore 353c37c
  • Add Xbogus as a SearchUser params 82fbdb2
  • Adding xbogus as a helper function to generate xbogus tokens 903fa88
  • Adding the generate url xbogus function 4f506c1

Changed

  • Update README.md 0fd80db
  • Change TikTok API to Get Better Video Quality 0667116

Fixed

  • Fixed SSSTik error when downloading Tiktok Story 978afeb