Skip to main content
Glama

youtube_search: GET /

hasdata_youtube_search_getYoutubeSearchResults

Search YouTube for a query and retrieve structured results: videos, channels, Shorts, ads, and shelves. Supports competitor monitoring, trend research, brand tracking, and ad-placement intelligence.

Instructions

Get YouTube Search Results

Searches YouTube for a query and returns the full results page split into videoResults (videoId, title, views, length, publish date, chapters, channel info, extensions like 4K/CC), channelResults (channelId, handle, subscribers, verified flag), shortsResults / inlineShortsResults, themed shelves (e.g. 'People also watched', 'Latest from '), adsResults and sponsoredResults (advertiser, landing URL, position), plus searchInformation.totalResults. Each block preserves its positionOnPage so the original layout is reconstructable. Use for competitor and topic monitoring, brand-mention tracking, ad-placement intelligence, creator discovery, trend research, or to feed videoId / channelId into the YouTube Video, Channel, or Transcript endpoints.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesFree-text search query, exactly as a user would type it into the YouTube search box.
glNoThe two-letter country code for the country you want to limit the search to. Provide one exact documented value (245 allowed), e.g. `ac`, `af`.
hlNoThe two-letter language code for the language you want to use for the search. Provide one exact documented value (159 allowed), e.g. `af`, `ak`.
spNoRaw YouTube `sp` filter token, copied verbatim from a YouTube search URL (e.g. `EgIQAQ%253D%253D`). When provided, it overrides `sortBy`, `date`, `videoType`, `length`, and `filters[]`. Use only if you need a YouTube-side filter that this API does not expose as a structured parameter.
dateNoLimit results to videos uploaded within this time window relative to now.
lengthNoFilter by video duration bucket: - `under4` — under 4 minutes - `between420` — 4 to 20 minutes - `plus20` — over 20 minutes
sortByNoSort order applied to the results page. `relevance` (default) — best match for the query; `date` — newest first; `views` — most viewed first; `rating` — highest rated first; `popularity` — trending/most popular.
filters__NoFeature flags to require on results. Multiple values are combined with AND (every flag must apply). - `hd` — HD quality - `k4` — 4K quality - `hdr` — HDR - `subtitles` — has subtitles/closed captions - `cc` — Creative Commons license - `d3` — 3D video - `d360` — 360° video - `vr180` — VR180 video - `live` — currently live - `bought` — purchased/paid content - `location` — has a geographic location tag
videoTypeNoRestrict results to a single YouTube content type — regular videos, Shorts, channels, playlists, or movies.
deviceTypeNoDevice type for the request.
paginationTokenNoToken returned in the previous response to fetch the next page.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden — and it delivers. It discloses that the tool returns the complete results page split into distinct blocks (videoResults, channelResults, shorts, shelves, ads), includes advertising/sponsored content, and preserves positionOnPage for layout reconstruction. This is meaningful behavioral context beyond a generic "search" claim. It does not mention rate limits or auth requirements, but the return-structure and composition disclosures are the most decision-relevant behaviors for a search endpoint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but every sentence earns its place: the core purpose comes first, followed by a dense but necessary enumeration of return blocks and their distinguishing fields, then a targeted use-case sentence. The block listing is justified because there is no output schema to carry that information. Minor redundancy ('Get YouTube Search Results' repeated as title) keeps it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description shoulders the return-value burden — and it does so thoroughly, naming each result category and key fields (views, position, advertiser, subscribers, verified flag). Combined with 100% schema description coverage for the 11 parameters, an agent has everything needed to select and invoke this tool correctly. The only gaps are operational details such as rate limits, which are not covered by annotations either.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the schema itself is exceptionally detailed (per-enum explanations for length, sortBy, filters__, raw sp-token override semantics). The description adds minimal parameter instruction beyond the schema — its only param-adjacent contribution is the hint about feeding returned videoId/channelId into sibling endpoints. Per the baseline rule, 3 is correct when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource pair — "Searches YouTube for a query" — and precisely scopes the tool as returning the full results page. It differentiates from sibling tools (channel, transcript, video endpoints) by defining this as the search/entry point that produces results blocks. An agent can immediately recognize what this tool does and what it is not.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit use cases — "competitor and topic monitoring, brand-mention tracking, ad-placement intelligence, creator discovery, trend research" — and even tells the agent what to do afterward: "feed videoId / channelId into the YouTube Video, Channel, or Transcript endpoints." This directly routes the agent between siblings, stating when this tool is the right choice and when to move on.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HasData/youtube-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server