YouTube Search API
Returns YouTube search results for a keyword: videos, channels, playlists, shorts, and live streams, each with title, thumbnail, views, and channel.
10–150 credits, metered · cursor pagination · failed calls free · 10 free calls to start
curl "https://api.insightsocial.app/v1/youtube/search?query=javascript+tutorial" \-H "x-api-key: $INSIGHTSOCIAL_API_KEY"
When to use it
Use it for a general keyword search across every content kind; search/advanced returns videos only but adds date, license, and country filters.
Parameters
Query parameters for GET /v1/youtube/search. Send your key in the x-api-key header.
| Name | Required | Description |
|---|---|---|
| query | Yes | Search keyword or phrase. |
| uploadDate | No | Upload date filter. Reliable on its own (no type). With type=shorts, windows narrower than this_year are rejected with a 400 because YouTube returns an empty set for them; this_year is accepted but measured to return ~5x fewer unique Shorts across a paginated walk (the platform re-serves the same items under an advancing continuationToken), so the recommended pattern for Shorts recency is no uploadDate at all plus includeExtras=true and a client-side filter on post.published_at. With other type values the platform currently ignores the date filter and may mix content kinds; filter client-side there too. For an EXACT date window rather than these coarse buckets, use /v1/youtube/search/advanced, whose published_after/published_before take RFC-3339 bounds and are genuinely applied. |
| sortBy | No | Sort order: relevance or popular. popular cannot be combined with type=shorts (rejected with a 400. YouTube serves that combination unreliably); it also caps the page at ~20 results. It is also NOT a strict view-count sort: popular is a popularity-weighted ranking, and results do not come back in descending view order. Measured on 4 of 4 test keywords: a new york search returned 9.5M, then 502.9M, then 66K views in that order. If you need a view-faithful ordering, use /v1/youtube/search/advanced with order=viewCount and includeExtras=true: its ranking leads with the true top results, and the returned engagement.views lets you sort the page exactly client-side. |
| type | No | Type of content to return. NOTE on Shorts results (type=shorts, and the Shorts an untyped search mixes in): the Shorts shelf item carries NO channel object source (0 of 98 items across 3 keywords on 10/08/2026, 25 of 25 without one on 26/09/2026, raw source; includeExtras=true does not add it). By default the free per-video lookup that supplies the exact date also fills author.id and post.author.display_name on those rows, at no extra credit. post.author.username (the @handle) and post.author.avatar_url stay null on them: send include=engagement,channel to fill both and the subscriber count. With exact_dates=false no lookup runs and the whole author stays null on Shorts. Video results are unaffected (20/20 carry the full author). /v1/youtube/search/advanced also carries channel_id on every result, though it has no Shorts filter. |
| duration | No | Video duration filter. Known issue: currently not applied by the platform and it can degrade the type filter; prefer filtering client-side on post.content.duration_seconds. |
| region | No | 2-letter country code of the country to put the proxy in. |
| includeExtras | No | Set to true to add the like count and comment count (post.engagement.likes / .comments) and the video description (post.ext.description) to each video result. Left off, those three are null. Dates do not need it: post.published_at is exact by default either way (see exact_dates). For Shorts results it additionally supplies post.content.duration_seconds, which those items never carry otherwise. It does NOT add channel identity to Shorts results (see type) and it never adds a subscriber count. For both, send include=engagement,channel instead: the video join supplies every row's channel id, and the channel join adds the subscriber count, in this same call. For full per-video details use /v1/youtube/video. |
| include | No | Set to engagement, channel, or both (engagement,channel) to fill more of every row in this one call. engagement fills post.engagement.views, .likes and .comments, post.content.duration_seconds, author.id and post.author.display_name where the row lacks them, and replaces a date derived from a label such as "4 months ago" with the exact publish time (removing post.ext.published_precision). channel puts the channel's subscriber count on post.ext.author_followers (YouTube's own figure, which it rounds to three significant figures above 1,000) and fills the channel's post.author.display_name, .avatar_url and .username where missing. Send both to cover rows that arrive without a channel id: the video join supplies it and the channel join then uses it. Channel and playlist result rows are not videos: the video join skips them. Each join adds 0.2 to 0.7 seconds on a fresh page (one lookup per 50 ids, never more than 8 seconds). |
| exact_dates | No | Exact publish dates are on by default and free. Set to false to skip the lookup: those rows then carry the supplier's estimate (a day-granular or coarser label truncated to midnight UTC), marked by post.ext.published_precision and post.ext.published_label. |
| min_views | No | Keep only rows with at least this many views (post.engagement.views). A row whose view count is unknown is discarded, so every returned row meets the floor. |
| max_age_days | No | Keep only rows published within this many days (post.published_at), 1 to 3650. A row with no date is discarded. |
| sort_rows | No | views: return the kept rows ordered by view count, highest first, across every page walked. Rows without a view count go last. |
| max_pages | No | 1 to 5 (default 1). Walk up to this many pages in one call and return the rows from all of them (after any filter). Each page walked is billed as one call to this endpoint; the whole walk counts once against your rate limit. |
| cursor | No | The pagination.next_cursor from the previous page, sent back unchanged. Omit it for the first page. |
Response fields
The same unified schema every platform returns, so code written for YouTube works on the other eight. A field the platform did not provide is null and listed in unavailable.
| Field | Type | Notes |
|---|---|---|
| id | string | An identifier, always a string. Never parse it as a number: several platforms use ids above 2^53. |
| url | string | null | |
| kind | string | null | The format of the post. Format words only, never a platform name. short = short-form vertical video (a reel, a TikTok, a YouTube Short). |
| content.text | string | null | |
| content.media_urls | array | null | |
| content.thumbnail_url | string | null | |
| content.duration_seconds | number | null | |
| author.id | string | null | |
| author.username | string | null | |
| author.display_name | string | null | |
| author.avatar_url | string | null | |
| author.verified | boolean | null | |
| engagement.views | integer | null | A count. null when the platform does not expose it; 0 only when it is really zero. |
| engagement.likes | integer | null | A count. null when the platform does not expose it; 0 only when it is really zero. |
| engagement.comments | integer | null | A count. null when the platform does not expose it; 0 only when it is really zero. |
| engagement.shares | integer | null | A count. null when the platform does not expose it; 0 only when it is really zero. |
| engagement.saves | integer | null | A count. null when the platform does not expose it; 0 only when it is really zero. |
| flags.nsfw | boolean | null | |
| flags.spoiler | boolean | null | |
| flags.pinned | boolean | null | |
| flags.deleted | boolean | |
| flags.likes_hidden | boolean | null | |
| flags.comments_hidden | boolean | null | |
| flags.shares_hidden | boolean | null | |
| flags.views_hidden | boolean | null | |
| flags.saves_hidden | boolean | null | |
| published_at | string | null | ISO-8601 timestamp in UTC, ending in Z. |
| language | string | null | The content's language as the platform states it, e.g. en, pt-BR. Detected languages come later (§7.1). |
| ext | object | null | Platform-specific fields, snake_case. |
Every field, error and example is in the YouTube Search API reference.
How much does the YouTube Search API cost?
Metered: 10–150 credits a call. The ceiling is reserved when the call starts and you are charged what it actually read.
Failed calls are free
A call that errors or finds nothing costs 0 credits.
Know the price first
Add dry_run=1 and the response quotes the call without making it. Nothing is charged.
One balance
API calls and Chrome extension exports share the same credits, on the free plan too.
YouTube Search API: frequently asked questions
Send GET /v1/youtube/search with the query parameter and your key in the x-api-key header. Returns YouTube search results for a keyword: videos, channels, playlists, shorts, and live streams, each with title, thumbnail, views, and channel.
Metered: 10–150 credits a call. The ceiling is reserved when the call starts and you are charged what it actually read. A call that errors or finds nothing costs 0 credits, and an answer from the shared cache costs 2. Pro's 10,000 monthly credits cover about 1,000 calls at 10 credits each. Add dry_run=1 to see the price of a call without making it.
No. There is no YouTube app, OAuth flow or app review. One InsightSocial API key works for this endpoint and every other platform, and your first 10 calls priced at 100 credits or less are free.
This endpoint pages. Each response carries pagination.next_cursor and pagination.has_more. Send next_cursor back unchanged as the cursor parameter and stop when has_more is false. Every page is a separate call and is charged as one.
You get an error or an empty result, and it costs 0 credits. The API reads public YouTube data only, so private accounts and deleted content come back as not found rather than as partial data.
Yes. Add the hosted MCP server at https://api.insightsocial.app/mcp to your AI app and sign in. The assistant finds this endpoint by name, shows its price and calls it with your credits.
Recipes that use this endpoint
More YouTube endpoints
- YouTube Search Hashtag API10–110 credits
- YouTube Search Advanced API10–110 credits
- YouTube Search Suggestions API10 credits
- YouTube Channel API10 credits
- YouTube Channel About API250 credits
- YouTube Channel Videos API10–20 credits
- YouTube Video API10 credits
- YouTube Video Sponsors API100 credits
- YouTube Video Comments API10 credits
- YouTube Video Comment Replies API10 credits
- YouTube Channel Shorts API10–20 credits
- YouTube Community Post API10 credits