How to scrape TikTok videos, comments, and profiles

Last updated

Datapika scrapes TikTok videos for $0.001 each, which is $1 per 1,000 videos, with no TikTok API key or developer account (Apify Store, August 2026). Paste a video URL, a profile URL, or a vm.tiktok.com share link, pick one of the five TikTok modes, and get JSON rows with play, like, comment, and share counts, hashtags, music credits, and a no-watermark MP4 link. The same actor handles Douyin and Bilibili URLs in the same run, returns up to 5,000 items per URL, and is callable through the Apify REST API or an MCP endpoint.

Which TikTok URLs and modes does the scraper accept?

On TikTok the actor runs five of its seven modes: video_detail, user_posts, user_profile, video_comments, and user_likes. Each mode expects a specific URL shape, and the platform field can stay on auto because the actor detects tiktok.com, douyin.com, and bilibili.com hosts by itself.

Video modes take the canonical form www.tiktok.com/@handle/video/1234567890, and profile modes take www.tiktok.com/@handle. Short links copied from the mobile app, vm.tiktok.com and vt.tiktok.com, are followed to their canonical video URL before scraping, so you can paste share links straight from a phone.

There is no keyword or hashtag search input. Hashtags arrive as an array parsed from every caption, so the practical pattern is to scrape creators or videos you already know and filter on that array. The trending mode exists, but it serves Douyin hot search and Bilibili popular feeds, not TikTok.

  • Single url or a urls array; the two are merged if both are set, and 500 URLs per run is the recommended ceiling
  • maxItems caps paginated modes (user_posts, video_comments, user_likes) at 1 to 5,000 per input URL, default 100
  • vm.tiktok.com and vt.tiktok.com share links resolve automatically to www.tiktok.com/@handle/video/<id>
  • Unsupported combinations such as live_info or trending on TikTok return a structured error row instead of failing the run
  • includeComments: true attaches the first page of comments to a video_detail run without a second call

What fields come back for each TikTok video, profile, and comment?

Every row shares one schema across the three platforms, which means a TikTok video and a Douyin video have identical field names and can land in the same table. The platform and item_type fields tell you what each row is: video, user, comment, live, trending, or error.

Video rows carry title and description, author_id, author_name and author_username, duration_sec, cover_url, and video_url_nowm for the no-watermark MP4. Engagement comes as play_count, like_count, comment_count, share_count, and collect_count, with created_at as an ISO timestamp and music_title plus music_author for the sound.

Profile rows add follower_count, following_count, video_count, bio, avatar_url, and a verified flag. Comment rows carry comment_id, reply_to_id, and comment_text so threads can be rebuilt. Each row also includes raw, the full source response, and scraped_at for freshness tracking.

  • Engagement: play_count, like_count, comment_count, share_count, collect_count
  • Creator: author_username, follower_count, following_count, video_count, verified, bio
  • Assets: cover_url, video_url_nowm (no-watermark MP4, expires within hours), duration_sec
  • Sound: music_title and music_author for tracking which audio is spreading
  • Threads: comment_id and reply_to_id link replies to their parent comment
  • raw keeps the complete source payload for fields the unified schema does not map

How much does it cost to scrape TikTok compared with other scrapers?

Datapika bills per delivered row. A video row costs $0.001, so 1,000 TikTok videos cost $1.00 and a full 5,000-item user_posts pull costs $5.00 (Apify Store, August 2026). Comments and profiles are separate pay-per-event items listed on the store page. There is no subscription, no API key fee, and no charge for URLs that come back as error rows.

The category leader on Apify, clockworks/tiktok-scraper, lists $1.70 per 1,000 results, 245,964 users, and a 4.79 rating as of August 2026 (apify.com/clockworks/tiktok-scraper). It wins on adoption and on input types, since it accepts hashtags and search queries, which Datapika does not. Datapika wins on price per video and on covering Douyin and Bilibili in the same run.

To cap spend, set ACTOR_MAX_TOTAL_CHARGE_USD on the run. When the cap is reached mid-batch, remaining URLs are skipped and written as error rows so the dataset still explains what happened.

  • $0.001 per video row, the same price on TikTok, Douyin, and Bilibili
  • 1,000 videos for $1.00; 5,000 videos, the maxItems ceiling for one URL, for $5.00
  • Error rows (deleted, private, region-blocked, unsupported mode) are never billed
  • Comparison: $1.70 per 1,000 results on clockworks/tiktok-scraper, verified August 2026
  • Spending cap via ACTOR_MAX_TOTAL_CHARGE_USD; the run stops charging at the limit

How do marketing and research teams use TikTok data from this actor?

The Western marketing case is creator work: vetting influencers, measuring sponsored posts, and spotting sounds before they peak. A user_profile call returns follower_count, video_count, and verified for a shortlist of creators, and a user_posts call on the same handles returns the last 100 posts with per-video engagement, enough to compute average views per post before signing a contract.

For campaign measurement, run video_detail on the sponsored video URLs daily and store play_count, like_count, share_count, and collect_count by scraped_at. The deltas give a growth curve per post without asking the creator for screenshots.

Sound sourcing uses music_title and music_author across a set of trend accounts, and comment mining pairs video_comments with a sentiment model. Because Douyin rows share the schema, a brand active in both markets can watch its Chinese creator partners in the same dataset.

  • Influencer vetting: follower_count, video_count, and average play_count from the last 100 posts
  • Sponsored post tracking: daily video_detail snapshots keyed by scraped_at
  • Sound and hashtag discovery: aggregate music_title and the hashtags array across trend accounts
  • Comment mining: video_comments with replies for sentiment and UGC sourcing (requires a TikTok cookie)
  • Cross-market benchmarking: TikTok and Douyin rows in one table with identical field names
  • AI and ML datasets: captions, stats, and cover images at $1 per 1,000 videos

How do AI agents call the TikTok scraper through MCP?

The actor is exposed through Apify's MCP server, so an agent can discover its input schema and run it without custom glue code. Point the client at https://mcp.apify.com/?tools=fetch-actor-details,openclawai/tiktok-douyin-bilibili-scraper, call fetch-actor-details once to read the mode and URL fields, then call the actor with mode, url or urls, and maxItems.

For plain HTTP, the Apify REST endpoint run-sync-get-dataset-items returns the dataset as a JSON array in one request. Each element is one row with item_type set, so an agent can branch on video, user, comment, or error without parsing HTML.

Bulk runs process URLs concurrently, and 100 URLs typically finish in 2 to 3 minutes, so an agent asked to compare 20 creators gets an answer in one tool call. Comments need a TikTok browser cookie passed in the cookie field; videos and profiles do not.

  • MCP endpoint: https://mcp.apify.com/?tools=fetch-actor-details,openclawai/tiktok-douyin-bilibili-scraper
  • REST: POST the input JSON to the run-sync-get-dataset-items endpoint and receive rows in the response body
  • Every row has item_type, so error handling is a field check, not an exception
  • Residential proxy is on by default; custom proxies go in proxyConfiguration.proxyUrls
  • 100 URLs in roughly 2 to 3 minutes per the actor documentation, August 2026
TikTok, Douyin & Bilibili scraper modes: what you pass and what you get back (Apify Store, August 2026)
ModeWhat you passWhat you get backPlatformsBilled as
video_detailOne TikTok video URL or a vm.tiktok.com share linkOne video row: caption, play/like/comment/share counts, author, music, hashtags, no-watermark MP4TikTok, Douyin, BilibiliVideo row, $0.001
user_postsProfile URL, www.tiktok.com/@handleUp to maxItems recent videos with per-video engagement statsTikTok, Douyin, BilibiliVideo row, $0.001 each
user_profileProfile URLOne user row: follower_count, following_count, video_count, bio, verified, avatar_urlTikTok, Douyin, BilibiliProfile event
video_commentsVideo URL, plus a TikTok cookieUp to maxItems comments with reply_to_id and engagement countsTikTok, Douyin, BilibiliComment event, per comment
user_likesProfile URLVideos the account has liked, as standard video rowsTikTok, DouyinVideo row, $0.001 each
live_infoLive room URLlive_status, live_title, viewer_count, hostDouyin, Bilibili (not TikTok)Video row, $0.001
trendingplatform only, no URLDouyin hot-search keywords or Bilibili popular videosDouyin, Bilibili (not TikTok)Video row, $0.001 each

How to do it

  1. 1.Open https://apify.com/openclawai/tiktok-douyin-bilibili-scraper, set mode (video_detail for one video, user_posts for a creator's feed, user_profile for account stats), and paste a TikTok URL or share link into url, or a list into urls.
  2. 2.Set maxItems (default 100, up to 5,000) for paginated modes, leave downloadVideos on for no-watermark MP4 links, and paste a TikTok browser cookie into the cookie field only if you are running video_comments.
  3. 3.Start the run and read rows from the dataset as JSON or CSV, or send the same input to the Apify REST API's run-sync-get-dataset-items endpoint to get the rows back in one HTTP response.
  4. 4.For agents, connect to https://mcp.apify.com/?tools=fetch-actor-details,openclawai/tiktok-douyin-bilibili-scraper and call the actor as a tool; mix Douyin and Bilibili URLs into the same urls array when you need cross-platform data.
Run the TikTok & Douyin Scraper

Questions, answered

Does TikTok have an official API for pulling public videos and comments?

TikTok's Research API exists, but access is limited to academic institutions in the US, EEA, UK, or Switzerland, not-for-profit research bodies in the EU, and Brazilian institutions studying youth safety. The research must be non-commercial, pass an ethics review, and disclose its funding, and TikTok says to expect a reply within about 4 weeks (developers.tiktok.com, August 2026). Marketing and research teams without that access use a scraper like Datapika, which needs no developer account.

Why does TikTok comments mode return 0 results?

TikTok serves comments only to logged-in sessions, so video_comments on TikTok needs a fresh browser cookie pasted into the cookie field, which is stored as a secret input. Videos, profiles, user posts, and likes work without one, and Bilibili comments run without a cookie. If the cookie is stale you get an error row, not a charge, so rotate it before large comment jobs.

Do the no-watermark TikTok MP4 links expire?

Yes. TikTok's CDN links in video_url_nowm expire within a few hours, so download and store the file promptly rather than saving the URL. downloadVideos is on by default and works for TikTok and Bilibili. On Douyin the CDN currently rate-limits these links to 403 responses, so the option is auto-disabled there and metadata is still returned; forceDownload: true overrides that if your setup can fetch them.

Can I scrape TikTok by hashtag, keyword, or trending page?

Not directly. The actor is URL-driven, and trending mode is limited to Douyin hot search and Bilibili popular, so there is no TikTok trending feed. The workaround is to run user_posts on a set of trend-setting creators and filter the hashtags array or music_title in your own code. If hashtag search is the core requirement, clockworks/tiktok-scraper accepts hashtag input at $1.70 per 1,000 results (verified August 2026).

Can I scrape private TikTok accounts or region-blocked videos?

No. Only public content is returned; private, deleted, or region-blocked URLs come back as an error row with item_type set to error and a readable error_message, and those rows are not billed. Some regions soft-block TikTok profile lookups, in which case switching the residential proxy to another country group usually clears it. Custom proxies can be set in proxyConfiguration.proxyUrls.

Can I scrape TikTok, Douyin, and Bilibili in the same run?

Yes, and that is the main difference from single-platform TikTok scrapers. Leave platform on auto, put tiktok.com, douyin.com, and bilibili.com URLs in the same urls array, and every row comes back with the same field names plus a platform tag. One caveat: the mode applies to the whole batch, so a user_posts run needs profile URLs for all three sites. Douyin user_posts can lag by about 6 days for some accounts.

Keep reading