InsightSocial
GET /v1/youtube/search

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

curl "https://api.insightsocial.app/v1/youtube/search?query=javascript+tutorial" \
-H "x-api-key: $INSIGHTSOCIAL_API_KEY"
200 OKJSON
{
"success": true,
"platform": "youtube",
"endpoint": "/v1/youtube/search",
"schema_version": "2",
"data": {
"items": [
{
"post": {
"id": "<string>",
"url": "<string | null>",
"kind": "<string | null>",
"content": {
"text": "<string | null>",
"media_urls": "<array | null>",
"thumbnail_url": "<string | null>",
"duration_seconds": "<number | null>"
},
"author": {
"id": "<string | null>",
"username": "<string | null>",
"display_name": "<string | null>",
"avatar_url": "<string | null>",
"verified": "<boolean | null>"
},
"engagement": {
"views": "<integer | null>",
"likes": "<integer | null>",
"comments": "<integer | null>",
"shares": "<integer | null>",
"saves": "<integer | null>"
},
"flags": {
"nsfw": "<boolean | null>",
"spoiler": "<boolean | null>",
"pinned": "<boolean | null>",
"deleted": "<boolean>",
"likes_hidden": "<boolean | null>",
"comments_hidden": "<boolean | null>",
"shares_hidden": "<boolean | null>",
"views_hidden": "<boolean | null>",
"saves_hidden": "<boolean | null>"
},
"published_at": "<string | null>",
"language": "<string | null>",
"ext": "<object | null>"
}
}
]
},
"pagination": {
"next_cursor": "<string | null>",
"has_more": "<boolean>"
},
"unavailable": [],
"credits_used": "<integer>"
}

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.

NameRequiredDescription
queryYesSearch keyword or phrase.
uploadDateNoUpload 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.
sortByNoSort 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.
typeNoType of content to return. type=channels returns one page of about 20 channels, with has_more: false and no next_cursor, because the platform cannot continue a channel search (measured 25/10/2026); videos, shorts and playlists page normally. NOTE on Shorts results (type=shorts, and the Shorts an untyped search mixes in): the Shorts shelf item carries no channel object (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.
durationNoVideo 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.
regionNoTwo-letter country code that localises the results, such as US or GB.
includeExtrasNoSet 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.
includeNoSet 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. It also adds the country the channel's owner set, as an ISO 3166-1 alpha-2 code on post.ext.author_country (null when the channel sets none). 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_datesNoExact publish dates are on by default and free. Set to false to skip the lookup: rows then carry YouTube's own date estimate (a day-granular or coarser label truncated to midnight UTC), marked by post.ext.published_precision and post.ext.published_label, and the listing title, marked by post.ext.title_maybe_translated.
sinceNoOnly rows published on or after this date: YYYY-MM-DD (midnight UTC) or an ISO 8601 timestamp. Rows older than it are left off each page. This list is not in date order, so the walk does not stop at the date: keep following next_cursor, and each page costs what a page costs even when every row on it is filtered out. A row with no date is kept.
untilNoOnly rows published on or before this date: YYYY-MM-DD (that whole UTC day is included) or an ISO 8601 timestamp. Newer rows are left off each page and the walk does not stop, so older pages follow. A row with no date is kept.
min_viewsNoKeep 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_daysNoKeep only rows published within this many days (post.published_at), 1 to 3650. A row with no date is discarded.
sort_rowsNoviews: orders the kept rows by view count, highest first. Rows without a view count go last. newest: orders the kept rows by publish date, newest first. Rows without a date go last. The sort covers only the rows this call collected over the pages it walked, not the whole feed. Every collected row is returned. A call that resumes from pagination.next_cursor sorts its own rows and does not merge them with the earlier ones.
max_pagesNo1 to 50 (default 1). Walk up to this many pages in one call and return the rows from all of them (after any filter).
max_age_sNoThe oldest cached copy you accept, in seconds. A copy that old or younger is served, with its age in age_s and the X-Cache-Age header. Without it a copy up to 120 seconds old is served. A lower value fetches fresh (billed) when the copy is older, and 0 always fetches live, like Cache-Control: no-cache.
cursorNoThe pagination.next_cursor from the previous page, sent back unchanged. Omit it for the first page.

Response fields

The same unified schema every typed endpoint returns, so code written for YouTube reads the other platforms too. A field the platform did not provide is null and listed in unavailable.

FieldTypeNotes
idstringAn identifier, always a string. Never parse it as a number: several platforms use ids above 2^53.
urlstring | null
kindstring | nullThe format of the post. Format words only, never a platform name. short = short-form vertical video (a reel, a TikTok, a YouTube Short).
content.textstring | null
content.media_urlsarray | null
content.thumbnail_urlstring | null
content.duration_secondsnumber | null
author.idstring | null
author.usernamestring | null
author.display_namestring | null
author.avatar_urlstring | null
author.verifiedboolean | null
engagement.viewsinteger | nullA count. null when the platform does not expose it; 0 only when it is really zero.
engagement.likesinteger | nullA count. null when the platform does not expose it; 0 only when it is really zero.
engagement.commentsinteger | nullA count. null when the platform does not expose it; 0 only when it is really zero.
engagement.sharesinteger | nullA count. null when the platform does not expose it; 0 only when it is really zero.
engagement.savesinteger | nullA count. null when the platform does not expose it; 0 only when it is really zero.
flags.nsfwboolean | null
flags.spoilerboolean | null
flags.pinnedboolean | null
flags.deletedboolean
flags.likes_hiddenboolean | null
flags.comments_hiddenboolean | null
flags.shares_hiddenboolean | null
flags.views_hiddenboolean | null
flags.saves_hiddenboolean | null
published_atstring | nullISO-8601 timestamp in UTC, ending in Z.
languagestring | nullThe content's language as the platform states it, e.g. en, pt-BR. Detected languages come later (§7.1).
extobject | nullPlatform-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.