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

@tikfly/client

v1.0.0

Published

Unofficial TikTok API at scale without the usual limitations

Readme

Tikfly API

Unofficial TikTok API Wrapped in Node.js & TypeScript

GitHub Repo stars GitHub forks Vistors License

Available on NPM

Installation

npm install @tikfly/client
# or
yarn add @tikfly/client
# or
pnpm add @tikfly/client

Usage

Get TikTok User Info

import { Tikfly } from "@tikfly/client";

const API_KEY = "YOUR_API_KEY"; // How to get your api key -> https://docs.tikfly.io/getting-started/quickstart
const USERNAME = "taylorswift"; // Change to the user you want to get data from

async function getTikTokUserInfo() {
  const tikfly = new Tikfly(API_KEY);

  const res = await tikfly.user.getUserInfo({
    unique_id: USERNAME,
  });

  console.log(res.userInfo);
}

getTikTokUserInfo();

Get Tiktok User Videos

import { Tikfly } from "@tikfly/client";

const API_KEY = "YOUR_API_KEY"; // How to get your api key -> https://docs.tikfly.io/getting-started/quickstart
const USERNAME = "taylorswift"; // Change to the user you want to get data from
const NUM = 50; // Max number of videos to fetch

async function getTikTokUserVideos() {
  const tikfly = new Tikfly(API_KEY);

  console.log(`Fetching ${NUM} videos of user: ${USERNAME}`);

  const resUserInfo = await tikfly.user.getUserInfo({
    unique_id: USERNAME,
  });

  const userSecUid = resUserInfo.userInfo.user.secUid;
  console.log("User secUid:", userSecUid);

  let results: any[] = [];
  let cursor = 0;
  const count = 15;
  let hasMore = true;

  while (hasMore && results.length < NUM) {
    console.log(`Current cursor: ${cursor}`);

    const res = await tikfly.user.getUserPosts({
      secUid: userSecUid,
      count,
      cursor,
    });

    const itemList = res.itemList || [];

    if (!itemList.length) break;

    results.push(...itemList);

    hasMore = res.hasMore;
    cursor = res.cursor;
  }

  results = results.slice(0, NUM);

  for (const video of results) {
    console.log(`- ${video.id}: ${video.desc}`);
  }
}

getTikTokUserVideos();

Download Tiktok Videos (Without Watermark)

import { Tikfly } from "@tikfly/client";
import fs from "fs";
import axios from "axios";

const API_KEY = "YOUR_API_KEY"; // How to get your api key -> https://docs.tikfly.io/getting-started/quickstart

async function downloadVideo(url: string, path: string) {
  const res = await axios({
    url,
    method: "GET",
    responseType: "stream",
  });

  const writer = fs.createWriteStream(path);

  res.data.pipe(writer);

  return new Promise((resolve, reject) => {
    writer.on("finish", resolve);
    writer.on("error", reject);
  });
}

async function run() {
  const tikfly = new Tikfly(API_KEY);

  const videoUrl = "https://www.tiktok.com/@taylorswift/video/7558098574555254046";

  const res = await tikfly.video.download(videoUrl);

  const downloadUrl = res.play;
  console.log("Download URL:", downloadUrl);

  if (downloadUrl) {
    const videoId = videoUrl.split("/").pop();
    await downloadVideo(downloadUrl, `${videoId}.mp4`);
  }
}

run();

Tutorials

Contributing

Contributions are welcome! If you find this project helpful, please consider starring the repository on GitHub ⭐️

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Disclaimer

This project is an independent, open-source tool and is not affiliated, endorsed, or sponsored by TikTok.