TikTok scraping means collecting public video data from profiles, hashtags, keyword searches and video URLs: captions, play, like, share and comment counts, durations, music, hashtags and author stats. The fastest way is a ready-made Actor: type a keyword or hashtag, set how many videos you want, and export JSON or CSV a few seconds later. No TikTok login is involved.
This guide shows the fields you get, how to run the scraper without code, and how to call it from curl, Python, JavaScript or an AI agent. It also covers costs, limits, the legal side and the official alternative. Every number comes from a real run on 22 October 2026 that searched TikTok's video tab for "pasta recipe".
What data you can get from TikTok
Each row is one public video or post. These fields come from the Actor's dataset views and our sample record:
| Field | What it holds |
|---|---|
text | Caption, including hashtags |
createTimeISO | Upload time in UTC |
webVideoUrl | Link to the video |
playCount | Plays |
diggCount | Hearts (likes) |
shareCount | Shares |
commentCount | Number of comments |
collectCount | Saves |
videoMeta.duration | Length in seconds |
musicMeta.musicName, musicMeta.musicOriginal | The sound, and whether it is original |
hashtags | Hashtag objects with name |
authorMeta.fans, authorMeta.verified | Author follower count and verified flag |
isAd | Whether the video is an ad |
searchQuery | The keyword that found the video |
A field TikTok didn't send stays off the row, and a real 0 stays 0. Private accounts are skipped, and AI video descriptions or summaries are not returned, because TikTok's payload doesn't include them.
How to scrape TikTok without code
- Open the TikTok Scraper in the Scrape.ly Store.
- Pick the Pasta recipe videos preset. It fills in this input:
{
"searchQueries": [
"pasta recipe"
],
"searchSection": "/video",
"resultsPerPage": 5,
"proxyCountryCode": "None"
}- Change the keyword, or switch to
hashtags,profilesorpostURLs. - Start the run. Ours finished in under 7 seconds.
- Export the results as JSON, CSV or Excel.
The input fields that matter most:
searchQueries,hashtags,profiles,postURLs: what to scrape. Give at least one. Hashtags go in without the#, profiles without the@.searchSection: which search tab to use. Empty for Top results,/videofor the Video tab, or the Profile tab.resultsPerPage: how many videos per keyword, hashtag or profile. Default 20.commentsPerPost: comments to collect per video, including replies. Default 0, which turns comments off.proxyCountryCode: scrape from a residential proxy in one country. WithNone, keyword searches run from Canada so repeated runs see the same ranking.
For date windows, use oldestPostDateUnified and newestPostDate on profiles and hashtags, or videoSearchDateFilter on searches.
How to scrape TikTok with the API
Get your token from Settings → API & Integrations in the Scrape.ly dashboard and export it as SCRAPELY_TOKEN. The Actor API docs list every endpoint.
curl
This search runs in seconds, well inside the 45-second limit of the synchronous endpoint, so one call starts the run and returns the items as a JSON array. Add ?format=csv for CSV.
curl -X POST "https://api.scrape.ly/v2/actors/echofield~tiktok-scraper/run-sync-get-dataset-items" \
-H "Authorization: Bearer $SCRAPELY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchQueries": ["pasta recipe"], "searchSection": "/video", "resultsPerPage": 5, "proxyCountryCode": "None"}'If a bigger run takes longer than 45 seconds, the call answers 408 and the run keeps going. Don't call again, because that starts a second run. Switch to the asynchronous flow or a client.
Python
Install the Python client with pip install scrapely-client-python. call() waits for the run however long it takes.
import os
from scrapely_client import ScrapelyClient
client = ScrapelyClient(os.environ["SCRAPELY_TOKEN"], api_url="https://api.scrape.ly")
run = client.actor("echofield/tiktok-scraper").call(
run_input={
"searchQueries": ["pasta recipe"],
"searchSection": "/video",
"resultsPerPage": 5,
"proxyCountryCode": "None",
}
)
print(run.status) # SUCCEEDED, FAILED, ABORTED or TIMED-OUT
for item in client.dataset(run.default_dataset_id).iterate_items():
print(item.get("playCount"), item.get("diggCount"), item.get("webVideoUrl"))JavaScript
Install the JavaScript client with npm install scrapely-client.
import { ScrapelyClient } from 'scrapely-client';
const client = new ScrapelyClient({ token: process.env.SCRAPELY_TOKEN, baseUrl: 'https://api.scrape.ly' });
const run = await client.actor('echofield/tiktok-scraper').call({
searchQueries: ['pasta recipe'],
searchSection: '/video',
resultsPerPage: 5,
proxyCountryCode: 'None',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, items[0]);The dataset API explains paging and export formats if you read the rows yourself.
MCP for AI agents
Scrape.ly runs a hosted MCP server at https://api.scrape.ly/mcp. In Cursor, add it to ~/.cursor/mcp.json:
{
"mcpServers": {
"scrapely": {
"url": "https://api.scrape.ly/mcp",
"headers": { "Authorization": "Bearer YOUR_TOKEN" }
}
}
}In Claude Code, run claude mcp add --transport http scrapely https://api.scrape.ly/mcp, then /mcp to sign in with OAuth. The agent uses search-actors, fetch-actor-details, call-actor and get-actor-output. Try: "Use scrapely to run echofield/tiktok-scraper on the TikTok video search for 'pasta recipe', 5 results, and give me a CSV of caption, plays, hearts and upload date."
A real run: Pasta recipe videos, 5 results
We ran the preset on 22 October 2026. It saved 5 videos in 6.8 seconds on 256 MB of memory and was charged $0.0179 in total. The names [creator 1] to [creator 5] are our placeholders: the accounts this search found belong to private individuals, so we don't publish their handles. The shareCount column is left out for width.
| text | authorMeta.name | playCount | diggCount | commentCount | videoMeta.duration | createTimeISO |
|---|---|---|---|---|---|---|
| Creamy pasta recipe 🍝✨ 1/2 onion 2 cloves fresh garlic 3 tbsp tomato… | [creator 1] | 7,100,000 | 276,200 | 1,175 | 62 | 2026-05-10T16:42:50.000Z |
| Hubby gave it an 8.5/10… chicken would’ve made it a 10/10 👀 Level: E… | [creator 2] | 4,100,000 | 70,000 | 400 | 0 | 2026-02-16T21:51:19.000Z |
| Creamy Garlic Parmesan Chicken Pasta Recipe! (FULL RECIPE LINKED IN B… | [creator 3] | 2,900,000 | 275,100 | 1,882 | 34 | 2026-07-16T21:38:39.000Z |
| 🧀 Creamy Alfredo Pasta Ingredients * 340 g (12 oz) fettuccine * 2 tbs… | [creator 4] | 256,000 | 2,010 | 3 | 0 | 2026-07-28T04:36:29.000Z |
| Creamy Spicy Pasta You'll want every night 🔥 Ingredients: • 1 small o… | [creator 5] | 5,000,000 | 108,800 | 540 | 47 | 2025-03-25T18:22:53.000Z |
The console excerpt:
2026-10-22T15:23:02.900Z [Scrapely] Container started (setup 0.8 s)
2026-10-22T15:23:04.063Z [scrapely.actor] INFO [Scrapely] Initializing API storage for run 6a3a3ad0306243f58
2026-10-22T15:23:04.204Z [scrapely.proxy_configuration] INFO Platform proxy access check succeeded.
2026-10-22T15:23:07.769Z [scrapely.actor] INFO Video search 'pasta recipe': 5 videos (max 5)
2026-10-22T15:23:08.575Z [scrapely.actor] INFO [Status message]: Saved 5 items.
2026-10-22T15:23:08.999Z [Scrapely] Container state: status=exited exitCode=0 oomKilled=falseThree things stand out. The results span March 2025 to July 2026, so a keyword search is not a feed of new videos; set videoSearchDateFilter if you need recent ones. Play counts arrive rounded (7,100,000, 4,100,000), while comment counts such as 1,175 are exact, so treat the large numbers as approximate. And two rows report a duration of 0, so check for zeros before you average durations.
What it costs
The Actor charges per event:
- Result: $0.0035 per saved video or post.
- Comment: $0.0008 per saved comment, only when you ask for comments.
- Follower or following row: $0.0024 per row, only when you set a cap.
- Date filter: $0.0008 per result when a date filter is set and applied.
- Popularity filter: $0.0008 per result when
leastDiggsormostDiggsis set and applied. - Video download: $0.0008 per video file downloaded and stored.
This run saved 5 results with no add-ons, so the result fees were 5 × $0.0035 = $0.0175. The run was charged $0.0179 in total because about $0.0004 of platform usage was added: residential proxy traffic, compute and dataset writes.
For 1,000 videos you pay $3.50 in result fees. With a date filter applied to all of them, that becomes $4.30 (1,000 × $0.0043). Adding 10 comments per video adds 10,000 × $0.0008 = $8.00. Platform usage comes on top, and failed inputs such as private profiles or dead links are never charged.
Limits and common problems
- Private and missing accounts are skipped. A private profile, a missing profile or a dead URL doesn't create a row. It is named in the status message and in the run's
OUTPUTrecord underfailedInputs. - Search sorting is approximate. TikTok's logged-out search ignores sorting and date settings, so the Actor applies them itself. Sorting re-orders up to three times your limit of matching videos, not all of TikTok.
- Popular profile videos are capped. With
profileSortingset topopular, TikTok returns at most about 400 to 500 videos, and date filters don't apply. - Comments can come back short. TikTok may return fewer comments than you asked for on busy videos, and doesn't always return every reply.
- Hearts filters and date filters don't mix.
leastDiggsandmostDiggsare ignored when a date filter is set. - Media links are not files.
videoMeta.downloadAddrand similar fields are signed CDN links. To keep a video, setshouldDownloadVideos, which stores the file after checking it is a real video.
Is it legal to scrape TikTok?
The videos and counts in this guide are public: anyone can see them without logging in. TikTok's own rules are strict, though. Its US Terms of Service say you may not scrape, crawl, export or otherwise extract data from the platform with any automated system, except as approved in writing.
Most TikTok accounts belong to private people, so usernames, captions, follower counts and comments are often personal data. Privacy laws like the GDPR and CCPA then apply to how you collect, store and use them, which is why we mask creators in this guide. Collect only what you need and avoid building profiles of individuals. This is not legal advice: talk to a lawyer about your specific use case before you scrape TikTok at scale.
Alternatives
- The TikTok Research API. TikTok's official route to public data is the Research API. It is open to academic institutions in the U.S., EEA, UK, Canada or Switzerland, and to not-for-profit research bodies in the EU. Applicants must be independent of commercial interests and submit a research proposal with an ethical review, and TikTok typically answers within four weeks. If you qualify, it is the better choice for published research. It isn't meant for commercial work.
- drawrowfly/tiktok-scraper. An open-source TypeScript tool for video posts and user, hashtag and music feeds. GitHub shows no pushes since May 2023, so test it against today's TikTok before you rely on it.
- A headless browser. Playwright or Puppeteer with residential proxies gives you full control. You also take on TikTok's bot detection, signed requests and frequent front-end changes, which is real upkeep for a small project. It is the better choice only if you need data no existing tool returns.
FAQ
How do I scrape TikTok videos by keyword?
Put the keyword in searchQueries, set searchSection to /video, and choose resultsPerPage. Each row keeps the keyword in searchQuery, so you can run several keywords in one go and still tell them apart.
Can you scrape TikTok comments?
Yes. Set commentsPerPost to the number you want per video, and maxRepliesPerComment for replies. Each saved comment costs $0.0008. Comments are often written by private individuals, so treat them as personal data.
Can you scrape a TikTok profile's followers?
Yes, with maxFollowersPerProfile or maxFollowingPerProfile. Those rows go into a separate dataset linked from each video and cost $0.0024 each. Follower lists are lists of people, so check the privacy rules before you collect them.
Does TikTok have an official API for scraping?
TikTok's Research API gives approved academic and not-for-profit researchers access to public data. Applicants must be independent of commercial interests, so it doesn't cover business use. Outside that program, the options are reading public pages yourself or using a ready-made tool, within the limits described in the legal section above.
How much does TikTok scraping cost?
$3.50 per 1,000 videos in result fees, plus platform usage. Comments, filters and downloads add $0.0008 per item each. Our five-video search cost $0.0179 in total.




