Social media5 min readBy Purrkey teamUpdated

How to search YouTube Shorts by keyword

Get a paginated table of YouTube Shorts matching a keyword with title, id, views, viewsAvailable, and url. The guide shows the input fields, pagination step and a cost ceiling for one search or three pages

On this page

You need 20 YouTube Shorts about a product keyword to compare title hooks and view counts. A single call to anyapi.youtube.search_shorts returns a page of matching Shorts with title, views and URL, and cursor pagination lets you collect more pages. No run has been executed for this guide; the worksheet below is a design

The deliverable is a table you can sort and annotate, with one row per Short and a notes column for the hook angle you want to test:

titleidviewsviewsAvailableurlhook note
(placeholder)(placeholder)(placeholder integer)true or false(placeholder URL)(placeholder)

Values here are placeholders showing the shape. Leave hook note blank until you have read the title; the column is for your own label, not an output field

Example input and fields

Example keyword: home espresso. Replace it with the product keyword you are researching. The required input is query, the keyword to search Shorts for

Optional fields shape the search. sortBy defaults to relevance and can be set to popular for most-viewed results. uploadDate accepts today, this_week, this_month or this_year; omit it for any time. cursor is the continuation token from a previous response, passed back as data.nextCursor. Agents call it through POST /v1/runs with toolId anyapi.youtube.search_shorts

A recency filter is useful when you want current title hooks rather than older examples. The enum lists four windows, and the contract does not list a custom date range. Example: query set to home espresso, uploadDate set to this_month, and sortBy left at relevance. For a 20-row target, start with one page and check how many rows come back before you plan more calls

How to read the response

The response has found and data. When found is true, data.shorts is an array of rows; each row has id, url, title, views, viewsAvailable and contentType. The decision fields are title for hook comparison, views for scale, viewsAvailable for whether the view count is measured, and id or url to open the Short

Read viewsAvailable before you trust a zero. The contract says views is 0 when the source did not publish a count, and viewsAvailable is false when that zero is a placeholder rather than a measured zero. Counts of 1,000 or more are rounded as YouTube shows them on Shorts, such as 8.9M or 875K, so treat large counts as approximate. A zero with viewsAvailable true is a measured zero; a zero with false is a placeholder. Use the boolean, not the number alone, when you rank rows

Pagination limit: data.nextCursor is an opaque cursor for the next page, or null when there are no more. To continue, pass data.nextCursor back as cursor in the next call. Stop when it is null or when you have 20 rows. If a page returns fewer than 20 rows and data.nextCursor is null, stop with fewer rows. Do not repeat the same cursor

If found is false, reason is not_found and there is no result. The contract says a found: false answer is a successful call, not an error, and costUsd is what it actually cost. Keep the query and recency filter fixed across pages when you compare hooks; otherwise a title difference may come from a different window. For channel checks after you pick a Short, see check YouTube channel stats and links

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to search YouTube Shorts for the keyword "home espresso" with uploadDate this_month. Check the current inputs and price of anyapi.youtube.search_shorts before running. Return a table with title, id, views, viewsAvailable and url. Collect 20 rows, passing data.nextCursor back as cursor for another page when needed, and stop when you have 20 rows or data.nextCursor is null. If found is false, return an empty table and the reason. Do not invent views or Short URLs. Example keyword: replace "home espresso" with the product keyword you need.

Replace the example keyword in the prompt with your own before the run. The prompt asks for 20 rows, so the agent may need more than one call. The contract does not state rows per page, so the call count is not fixed in advance

Estimated tool cost

Prices read through the Purrkey catalog on November 13, 2026. The tool is listed as max_call: "Maximum per call. Successful runs settle at the actual AnyAPI charge." The table below is a ceiling

StepFormulaUnit pricePlanned quantityTotal
Single pagecalls x max price$0.0012 per call1 call$0.0012
Three pagescalls x max price$0.0012 per call3 calls$0.0036

The three-page plan is a ceiling for three calls, not a row count. Model fees for the agent are not counted

Next action

Open the tool page to run the search with your keyword: YouTube search_shorts

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

FAQ

How do I search YouTube Shorts by keyword?

Call anyapi.youtube.search_shorts with a required query, then read data.shorts for title, views, viewsAvailable and url. Pass data.nextCursor back as cursor when you need another page.

What inputs does anyapi.youtube.search_shorts take?

It takes a required query plus optional cursor, sortBy and uploadDate. sortBy accepts relevance or popular, and uploadDate accepts today, this_week, this_month or this_year.

How do I get more Shorts after the first page?

Pass data.nextCursor back as cursor in the next call. Stop when data.nextCursor is null.

What does viewsAvailable mean?

It is false when the source published no view count, so views is a placeholder rather than a measured zero. Read it before you use views in a comparison.

How much does it cost to search YouTube Shorts?

The listed max_call price is up to $0.0012 per call. The guide plans $0.0012 for one call and $0.0036 for three calls, and successful runs settle at the actual AnyAPI charge.

What happens when no Shorts match the keyword?

The response can return found false with reason not_found and no result. The contract says that answer is a successful call, not an error.

Can I sort YouTube Shorts by popularity?

Yes. Set sortBy to popular for most-viewed results; the default is relevance.

Next step

Try this with YouTube

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

Share this article