Search YouTube for videos on a subject
search_youtubeWhat creators are publishing about a subject, in the order YouTube ranks it: title, channel, exact view count, duration and the description snippet, plus real upload dates, likes and comments when the deployment holds a Data API key (stats: "exact"). Read from the results page rather than the API's 100-unit search, so one key's day holds thousands of these. The answer is cached for thirty minutes, and the same question again costs nothing.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"q": "<q>"
},
"name": "search_youtube"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | What to search for, the way you would type it into YouTube. | |
| sort | No | `relevance` uses YouTube's ranking. `views` puts the most-watched videos first. Combine `views` with `recency` to find popular uploads within that window, not to measure growing views. Without a window, `views` includes all-time hits. | relevance |
| limit | No | Videos to return, 1–20. One page is one read: a larger `limit` on the same question is served from it. | |
| country | No | The country to rank for, ISO 3166-1 alpha-2 (BR, US, ES). Omit it for YouTube's own ranking rather than a country's. | |
| recency | No | Only videos uploaded within the window: `day`, `week`, `month` or `year`. Absent means any time. | |
| refresh | No | Read the page again instead of serving the half-hour cache. Charged like any read, and the fresh answer replaces the cached one. | |
| language | No | The language to ask and read the page in, ISO 639-1 (en, pt, es). Omit it and your `accept-language` header decides. |