youtube

Search › Advanced

Returns video search results with the full filter set: sort order, length, live status, license, category, country, language, and publish date window.

Use it when a plain keyword search is too blunt; results are always videos, so use search when you also want channels or playlists back.

Metered: 10–110 credits. We reserve the ceiling when the call starts and charge what it actually used when it finishes.

Paginates by cursor: see Pagination.

get/v1/youtube/search/advanced

Request

  • Base URL: https://api.insightsocial.app
  • URL: https://api.insightsocial.app/v1/youtube/search/advanced
  • Auth: API key in header x-api-key

Query parameters

querystring required
Example:lofi hip hop

Search query.

orderstring

Sort order: date, rating, relevance (default), title, videoCount, viewCount. order=date is exact (measured: zero inversions against the timestamps). order=viewCount is YouTube's popularity-weighted ranking: the top result is the true maximum but mid-list order is approximate, so for exact ranking add includeExtras=true and sort the page on engagement.views client-side. Both are far more faithful than /v1/youtube/search's sortBy=popular, which is not view-ordered at all.

durationstring
Example:long

Video length: short (<4m), medium (4-20m), long (>20m), any. Genuinely applied (unlike /v1/youtube/search's duration, which the platform ignores). short plus a client-side post.content.duration_seconds <= 180 filter is the documented Shorts approximation: see the endpoint description for why it is an approximation and not a Shorts filter.

event_typestring

Broadcast type: live, upcoming, completed.

licensestring

License filter: creativeCommon, youtube, any.

categorystring

YouTube video category id (e.g. 10 = Music).

regionstring

ISO 3166-1 alpha-2 country code.

languagestring

Preferred result language (ISO 639-1).

published_afterstring

RFC-3339 datetime lower bound (e.g. 2026-01-01T00:00:00Z). Exact and genuinely applied. This is the endpoint to use for date-window work.

published_beforestring

RFC-3339 datetime upper bound. Exact and genuinely applied.

channel_idstring

Restrict results to a single channel id.

max_resultsinteger

Maximum number of videos to return (1-50). Honored exactly: a page of 50 returns 50.

cursorstring

Pagination cursor from a previous response: fetches the next page.

safe_searchstring

Safe-search filter: none, moderate, strict.

video_captionstring

Caption filter: any, closedCaption, none.

video_definitionstring

Quality filter: any, high, standard.

video_dimensionstring

Dimension filter: 2d, 3d, any.

video_embeddablestring

Restrict to embeddable videos: true, any.

video_typestring

Type filter: any, episode, movie.

topic_idstring

Restrict to a Freebase topic id (e.g. /m/04rlf for music).

locationstring

Latitude,longitude center for a geo search (e.g. 37.42307,-122.08427). Must be used together with location_radius.

location_radiusstring

Radius around location with a unit suffix (e.g. 50km, 10mi). Must be used together with location.

includeExtrasstring

Set to true to add the view, like and comment counts (post.engagement.views / .likes / .comments) and the video length (post.content.duration_seconds) to every result. Left off, those four are null. YouTube's search index returns snippets only, so the counts come from a second lookup.

include'channel'

Set to channel (one token only) to add each row's channel stats in this one call. 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. Each join adds 0.2 to 0.7 seconds on a fresh page (one lookup per 50 ids, never more than 8 seconds).

sincestring

Only 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.

untilstring

Only 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_viewsinteger

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_daysinteger

Keep only rows published within this many days (post.published_at), 1 to 3650. A row with no date is discarded.

sort_rows'views'

views: return the kept rows ordered by view count, highest first, across every page walked. Rows without a view count go last.

max_pagesinteger

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.

dry_run'1'

Set to 1 to get the price of this call without making it: data.dry_run carries credits_min and credits_max. Nothing is charged.

Response

Success.

successtrue required
platformstring required
endpointstring required
schema_version'2' required
unavailablestring[] required
credits_usedinteger required
credits_remaininginteger required
request_idstring required
cachedboolean required
idempotent_replayboolean required
charge_reasonstring required
free_callboolean required

Changes

No recorded changes to this operation across all 1 revision of this API.