How to get TikTok video views, likes and shares in Node.js

Checked on 2026-11-24.

TikTok's official routes to a video's numbers each come with a condition. Its oEmbed endpoint returns no counts, the Display API covers only the videos of people who log in to your app, and the Research API is for approved, non-commercial researchers. For any other public video, Node.js code gets the views and likes from the video's public page, through yt-dlp from npm or through an HTTP API.

1. oEmbed: an embed code and no numbers

oEmbed is the official address that answers without a key or an app.

JavaScript
const url = new URL('https://www.tiktok.com/oembed');
url.searchParams.set('url', 'https://www.tiktok.com/@scout2015/video/6718335390845095173');
console.log(await (await fetch(url)).json());

The answer, from the live address on 2026-11-24, has the keys version, type, width, height, html, provider_url, provider_name, embed_product_id and embed_type, the same as the example in TikTok's documentation.

Where it stops: there are no views, likes or other counts in it. The same page says "Embed Videos will be deprecated soon" and recommends the Embed Player for new integrations. Use it to show a video, not to measure one.

2. The Display API: videos of people who log in to your app

The Display API's video query returns view_count, like_count, comment_count and share_count, and "Up to 20 video IDs can be included per request". The condition is in its first sentence: "Given an authorized user and a list of video IDs, the /v2/video/query/ endpoint verifies that the videos belong to the user".

JavaScript
const fields = 'id,title,view_count,like_count,comment_count,share_count';
const res = await fetch(`https://open.tiktokapis.com/v2/video/query/?fields=${fields}`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.TIKTOK_USER_ACCESS_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ filters: { video_ids: ['7077642457847991554'] } }), // videos of the user who logged in
});
const { data, error } = await res.json();
if (error.code !== 'ok') console.log(error.message);
else for (const video of data.videos) console.log(video.id, video.view_count, video.like_count);

The token belongs to one TikTok user, who logged in to your app and granted it the video.list scope. TikTok's app review guidelines add: "Apps must not be for private or personal use."

Where it stops: at other people's videos. It is the right route when creators connect their own accounts to your product, and it cannot look up a link you found.

3. The Research API: for approved researchers

The Research API reads public videos, but access is by application. Its FAQ asks "I am a creator, advertiser, or commercial user. Am I eligible for access to the Research Tools?" and answers "No." It also says that "New videos take up to 48 hours to be added to the search engine", that "statistics such as view count and follower count can take up to 10 days to update", and that "the daily limit is set at 1000 requests per day". The guide to Research API access has the rules and the application steps.

4. yt-dlp from npm, on your own computer

yt-dlp is an open-source downloader that can return a video's metadata without the file. The npm package youtube-dl-exec runs it from Node.js; this is the call from its README with a TikTok link in it:

JavaScript
// npm install youtube-dl-exec
import youtubedl from 'youtube-dl-exec';

const info = await youtubedl('https://www.tiktok.com/@scout2015/video/6718335390845095173', {
  dumpSingleJson: true, // metadata only, no video file
});
console.log(info.view_count, info.like_count, info.comment_count);
console.log(info.repost_count, info.save_count); // shares and saves

The fields come from yt-dlp's TikTok extractor, which maps TikTok's play count to view_count, its share count to repost_count and its save count to save_count. The package downloads yt-dlp when it is installed, and its README notes that it "requires Python 3.11 or above available in your system as python3", except on Windows.

Where it breaks: yt-dlp reads the video's web page, which is not a documented interface, so it can stop working until it is updated. Its source names the refusals you can meet, such as Your IP address is blocked from accessing this post and TikTok is requiring login for access to this content. Packages written only for TikTok age quickly: tiktok-scraper, which older tutorials use, last came out on npm in August 2021. @tobyg74/tiktok-api-dl is a downloader whose v1 answer, as its README documents it, includes a statistics object with playCount, likeCount, commentCount, shareCount and collectCount; its latest version on npm, 1.3.7, came out on 27 October 2025.

5. An HTTP API, for any public video from any server

With Pipefetch the numbers of a public video are one HTTPS request with one key, from any server and with nothing to install. A plain fetch call:

JavaScript
const url = new URL('https://pipefetch.com/v1/tiktok/video');
url.searchParams.set('video', 'https://www.tiktok.com/@scout2015/video/6718335390845095173');

const res = await fetch(url, {
  headers: { 'x-api-key': process.env.PIPEFETCH_API_KEY },
  signal: AbortSignal.timeout(90_000),
});
if (res.status === 404) {
  console.log('Deleted, private or never existed'); // not charged
} else if (!res.ok) {
  throw new Error(`Pipefetch answered ${res.status}`); // a 502 is not charged and can be sent again
} else {
  const { data } = await res.json();
  console.log(data.playCount, data.likeCount, data.commentCount);
  console.log(data.shareCount, data.collectCount); // shares and saves
}

The npm client, pipefetch, has no method named after TikTok, but its get() takes the path of any endpoint and returns the same data:

JavaScript
// npm install pipefetch
import Pipefetch, { NotFoundError } from 'pipefetch';

const pf = new Pipefetch(); // reads PIPEFETCH_API_KEY

try {
  const video = await pf.get('/v1/tiktok/video', { video: 'https://www.tiktok.com/@scout2015/video/6718335390845095173' });
  console.log(video.playCount, video.likeCount, video.engagementRate, video.author.followerCount);
} catch (error) {
  if (error instanceof NotFoundError) console.log('Deleted, private or never existed'); // not charged
  else throw error;
}

The counts are as precise as TikTok's own video page, which rounds large numbers the way it displays them: 160.3K plays arrive as 160300, a creator's 9M followers as 9000000. Smaller counts arrive in full. The answer also has the caption, hashtags, sound, creation date and duration, and engagementRate is likes plus comments plus shares as a percentage of plays. The video file is not returned, and a short vm.tiktok.com link is not accepted: open it and pass the address it leads to. A request costs 1 credit, a deleted or private video answers 404 and costs nothing, and a new account has 100 free credits and needs no card. The reference lists every field.

Where it stops: it is not an official TikTok API, and Pipefetch is not affiliated with TikTok. It returns what the public page shows to a visitor who is not logged in, so it has nothing for private videos.

Which one should you use?

SituationUse
You only want to show the video on a pageoEmbed or the Embed Player
Creators connect their own TikTok accounts to your productThe Display API
An approved, non-commercial research projectThe Research API
A handful of links, from your own computeryt-dlp through youtube-dl-exec
Any public video link, from a server, without an app reviewAn HTTP API such as Pipefetch

Which of these are official

oEmbed, the Display API and the Research API are TikTok's own. yt-dlp, the npm packages and Pipefetch are not: they read what TikTok shows publicly, without TikTok's approval. TikTok's Terms of Service list among the things users must not do: "extract any data or content from the Platform using any automated system or software that is not provided by TikTok". If your project needs TikTok's permission in writing, the official routes are the ones that come with it.

For the same task in Python, see TikTok video views and likes in Python; for a creator's exact follower count, how to get a TikTok follower count.

Try it with 100 free credits. No card needed. No scraper to build or maintain. Get an API key or read the docs.

Every source

YouTube

Instagram

Websites

Facebook

Google

Threads

LinkedIn

App stores

Steam

X

Pinterest

Airbnb

Real estate

Keywords

Job boards

Eventbrite

Shopify stores

Public tenders

All guides