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.
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
Search query or keywords (min 2 characters).
Max items to return (default 20, max 200). Flat 2 credits per call.
Pagination cursor. Leave empty for the first page; then pass the nextCursor value returned in the previous response.
all | videos | shorts | channels | playlists.
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.
any | today | this_week | this_month | this_year.
any | under_4 | 4_20 | over_20. Applies to long-form videos (not Shorts).
ISO country code for localized results (default US).
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.
Changes
No recorded changes to this operation across all 3 revisions of this API.