YouTube

YouTube Search API

YouTube search with cursor pagination — typed hits, ids, canonical URLs, filters (2 credits/page, 0 when a page finds nothing).

Search YouTube by keyword and get a cursor-paginated page of clean JSON: results[] with type (video|short|channel|playlist|live), id, canonical url, title, publishedTimeApprox + publishedTimeIsApproximate + publishedTimeText, viewCount + viewCountText + viewCountIsApproximate, durationSeconds, thumbnailUrl, channel{id,title,handle,url,thumbnail}, badges[], and subscriberCount on channel hits. Typed arrays videos[] / shorts[] / channels[] / playlists[] / lives[] / shelves[] are disjoint partitions of results (a live is only in lives[], never also in videos[]) — Σ typed === results.length. Filter with type, sortBy, uploadDate, duration, region. Pass nextCursor as cursor for the next page. Flat 2 credits per page; a page with no results costs 0.

Docs: https://captapi.com/apis/youtube-search

get/v1/youtube/search

Request

  • Base URL: https://api.captapi.com
  • URL: https://api.captapi.com/v1/youtube/search
  • Auth: one of:
    • HTTP bearer
    • API key in header X-API-Key

Query parameters

qstring required

Search query or keywords (min 2 characters).

limitinteger

Max items to return (default 20, max 200). Flat 2 credits per call.

cursorstring

Pagination cursor. Leave empty for the first page; then pass the nextCursor value returned in the previous response.

type'all' | 'videos' | 'shorts' | 'channels' | 'playlists' | 'video' | 'channel' | 'playlist' | 'short' | 'movie' | 'movies'

all | videos | shorts | channels | playlists.

sortBy'relevance' | 'date' | 'views' | 'rating' | 'popular'

relevance | views (alias: popular→views). date and rating answer 400 SORT_NOT_SUPPORTED: YouTube no longer orders search by upload date (use uploadDate) or by rating. With type=shorts only relevance is supported.

uploadDate'any' | 'today' | 'this_week' | 'this_month' | 'this_year' | 'hour' | 'week' | 'month' | 'year'

any | today | this_week | this_month | this_year.

duration'any' | 'under_4' | '4_20' | 'over_20' | 'short' | 'medium' | 'long'

any | under_4 | 4_20 | over_20. Applies to long-form videos (not Shorts).

regionstring

ISO country code for localized results (default US).

cacheboolean

Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh.

Response

Success. The data object for this endpoint.

successunknown required

Changes

No recorded changes to this operation across all 3 revisions of this API.