TikTok keyword search scraper in n8n

Search TikTok by keyword or phrase and get matching videos with engagement stats, author profiles, music metadata, hashtags, and location tags, with optional discovery expansion for more results.

What this workflow does

Import it and n8n runs the TikTok Keyword Search & Discovery Scraper Actor on Apify every day at 08:00 with the starter input below. Each row comes back with post id, rank, search type, caption and 9 more; repeats with the same postUrl are dropped. A Google Sheets append is included and stays off until you add your sheet. The only credential it needs is your Apify API token.

Read from the workflow file, built for TikTok Keyword Search & Discovery Scraper version 1.0.7. Updated 2026-11-14.
TikTok Social media and trends Runs daily at 08:00

How the rows travel

6 nodes, in the order n8n runs them. The yellow stop is the call to the Apify Actor; the dashed stop is optional.

  1. Daily trigger Schedule trigger
  2. Configure input Code
  3. Run Apify Actor HTTP Request
  4. Normalize + dedupe Code
  5. Rows ready No operation
  6. Google Sheets (optional) Google Sheets, off until you switch it on

Input

The Configure input node holds the starter input. Change it there; every setting the Actor accepts is listed below.

{
  "queries": [
    "viral"
  ],
  "maxResultsPerQuery": 25,
  "searchType": "videos"
}
Input settings of TikTok Keyword Search & Discovery Scraper
SettingTypeRequiredDefaultWhat it does
searchType string Yes videos Videos: keyword video search. Photos: slideshow/photo search. Hashtags: hashtag metadata plus its top videos (uses the Hashtags field). One of: videos, photos, hashtags.
queries array No – Keywords or phrases to search for (searchType=videos or photos). Each query is searched independently.
hashtags array No – Hashtags to look up (searchType=hashtags). The # is optional, e.g. coffee or #coffee.
maxResultsPerQuery integer No 30 Maximum posts to collect per query or hashtag, before filters. TikTok itself usually returns about 150-220 posts per query even when you ask for more.
sortBy string No relevance Client-side sort applied after collecting results. TikTok's web search does not support server-side sorting, so this only reorders the posts TikTok returned. One of: relevance, mostLiked, mostViewed, newest.
publishedWithin string No all Client-side filter that drops posts older than the selected window, based on each post's creation time. One of: all, day, week, month, 3months, 6months.
minDurationSeconds integer No – Drop videos shorter than this. Leave blank for no minimum.
maxDurationSeconds integer No – Drop videos longer than this. Leave blank for no maximum.
excludeAds boolean No false Drop posts TikTok flags as paid advertisements.
minLikeCount integer No – Drop posts with fewer likes than this. Leave blank for no minimum.
minViewCount integer No – Drop posts with fewer plays/views than this. Leave blank for no minimum.
uniqueAuthors boolean No false Keep at most one post per creator, so the results read like a creator shortlist. When a sort is selected, the top-ranked post from each creator is kept.
maxPostsPerAuthor integer No – Optional cap on how many posts one creator may contribute. Ignored when One Post Per Author is on.
enableExpansion boolean No false After each keyword search, run extra searches derived from its own results: related searches, its top hashtags and its most-reused sound.
expansionSources array No ["suggestions","hashtags","sounds"] Which discovery sources to use when expansion is on. All three can be combined. One of: suggestions, hashtags, sounds.
maxExpansionQueriesPerSeed integer No 3 Maximum number of extra searches to run per keyword when expansion is on. Each one costs roughly as much run time as the original search.
includeHashtagMetadata boolean No true For hashtag searches: emit a metadata row with the hashtag's post count, view count, description and images. Also attaches metadata to hashtag-expansion posts when expansion is on.

What each row holds

Every field the Actor returns stays in the row (13 in its dataset schema). Normalize + dedupe trims text, drops empty fields, removes repeats with the same postUrl and adds _source and _scrapedAt. The main fields:

Main output fields of TikTok Keyword Search & Discovery Scraper
FieldWhat it is
postIdPost ID
rankRank
searchTypeSearch Type
captionCaption
createdAtCreated At
authorAuthor
playCountViews
likeCountLikes
commentCountComments
shareCountShares
postUrlPost URL

What the first run costs

Each run starts at $0.40 on the Free plan (4 GB of memory), then $0.99 per 1,000 results, plus platform usage.

The Actor lists $0.99 per 1,000 results; its catalogue page breaks the price down by Apify plan. The Apify Free plan includes $5 of usage a month.

The Actor behind it

TikTok Keyword Search & Discovery Scraper: Search TikTok by keyword or phrase and get matching videos with engagement stats, author profiles, music metadata, hashtags, and location tags, with optional discovery expansion for more results.

The same job from an AI agent

The matching agent skill gives Claude Code, Codex, Cursor and other agents the same Actor, input and fields. Install it in one line:

npx skills add https://scraperfinder.com --skill tiktok-keyword-search-and-discovery-scraper

The tikTok keyword search scraper skill, with manual install and run steps

Questions people ask

How do I import this workflow into n8n?

Copy https://scraperfinder.com/n8n/tiktok-keyword-search-and-discovery-scraper.json. In n8n, open a new workflow, click the three-dot menu, choose Import from URL and paste it. Or download the JSON file and use Import from File; both give the same 6 nodes.

Do I need an Apify account?

Yes. The workflow calls the TikTok Keyword Search & Discovery Scraper Actor through the Apify API with your own token, and each run is billed to your Apify account. The Free plan includes $5 of usage a month.

What does a run cost?

Each run starts at $0.40 on the Free plan (4 GB of memory), then $0.99 per 1,000 results, plus platform usage. The Actor's Store page shows the current price.

Can I change what it collects?

Yes: edit the input object in the Configure input node. The Actor takes 17 settings; the table on this page lists each one with its default. Raise maxResultsPerQuery once the first rows look right.

Does it work without Google Sheets?

Yes. The rows wait in the Rows ready node, so you can connect any other node there: a database, Airtable, a webhook or an email. The Google Sheets node is only one option.

Workflow updated 2026-11-14