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.
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".
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:
// 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 savesThe 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:
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:
// 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?
| Situation | Use |
|---|---|
| You only want to show the video on a page | oEmbed or the Embed Player |
| Creators connect their own TikTok accounts to your product | The Display API |
| An approved, non-commercial research project | The Research API |
| A handful of links, from your own computer | yt-dlp through youtube-dl-exec |
| Any public video link, from a server, without an app review | An 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.
APIs used in this guide
-
1 credit
TikTok Video API
Plays, likes, comments, shares and saves of one TikTok video, with its caption, hashtags, sound and creator.
GET /v1/tiktok/video -
1 credit
TikTok Profile API
Exact followers, likes and video count of a TikTok account, with its bio, bio link, verified, business and TikTok Shop flags.
GET /v1/tiktok/profile
More TikTok guides
- How to get a TikTok video's views and likes in Python
- How to get the comments of a TikTok video in Python
- How to get a TikTok follower count in Python
- TikTok Research API: who can get access, and what to do if you cannot
- How to get TikTok views, likes and follower counts in Google Sheets
Guides for other sources
Every source
YouTube
- How to get a YouTube transcript in Python
- How to get a YouTube transcript in Node.js
- YouTube API quota exceeded: what the error means and how to fix it
- How to find a YouTube channel ID from a handle or URL
- How to download YouTube subtitles as SRT or VTT
- youtube-transcript-api RequestBlocked or IpBlocked: why it happens and how to fix it
- How to get YouTube comments in Python
- How to search YouTube from Python
- How to list a YouTube channel's videos in Python
- How to summarize a YouTube video with an LLM in Python
- How to get YouTube transcripts and video stats in Google Sheets
- How to get YouTube video views and likes in Python
- How to get YouTube transcripts in n8n, Make and Zapier
- LangChain YoutubeLoader fails on a server: why, and a loader that works
- How to get a YouTube channel's subscriber count in Python
- How to give Claude or Cursor access to YouTube (MCP server)
- How to get YouTube comments in Node.js
- How to analyze YouTube comments with an LLM in Python
- How to list a YouTube channel's Shorts in Python
- How to search YouTube from JavaScript
- How to get an Instagram follower count in Python
- Instagram Basic Display API alternatives: what to use after the shutdown
- Instaloader 401 Unauthorized, 429 and "Login required": what to do
- How to calculate an Instagram engagement rate in Python
- How to get an Instagram follower count in Node.js
- How to get Instagram follower counts in Google Sheets
- How to get Instagram Reel views in Python
Websites
- Clearbit Logo API alternatives: get a company logo from its domain
- How to extract email addresses from a website in Python
- How to turn a web page into Markdown in Python
- How to detect what a website is built with, in Python
- How to get the contact emails and phone numbers of websites in Google Sheets
- How to build a LangChain tool that reads web pages and searches Google
- How to turn a web page into Markdown in JavaScript for RAG
- How to extract social media links from a website in Python
- How to get a website's favicon in Python
- How to check robots.txt in Python before you fetch a page
- How to get a Facebook Page's posts without app review
- Is there a Facebook Marketplace API?
- Facebook Groups API alternatives after its removal in 2024
- How to get a Facebook Page's follower count and contact details in Python
- How to get Google search results in Python
- pytrends 429 TooManyRequestsError: what it means and what to do
- How to get Google Trends data in Python
- Why is Wyoming first in Google Trends?
- How to get Google search results in Node.js
- How to get Google search results into Google Sheets
- How to give an LLM live Google results with tool calling
Threads
- How to get LinkedIn company data in Python
- How to search LinkedIn jobs from Python
- How to get a LinkedIn company page's latest posts in Python