How to Scrape TikTok Videos by Keyword, Hashtag or Profile: Step-by-Step Tutorial with Screenshots
TikTok Scraper collects TikTok videos in five ways: a keyword search, the trending feed of a country, a hashtag, a user profile or a sound. Each video comes back as one row with the caption, views, likes, comments, shares, saves, the author, the sound and the region. You don’t need a TikTok account.
For this tutorial I searched “meal prep” in the United States, sorted by most liked, from the past week. The run returned 30 videos in 8 seconds for $0.012. Those 30 videos had 15.2 million views, 380,088 saves and only 5,089 comments, about 75 saves for every comment. Every one of the 30 had more saves than comments. If you rank creators in a niche like this by comments, you miss what viewers actually keep. The whole run in 90 seconds:
Below are the same steps with a screenshot for each.
What you get
| Field | Example | Meaning |
|---|---|---|
desc |
Just a reminder that it can be this easy… Creamy Tomato Pasta |
The caption, with hashtags |
author.unique_id |
flavorsbyfrangipane |
The creator’s username (author holds the full public profile) |
statistics.play_count |
2304425 |
Views |
statistics.digg_count |
155574 |
Likes |
statistics.comment_count |
720 |
Comments |
statistics.share_count |
10112 |
Shares |
statistics.collect_count |
67448 |
Saves (favorites) |
music.title |
When I Wake |
The sound used in the video |
region |
US |
The video’s region |
create_time |
1795891251 |
Unix timestamp of the upload |
share_url |
https://www.tiktok.com/@…/video/… |
Link to the video |
Each row also carries the hashtags (cha_list), the video files at several resolutions and many more fields. Switch to All fields in the output to see them all.
Step 1: Open the Actor and click “Try for free”
Go to the Actor page on Apify and click Try for free. If you don’t have an account yet, sign up first. The free plan’s monthly credit covers thousands of videos with this Actor.

Step 2: Pick what to scrape
What to scrape decides where the videos come from:
| Option | Input it uses | What you get |
|---|---|---|
| Search by keyword | Keywords (one or more) + Country | Videos matching each keyword |
| Trending videos | Country | The trending feed for that country |
| Hashtag (URL) | URL, e.g. https://www.tiktok.com/tag/mealprep |
Videos under that hashtag |
| User profile (URL) | URL, e.g. https://www.tiktok.com/@username |
Videos posted by that account |
| Sound (URL) | URL of a TikTok sound page | Videos that use that sound |

Step 3: Enter the keyword and country
For a keyword search, type your keywords under Keywords (Search), one per field (or use Bulk edit to paste a list), and pick a Country. I used one keyword, meal prep, and United States.

Step 4: Set the number of results and the search filters
- Max results: how many videos to collect (default 20). It’s a soft limit, so the run stops once it reaches this number. Scrape all results ignores it and keeps going as long as TikTok returns results, which is slower.
- Sort by (Search):
0relevance (default),1most liked,2most recent. - Publish date (Search): all time, yesterday, this week, this month, last three months or last six months.
I used 30 results, sort 1 and This week.

The same input as JSON (switch the editor to JSON to paste it):
{
"type": "SEARCH",
"region": "US",
"keywords": ["meal prep"],
"maxItems": 30,
"isUnlimited": false,
"sortType": 1,
"publishTime": "WEEK"
}
For a hashtag, profile or sound, set type to HASHTAG, USER or MUSIC and put the TikTok link in url. For the trending feed, use "type": "TREND" with a region.
Step 5: Run it and read the results
Click Save & start. My run finished in 8 seconds with 30 results and cost $0.012 on the free plan.
The Videos view of the Output tab shows the link, caption, username, nickname, views, likes, comments, shares, saves, sound, region and upload time side by side.

What stood out in this run:
- The most-liked video was a “what I eat in a day” clip with 3.8M views and 336,802 likes.
- A one-pan creamy tomato pasta recipe had 67,448 saves and 720 comments, about 94 saves per comment.
- Across all 30 videos: 15,171,930 views, 1,262,734 likes, 380,088 saves, 80,403 shares and 5,089 comments.
For recipe and how-to niches, saves are the signal that someone plans to come back to the video, so sort the table by Saves when you shortlist creators.
Step 6: Export to CSV, Excel or JSON
Click Export, pick a view (Videos for the main columns, All fields for everything) and a format: JSON, CSV, XML, Excel, HTML Table, RSS or JSONL. You can also pick or leave out fields.

Run it from code
Get your API token from Settings > API & Integrations in Apify Console, then use the official client.
Python (pip install apify-client):
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("xtdata/tiktok-scraper").call(run_input={
"type": "SEARCH",
"region": "US",
"keywords": ["meal prep"],
"maxItems": 30,
"sortType": 1,
"publishTime": "WEEK",
})
rows = list(client.dataset(run["defaultDatasetId"]).iterate_items())
rows.sort(key=lambda r: r["statistics"]["collect_count"], reverse=True)
for r in rows[:5]:
s = r["statistics"]
print(r["author"]["unique_id"], s["collect_count"], "saves,", s["comment_count"], "comments")
Node.js (npm install apify-client):
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('xtdata/tiktok-scraper').call({
type: 'HASHTAG',
url: 'https://www.tiktok.com/tag/mealprep',
maxItems: 50,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, 'videos, top views:', Math.max(...items.map((v) => v.statistics.play_count)));
To follow a keyword or hashtag over time, save the input as a Task and add a Schedule. The Integrations tab can send each run’s results to Google Sheets, Slack, Make, Zapier or n8n.
Pricing
You pay per video, with no subscription. Errors aren’t charged.
| Event | Free plan | Paid plans |
|---|---|---|
| Each video scraped | $0.40 per 1,000 | down to $0.30 per 1,000 |
| Actor start | $0.00023 per GB of memory | down to $0.0002 |
The 30-video run above cost $0.012 in total. Set Maximum cost per run under Run options if you want a hard spending cap, especially with Scrape all results on.
Tips
- Several keywords in one run cost less than one run per keyword, because the start fee is paid once.
- Most liked + This week is a quick way to see what’s working in a niche right now. Most recent gives you a feed to monitor.
- Compare saves, shares and comments, not just views. They tell different stories: in the meal-prep run, saves outnumbered comments 75 to 1.
- Region-restricted content: the optional Proxy URL input takes your own proxy (Bright Data, Oxylabs, Decodo, IPRoyal, Webshare or SOAX). Set the proxy country to match the region you’re targeting.
FAQ
Do I need a TikTok account or cookies? No. The Actor collects public videos only.
Can I scrape a whole profile or hashtag? Yes. Use User profile (URL) or Hashtag (URL) and raise Max results, or turn on Scrape all results.
Do the filters work for hashtags and profiles? Sort by and Publish date apply to keyword searches. Country applies to keyword searches and the trending feed.
Ready to try it? Open TikTok Scraper on Apify. Your first runs fit easily into the free credit.