How to pull YouTube search results by keyword with DataForSEO
Get up to 20 live YouTube search results for a keyword, including rank, channel, views, publication date and duration, in one DataForSEO call
On this page
You have 15 tutorial keywords to evaluate before pitching a video series, and you need to see which videos YouTube ranks for each one. One call per keyword returns up to 20 videos with title, channel, views, publication date and duration, and reading rank against views and age is what turns the raw list into a content-gap shortlist
Example input and the shortlist worksheet
Example keyword: beginner sourdough tutorial. Swap in a keyword from your own content list before you run anything
| Field | Example value |
|---|---|
keyword | beginner sourdough tutorial |
language_code | en (default) |
location_code | 2840, the United States (default) |
The deliverable is one table with a row per video: keyword, rank, title, channelName, views, publicationDate, duration, isShorts, url, plus a shortlist note you add after the run. Values here are placeholders showing the shape
| keyword | rank | title | channelName | views | publicationDate | duration | isShorts | url | note |
|---|---|---|---|---|---|---|---|---|---|
| beginner sourdough tutorial | 1 | (video title) | (channel name) | 0 | 3 years ago | 12:04 | false | (video url) | gap or crowded |
With 15 keywords and at most 20 videos per call, the table tops out at 300 rows. Keep the note column outside the agent prompt so the agent output stays a straight copy of the response and the judgment sits with you
What the call takes
keyword is the required field, 1 to 700 characters. language_code defaults to en and takes codes shaped like en or zh-TW. location_code is a DataForSEO location code as an integer, and 2840 is the United States. Set language and location to match the market you are pitching for, or leave the defaults for an English-language US audience
Both optional fields carry a default in the contract, so omitting one is not an error; the value is filled in for you. The response echoes what was used in keyword, languageCode and locationCode, which is the check that you queried the market you meant. Check the current input schema before a run rather than trusting this list as the whole surface
How to read the response
The envelope returns keyword, languageCode, locationCode, checkedAt, totalResults and videos. totalResults is an integer or null, and checkedAt is a string or null. Each item in videos carries 16 fields, and each field is typed nullable, so plan for empty cells rather than treating a null as a failed call
Sort on rank. title, url and videoId identify the video, while channelName, channelId and channelUrl identify who holds the position. views is an integer count or null. publicationDate is the relative date as YouTube shows it, such as 3 years ago, and publishedAt sits beside it as a separate string field that can be null. duration is a display string and durationSeconds is the same length in whole seconds. isShorts and isLive are booleans, badges is an array of up to 50 strings or null, and description is a string or null
The decision rule is yours, but it needs three of those fields: rank, views and publicationDate. A keyword whose top positions are held by old, low-view videos is the gap you are hunting. A keyword whose top positions are held by recent videos with heavy view counts is the crowded one. Write one word per keyword into your note column and leave the response untouched
Build your plan around one limit: videos caps at 20 items per call. No paging field appears in the documented inputs, so a keyword that ranks more than 20 videos gives you 20 results and no second page from this tool. If a keyword needs more depth, run a narrower variant of it as a separate call and treat the two result sets as separate groups
The agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to pull YouTube
search results for the 15 tutorial keywords below. Check the current
inputs and price of dataforseo.serp.youtube_organic before running
anything. Call the tool once per keyword. Leave language_code at en and
location_code at 2840 unless a keyword targets another market.
Return one table, one row per video, sorted by keyword and then by rank,
with these columns: keyword, rank, title, channelName, views,
publicationDate, duration, isShorts, url. Keep a null field as an empty
cell. Do not fill gaps, do not reorder the ranks and do not add a
shortlist note.
Keywords:
beginner sourdough tutorial
(replace this line with the other 14 keywords from your list)Replace the keyword lines with your own and keep the list to 15 for the first pass. Ask for the table in the shape you designed, with nulls preserved as empty cells
Estimated tool cost
The price was read through the Purrkey catalog on November 22, 2026, under priceRevision dataforseo-receipt-2026-11-17. The tool runs as POST /v1/runs and its unit is max_call: "Maximum per call. Successful runs settle at DataForSEO's actual charge, with no markup." Totals below are ceilings
| Step | Formula | Unit price | Planned quantity | Total |
|---|---|---|---|---|
| 15 keyword checks | 15 calls x max price | up to $0.004 per call | 15 | $0.06 |
| 50 keyword checks | 50 calls x max price | up to $0.004 per call | 50 | $0.20 |
Model fees for the agent are not counted, and a null field in the response does not change the call count
Run the first keyword
Send one keyword before you send fifteen. The response shape tells you whether the table needs adjusting, and the 14 remaining calls cost at most $0.056. The tool page is YouTube organic search. For the Google counterpart, the guide is pull live Google SERP data
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 DataForSEO.FAQ
How do I get YouTube search results for a keyword with DataForSEO?
Call dataforseo.serp.youtube_organic once per keyword, with the keyword in the keyword field. The response returns up to 20 videos with rank, title, channel, views, publication date and duration.
What inputs does dataforseo.serp.youtube_organic take?
keyword is required, language_code defaults to en and location_code defaults to 2840, the United States. Check the current input schema before a run rather than trusting this guide as the whole surface.
How many videos come back per call?
At most 20. The videos array caps at 20 items, and no paging field appears in the documented inputs.
What is the difference between publicationDate and publishedAt?
publicationDate is the relative date as YouTube shows it, such as 3 years ago. publishedAt sits beside it as a separate string field that can be null.
How much do 15 YouTube keyword checks cost?
At most $0.06, at the ceiling of $0.004 per call. Successful runs settle at DataForSEO's actual charge, with no markup.
Can one call return more than 20 videos for a broad keyword?
No. The videos array is capped at 20 items per call, so a second page of the same keyword is not available from this tool.
Who writes the shortlist note column?
You do, after the run. The agent returns rank, views and publication date as they came back, and the gap or crowded judgment sits outside the prompt.
Next step
Try this with DataForSEO
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.