Social media5 min readBy Purrkey teamUpdated

How to search TikTok videos by keyword

Get a normalized JSON list of TikTok videos matching a keyword, with captions, authors, views, likes, comments and shares, then turn the rows into a comparison table for creator and format review

On this page

You have 30 TikTok cooking videos to collect for a recipe series review, and you need captions, creators, views, likes, comments and shares in one table. One keyword search returns normalized JSON for matching videos, and a small number of cursor pages can extend the set. No run has been executed for this guide; the table below is a design

Example input and worksheet design

Example input: query is cooking, datePosted is 7 for the past week, and sortBy is most-liked. Replace these values with your own keyword and filters. The tool id is anyapi.tiktok.search_keyword; the tool is called through POST /v1/runs with toolId anyapi.tiktok.search_keyword.

The deliverable is one row per video with columns for caption, author, views, likes, comments, shares, url and an added engagement-rate column. Values here are placeholders showing the shape

CaptionAuthorViewsLikesCommentsSharesURLEngagement rate
Example captionexample_creator0000video URL0.0%

Engagement rate is a calculated column: (likes + comments + shares) divided by views, with a blank cell when views is zero. Keep the table in the same column order for the first page and for each cursor page

query is the required field. datePosted is optional and accepts 0 for any time, 1 for the past 24 hours, 7 for the past week, 30 for the past month, 90 for the past three months or 180 for the past six months. A number outside those values may not filter anything. sortBy is optional and accepts relevance, most-liked or date-posted. cursor is optional and comes from a previous response's nextCursor

requireFields is optional and names output fields. The contract says naming a field can raise the quoted price when a dearer source must serve the request, and a combination that no single source returns together is refused as invalid input, with no charge

The first call returns a page of videos and may include a data.nextCursor. Pass that value as cursor for the next page. If data.nextCursor is null, that lane has no more videos. Start with one page, then add cursor pages until the table has the rows you need

Step 2: read the output fields that drive the decision

The response has found and data. When found is true, data.videos holds the records. Each record carries id, caption, author, views, likes, comments, shares, url, createdUtc, durationSeconds, hashtags and soundClipId, plus optional fields such as authorFollowers, authorVerified, locationName, paidPartnership, soundAuthor and soundTitle. The contract says authorFollowers, authorVerified, locationName, paidPartnership, soundAuthor and soundTitle can be null when the serving source does not report them

Use caption to compare the angle and format, author to group videos by creator, and views, likes, comments and shares to fill the engagement columns. createdUtc is a UTC epoch timestamp in seconds, useful for checking that a row falls inside the datePosted window. The engagement rate combines likes, comments and shares over views. A high rate points to a format worth a manual review; the table does not decide the creator choice on its own

If authorFollowers or authorVerified is null, leave that cell blank rather than inventing a value. If paidPartnership is true, flag the row for a manual check of the caption

When found is false, reason is not_found; the contract says a found: false answer is a successful call, not an error, and costUsd is what it actually cost. The table can still record the attempt and the reason

For the creator shortlist after this table, see research TikTok creators

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to search TikTok for the keyword cooking with datePosted 7 and sortBy most-liked. Check the current inputs and price of anyapi.tiktok.search_keyword before running anything. Call the tool for the first page, then follow data.nextCursor as cursor until the table has 30 rows or the cursor is null, for up to five calls. Return a table with caption, author, views, likes, comments, shares, url and an engagement-rate column computed as (likes + comments + shares) divided by views, blank when views is zero. Do not estimate missing values.

Estimated tool cost

Prices from the Purrkey catalog, read November 13, 2026. The unit is max_call, which the catalog defines as "Maximum per call. Successful runs settle at the actual AnyAPI charge." The totals below are ceilings. Model fees for the agent are not counted

StepFormulaUnit pricePlanned quantityTotal
One keyword search1 call x max price$0.0036 per call1$0.0036
First page plus four cursor pages5 calls x max price$0.0036 per call5$0.018

The first scenario is one call. The second scenario is the first page plus four cursor pages

Next action

Open the TikTok keyword search tool and run the example with query set to your keyword

Get started by giving this to your agent

  • Claude Code
  • Codex
  • Gemini CLI
  • Cursor
  • GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with TikTok.
Explore TikTok tools and pricing

FAQ

How do I search TikTok videos by keyword?

Call anyapi.tiktok.search_keyword with a required query, and optionally set datePosted, sortBy, cursor or requireFields. The response returns a found flag and data.videos when results exist.

What inputs does anyapi.tiktok.search_keyword take?

The contract requires query and lists optional datePosted, sortBy, cursor and requireFields. datePosted accepts 0, 1, 7, 30, 90 or 180 days back, and sortBy accepts relevance, most-liked or date-posted.

What output fields should I use to compare videos?

Use the data.videos records with caption, author, views, likes, comments, shares and url, and add an engagement-rate column. The body defines that column as (likes + comments + shares) divided by views, left blank when views is zero.

How do I get the next page of TikTok search results?

Pass the nextCursor value from data back as cursor in the next call. If data.nextCursor is null, that lane has no more videos.

What happens when no videos are found?

The response has found set to false and reason set to not_found. The contract says a found: false answer is a successful call, not an error, and costUsd is what it actually cost.

How much does a TikTok keyword search cost?

The catalog lists anyapi.tiktok.search_keyword at up to $0.0036 per call. One search is at most $0.0036, and a first page plus four cursor pages is at most $0.018.

What happens if requireFields names a combination no source returns?

The contract says such a combination is refused as invalid input, with no charge. Naming a field can raise the quoted price when a dearer source must serve the request.

Next step

Try this with TikTok

The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.

See TikTok tools

Share this article