Social media5 min readBy Purrkey teamUpdated

How to search Douyin videos by keyword

Get a normalized first page of public Douyin videos matching a keyword, with sort and content filters for quick trend checks

On this page

You have one keyword, robot vacuum, and need a first page of public Douyin videos to decide which creators or themes to monitor. The deliverable is a shortlist table built from that first page. No run has been executed for this guide, so the table and its values are a design, not a result

Build the shortlist from the first page

Example keyword: robot vacuum. The table columns mirror the contract output plus a shortlist flag you add. Values here are placeholders showing the shape

captionauthorNicknamecreatedUtcviewslikescommentssharesurlshortlist
(caption text)(author display name)(Unix seconds)(count)(count)(count)(count)(canonical video URL)yes or no

Use caption and authorNickname to group rows by theme and creator. Use createdUtc as the publish time. The contract defines it as a UTC epoch timestamp in seconds, and says to multiply by 1000 for a JS Date in milliseconds. The engagement counts views, likes, comments, and shares fill the numeric columns. url gives the canonical video link. The shortlist flag is your decision from those fields, and you can set the cutoff after you see the first page

anyapi.douyin.search_videos takes query as required and uses it for the keyword. sort defaults to relevance, which the contract describes as Douyin's comprehensive ranking. The other sort values are most-liked and date-posted. publishedWithin accepts 0 for any time, 1 for one day, 7 for seven days, or 180 for 180 days. duration accepts 0 for any, 0-1 for under 1 minute, 1-5 for 1 to 5 minutes, or 5-10000 for over 5 minutes. The contract lists these input fields; use the current tool schema to confirm them before a run

For a first-page trend check, set query to your keyword, sort to relevance, publishedWithin to 0, and duration to 0 unless the job needs a tighter window. The contract also lists cursor, searchId, and backtrace for pagination. Pagination is the limit in this step: to request another page, pass the previous response's nextCursor as cursor plus the same searchId and backtrace. A first-page check does not need those fields

Read the output fields that drive the shortlist

The response has found and data. found is true when matching videos were found. When found is false, data is null and reason is not_found. The contract says a found: false answer is a successful call, not an error. When found is true, data.videos holds the normalized matching videos. data.hasMore says whether another page is available. data.nextCursor, data.searchId, and data.backtrace are the pagination values for that page

Use createdUtc to order rows by publish time and use views, likes, comments, and shares to compare engagement. The contract does not set a shortlist threshold, so choose one for the job and keep it beside the table. caption and authorNickname are the text fields that show the theme and the creator. url is the canonical video URL for the row. If data is null, record the keyword as no result and move on. If you need a playable link, the contract lists videoUrl and says its query string carries required access parameters, so keep it intact

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to search public Douyin videos for the Example keyword robot vacuum. Check the current inputs and price of anyapi.douyin.search_videos before running. Request the first page with query "robot vacuum", sort "relevance", publishedWithin 0, and duration "0". Return a table with caption, authorNickname, createdUtc, views, likes, comments, shares, url, and a shortlist flag. Do not paginate in this first run. Replace the Example keyword with your own keyword.

The prompt keeps the first run to one page. If you need more rows, add the pagination step after the first response and carry nextCursor, searchId, and backtrace forward

Estimated tool cost

The catalog lists anyapi.douyin.search_videos at up to $0.012 per call under unit max_call. max_call means "Maximum per call. Successful runs settle at the actual AnyAPI charge." The table below uses ceilings, not settled charges. Price read through the Purrkey catalog on November 12, 2026

StepFormulaUnit pricePlanned quantityTotal
One keyword first-page checkcalls x max_call$0.012 per call1$0.012
Five keyword first-page checkscalls x max_call$0.012 per call5$0.060

A one-call check covers the first page for one keyword. Five checks cover first pages for five keywords. Model fees for the agent are not counted. The tool is called through POST /v1/runs with toolId anyapi.douyin.search_videos

Run one keyword check next

Open the Douyin video search tool page and run the Example keyword as a single first-page check: Douyin video search. Replace robot vacuum with your own keyword before the run

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 Douyin.
Explore Douyin tools and pricing

FAQ

How do I search Douyin videos by keyword?

Call the Douyin video search tool with the required query field. The response returns a first page of videos in data.videos, plus hasMore, nextCursor, searchId and backtrace.

What inputs does the Douyin video search tool take?

query is required. sort, publishedWithin, and duration are optional filters, and pagination uses cursor with searchId and backtrace from the previous response.

What values can I use for sort, publishedWithin and duration?

sort defaults to relevance and accepts relevance, most-liked, or date-posted. publishedWithin accepts 0, 1, 7, or 180 days. duration accepts 0, 0-1, 1-5, or 5-10000 minutes.

How do I read the output fields for a shortlist?

Use caption, authorNickname, createdUtc, views, likes, comments, shares and url to fill the table. createdUtc is a UTC epoch timestamp in seconds.

How much does a first-page Douyin video search cost?

The catalog lists the Douyin video search tool at up to $0.012 per call. A one-call first-page check is at most $0.012, and five first-page checks are at most $0.060.

What happens when no videos are found?

found is false, data is null, and reason indicates not found. A false result is a successful call, not an error.

Next step

Try this with Douyin

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 Douyin tools

Share this article