Social media6 min readBy Purrkey teamUpdated

How to list recent TikTok hashtag videos

Get recent TikTok videos for a hashtag with creator, caption, views, likes, shares and a next-page cursor

On this page

You have a #booktok campaign brief and need the first 20 recent videos under the hashtag to compare creator reach and engagement. The table below is the deliverable: one row per video with creator, caption, views, likes, shares, creation time and URL. This guide sets up the call and the cost; no run has been executed for it, so the table is a design, not a result. For hashtag discovery before this step, see trending hashtags on TikTok

The worksheet and the example input

Example input, invented for this guide: hashtag is booktok and limit is 20. The reader replaces the example with the tag they need, without the # prefix. The first page is enough for the brief; pull a second page only when the initial 20 videos do not give enough examples

The deliverable table design uses these columns. Values here are placeholders showing the shape:

authorHandletextplayCountlikeCountshareCountcreatedUtcurl
(handle)(caption)(integer)(integer)(integer)(Unix seconds)(tiktok.com URL)

The table feeds a decision on which creators and formats to study for a reading-community campaign. Do not treat an empty or missing optional value as zero; the contract says null can mean the serving source does not report a field

Fields the tool takes

The contract documents these input properties. hashtag is required and must be the tag without the # prefix. limit is optional, an integer from 1 to 20, default 20. cursor is optional and comes from a previous response's nextCursor; omit it for the first page and pass it back to fetch the next page of videos. requireFields is optional. Omit it and routing is unchanged, with the cheapest source serving. Name output fields this request must be able to return, and the request is served only by a source that returns each named field. Fields you do not name are still returned whenever the serving source has them

requireFields can raise your quoted price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a video that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. A source that returns only a rounded or shortened value for a field does not count as returning it. On a paginated walk it applies to the first page only; later pages stay with the source that page chose, at the price it was quoted

Pull the first page and read the output fields

Agents call it through POST /v1/runs with toolId anyapi.tiktok.hashtag_videos. Set limit to 20 for the brief. The tool cannot return more than 20 videos in one call; the contract caps limit at 20, so a larger set needs cursor paging: take data.nextCursor from the response and pass it back as cursor. Stop when data.nextCursor is null

For each video, read authorHandle, text, playCount, likeCount, shareCount, createdUtc and url. authorHandle is the username without the @ prefix. text is the caption, and it is empty for videos with no caption. playCount is views or plays, likeCount is likes and shareCount is shares. createdUtc is a UTC epoch timestamp in seconds; multiply by 1000 for a JS Date in milliseconds. url is the canonical tiktok.com URL with tracking query params stripped

found says whether any videos were returned for the hashtag. When found is false, reason is present and is not_found; the contract says this is a successful call, not an error. data can be null, or it can hold items and nextCursor. The items array holds the video records, and each record has required id, url and createdUtc

Some sources round large counts, such as 27.7M instead of 27,712,408. If you need an exact playCount, likeCount, shareCount or commentCount, name the field in requireFields to be served only by a source that returns the exact count. authorFollowers can be rounded by the serving source and is null when the source does not report it

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to list the first 20 recent TikTok videos for the hashtag booktok. Check the current inputs and price of anyapi.tiktok.hashtag_videos before running anything. Call the tool once with hashtag booktok and limit 20. Return a table with authorHandle, text, playCount, likeCount, shareCount, createdUtc, url and the nextCursor value separately. If found is false, return reason not_found and an empty table. Do not fetch a second page unless I ask. Do not invent missing values.

Replace booktok with your own tag, without the # prefix, and keep limit at 20 or lower

Estimated tool cost

The catalog lists anyapi.tiktok.hashtag_videos at up to $0.0066 per call, unit max_call. The catalog explains the unit 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
First page1 call x max price$0.0066 per call1$0.0066
Second page1 call x max price$0.0066 per call1$0.0066
Two-call plan2 calls x max price$0.0066 per call2$0.0132

The one-call plan for the first 20 videos is at most $0.0066. Add a second call only when you need the next page; that plan is at most $0.0132 for two calls. A found: false answer is a successful call, not an error

Next action

Open TikTok hashtag videos and run the first page for your tag. Use booktok only as the example input; replace it with the tag you need, without the # prefix

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 get recent TikTok videos for a hashtag?

Call anyapi.tiktok.hashtag_videos with hashtag set to the tag without the # prefix and limit set to the page size you want. The response returns data.items and a nextCursor inside data for the next page.

What does the hashtag input require?

hashtag is required and must omit the # prefix, so booktok is valid input shape. limit is optional from 1 to 20 and defaults to 20.

What fields should I read to compare creators?

Read authorHandle, text, playCount, likeCount, shareCount, createdUtc and url for each video. createdUtc is a UTC epoch timestamp in seconds.

What happens when no videos are found?

The response sets found to false and includes reason as not_found. The contract says a found: false answer is a successful call, not an error.

How do I get more than 20 videos?

The contract caps limit at 20 per call, so pass data.nextCursor back as cursor for the next page. If you name requireFields, it applies to the first page only.

Does requireFields change the price?

It can. When the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. Naming a combination that no single source returns together is refused as invalid input, with no charge.

How much does the first page cost?

The catalog lists up to $0.0066 per call for anyapi.tiktok.hashtag_videos, so one call is at most $0.0066 and two calls are at most $0.0132. Successful runs settle at the actual AnyAPI charge.

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