TikTok Video Engagement Scraper avatar

TikTok Video Engagement Scraper

Pricing

Pay per usage

Go to Apify Store
TikTok Video Engagement Scraper

TikTok Video Engagement Scraper

Collects engagement metrics and metadata (views, likes, comments, shares, saves, favorites, duration, postedAt, description, and author details) for TikTok videos.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Dwi Wahyu

Dwi Wahyu

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Share

An Apify Actor built in TypeScript with the Apify SDK and Crawlee that collects engagement metrics and video metadata for a batch of TikTok video URLs.

Features & Scope

Accepts one or more TikTok video URLs (https://www.tiktok.com/@<user>/video/<id> or short links https://vm.tiktok.com/... / https://www.tiktok.com/t/...) and returns for each video:

  • videoUrl — Canonical normalized TikTok video URL (https://www.tiktok.com/@<user>/video/<id>)
  • videoId — Numeric TikTok video ID
  • authorUsername — Creator account username (uniqueId without @)
  • authorNickname — Creator display name (nickname)
  • description — Video caption / description text
  • views — Video play / view count (playCount)
  • likes — Video like count (diggCount)
  • comments — Video comment count (commentCount)
  • shares — Video share count (shareCount)
  • saves — Video save / bookmark count (collectCount)
  • favorites — Video favorite / bookmark count (collectCount)
  • durationSeconds — Video duration in seconds
  • postedAt — ISO 8601 timestamp when the video was published
  • scrapedAt — ISO 8601 timestamp when the video was scraped
  • error — Error description if the URL was invalid or the video was deleted/private/unavailable (null on success)

Strict Scope Guarantees

  • No extraneous crawling: Scrapes only the video URLs provided in the input batch (never crawls user profiles, hashtags, or search pages).
  • No fabricated numbers: Any metric that is not publicly available for a video is returned as null — values are never estimated or guessed.
  • Short link resolution & URL normalization: Resolves vm.tiktok.com, vt.tiktok.com, and tiktok.com/t/... short links to their canonical URL before scraping, strips query parameters and trailing slashes, and deduplicates repeated videos in a single run.
  • Every input accounted for: Invalid URLs or deleted/private videos do not crash the run — they produce a dataset item with a descriptive error field and null metrics.

Input

The Actor input is defined in ./.actor/input_schema.json (and ./INPUT_SCHEMA.json):

FieldTypeRequiredDefaultDescription
videoUrlsstring[]Yes—One or more TikTok video URLs (https://www.tiktok.com/@<user>/video/<id>) or short links (https://vm.tiktok.com/..., https://www.tiktok.com/t/...).
proxyConfigurationobjectNo{ "useApifyProxy": true }Apify Proxy configuration. Use Residential proxies if plain requests are blocked by TikTok.
maxConcurrencyintegerNo4Number of TikTok video URLs processed in parallel (1–10).
sessionCookiestring (secret)No—Optional TikTok sessionid cookie value if authenticated access is needed for restricted videos. Stored encrypted and never logged.

Example Input

{
"videoUrls": [
"https://www.tiktok.com/@tiktok/video/7106594312292453675",
"https://www.tiktok.com/@zachking/video/6768504823336815877",
"https://www.tiktok.com/@420doggface208/video/6876424179084709126"
],
"proxyConfiguration": {
"useApifyProxy": true
},
"maxConcurrency": 4
}

Output

The Actor stores one item per deduplicated TikTok video URL in the default Apify Dataset, rendered as a table in the Apify Console via ./.actor/dataset_schema.json.

Output Schema

{
"videoUrl": "string",
"videoId": "string | null",
"authorUsername": "string | null",
"authorNickname": "string | null",
"description": "string | null",
"views": "number | null",
"likes": "number | null",
"comments": "number | null",
"shares": "number | null",
"saves": "number | null",
"favorites": "number | null",
"durationSeconds": "number | null",
"postedAt": "ISO 8601 string | null",
"scrapedAt": "ISO 8601 string",
"error": "string | null"
}

Example Output

[
{
"videoUrl": "https://www.tiktok.com/@tiktok/video/7106594312292453675",
"videoId": "7106594312292453675",
"authorUsername": "tiktok",
"authorNickname": "TikTok",
"description": "how many frogs did you find? 🐸 check out tiktok’s #Minecraft community today! @Gorillo",
"views": 591900,
"likes": 98900,
"comments": 1276,
"shares": 360,
"saves": 59206,
"favorites": 59206,
"durationSeconds": 24,
"postedAt": "2022-06-07T20:15:29.000Z",
"scrapedAt": "2026-10-19T03:32:00.000Z",
"error": null
},
{
"videoUrl": "https://www.tiktok.com/@zachking/video/6768504823336815877",
"videoId": "6768504823336815877",
"authorUsername": "zachking",
"authorNickname": "Zach King",
"description": "They rejected my application to Hogwarts, but I still found a way to be a wizard. 🧹#illusion #magic #harrypotter",
"views": 2400000000,
"likes": 29600000,
"comments": 782400,
"shares": 1100000,
"saves": 997818,
"favorites": 997818,
"durationSeconds": 15,
"postedAt": "2019-12-09T18:15:29.000Z",
"scrapedAt": "2026-10-19T03:32:01.000Z",
"error": null
},
{
"videoUrl": "https://www.tiktok.com/@420doggface208/video/6876424179084709126",
"videoId": "6876424179084709126",
"authorUsername": "420doggface208",
"authorNickname": "Doggface",
"description": "Morning vibe #fyp #foryoupage #fleetwoodmac #cranberrydreams #doggface",
"views": 99700000,
"likes": 14900000,
"comments": 128500,
"shares": 723900,
"saves": 646176,
"favorites": 646176,
"durationSeconds": 23,
"postedAt": "2020-09-25T15:02:13.000Z",
"scrapedAt": "2026-10-19T03:32:02.000Z",
"error": null
},
{
"videoUrl": "https://www.tiktok.com/@bellapoarch/video/6862153058223197445",
"videoId": "6862153058223197445",
"authorUsername": "bellapoarch",
"authorNickname": null,
"description": null,
"views": null,
"likes": null,
"comments": null,
"shares": null,
"saves": null,
"favorites": null,
"durationSeconds": null,
"postedAt": null,
"scrapedAt": "2026-10-19T03:32:03.000Z",
"error": "TikTok video not found or has been deleted (item doesn't exist)."
}
]

How It Works

  1. Input Normalization, Deduplication & Short Link Resolution:
    • Validates each URL against canonical TikTok video URL patterns (https://www.tiktok.com/@<user>/video/<id>) and short link formats (https://vm.tiktok.com/..., https://vt.tiktok.com/..., https://www.tiktok.com/t/...).
    • Strips query parameters, tracking flags, and trailing slashes, and resolves short links to canonical URLs before scraping.
  2. Embedded JSON Extraction (Primary):
    • Extracts video metadata and engagement counters directly from <script id="__UNIVERSAL_DATA_FOR_REHYDRATION__"> (__DEFAULT_SCOPE__["webapp.video-detail"].itemInfo.itemStruct) and <script id="SIGI_STATE"> (ItemModule).
    • Prefers 64-bit integer strings in statsV2 over legacy stats to avoid 32-bit signed integer overflow on videos with >2.14 billion views.
    • Automatically solves TikTok's SlardarWAF proof-of-work challenge cookie if triggered on an HTTP request, and enriches metadata via TikTok's official /oembed endpoint when needed.
  3. Headless Browser Fallback (Secondary):
    • Falls back to headless Puppeteer only if the embedded JSON state is unavailable from HTTP requests.
  4. Modest Concurrency & Backoff Retries:
    • Processes URLs in parallel (default concurrency 4) and retries failed requests up to 3 times with exponential backoff.

Local Development & Testing

# Install dependencies
npm install
# Run unit tests
npm test
# Build TypeScript
npm run build
# Run Actor locally using Apify CLI
apify run

Deployment to Apify Platform

# 1. Authenticate with your Apify account
apify login
# 2. Deploy the Actor to the Apify platform
apify push

Summary of Field Availability in Testing

FieldPublic AvailabilitySource in Embedded JSON (__UNIVERSAL_DATA_FOR_REHYDRATION__ / SIGI_STATE)
videoUrlObtainableCanonical normalized URL (https://www.tiktok.com/@<user>/video/<id>).
videoIdObtainableExtracted from itemStruct.id.
authorUsernameObtainableExtracted from itemStruct.author.uniqueId (or oEmbed author_unique_id).
authorNicknameObtainableExtracted from itemStruct.author.nickname (or oEmbed author_name).
descriptionObtainableExtracted from itemStruct.desc (or oEmbed title).
viewsObtainableExtracted from itemStruct.statsV2.playCount / stats.playCount.
likesObtainableExtracted from itemStruct.statsV2.diggCount / stats.diggCount.
commentsObtainableExtracted from itemStruct.statsV2.commentCount / stats.commentCount.
sharesObtainableExtracted from itemStruct.statsV2.shareCount / stats.shareCount.
savesObtainableExtracted from itemStruct.statsV2.collectCount / stats.collectCount (TikTok's bookmark/save counter).
favoritesObtainableExtracted from itemStruct.statsV2.collectCount / stats.collectCount (TikTok's "Add to Favorites" / bookmark counter shares the same collectCount field).
durationSecondsObtainableExtracted from itemStruct.video.duration.
postedAtObtainableConverted to ISO 8601 from itemStruct.createTime (Unix epoch seconds).
scrapedAtObtainableISO 8601 timestamp recorded at scrape completion.
errornull on successPopulated with a descriptive message when an input URL is invalid or the video is deleted/private/unavailable (in which case unavailable fields return null).