API reference · YouTube

youtube/bulk/search

Integrate this model through SandBase's unified API, with production-ready schemas and examples.

Production endpoint

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

POSThttps://api.sandbase.ai/v1/run
Model IDyoutube/bulk/search
01

Input Schema

29 parameters · 0 required · 29 optional

ParameterTypeRequiredDescription
is3DbooleanOptionalWill apply the 3D filter for search
is4KbooleanOptionalWill apply the 4K filter for search
isHDbooleanOptionalWill apply the HD filter for search
hasCCbooleanOptionalWill apply the Creative Commons filter for search
is360booleanOptionalWill apply the 360 degrees filter for search
isHDRbooleanOptionalWill apply the HDR filter for search
isLivebooleanOptionalWill apply the Live filter for search
isVR180booleanOptionalWill apply the VR180 filter for search
isBoughtbooleanOptionalWill apply the Purchased filter for search
startUrlsarrayOptionalEnter a link to a YouTube video, channel, playlist, hashtag or search results page. You can also import a CSV file or Google Sheet with a list of URLs.Note: Input from Search term will be ignored when using this option. If you only want to scrape shorts/streams, set Maximum search results to 0, otherwise they represented number of regular videos requested
videoTypestringOptionalSelect Youtube video type filter for search · Options: video, movie
videomovie
dateFilterstringOptionalSelect Youtube upload date filter for search · Options: hour, today, week, month, year
hourtodayweekmonthyear
maxResultsintegerOptionalLimit the number of videos you want to crawl. If you scrape a channel, acts as a limit for regular videos. · Min: 0 · Max: 999999 · Default: 0
hasLocationbooleanOptionalWill apply the Location filter for search
hasSubtitlesbooleanOptionalWill apply the Subtitles/CC filter for search
lengthFilterstringOptionalSelect Youtube video length filter for search · Options: under4, between420, plus20
under4between420plus20
sortVideosBystringOptionalMaps to the sorting buttons on the top of the channel's 'Videos', 'Shorts' and 'Live' pages. · Options: NEWEST, POPULAR, OLDEST
NEWESTPOPULAROLDEST
sortingOrderstringOptionalSelect Youtube sorting parameter for search · Options: relevance, rating, date, views
relevanceratingdateviews
saveSubsToKVSbooleanOptionalIf set to true, the scraper will save the downloaded subtitles to the key-value store. Note: Download subtitles must be turned on for this option to work.
searchQueriesarrayOptionalEnter search terms just like you would enter it in YouTube's search bar.
aiVideoSummarybooleanOptionalIf enabled, uses AI to generate a concise conceptual summary of the video covering both visual and audio content. · Default: false
oldestPostDatestringOptionalOnly posts uploaded after or on this date will be scraped. Alternatively, specify how old the scraped videos should be in days. Putting 1 day will get you only today's posts, 2 days - yesterday's and today's, and so on. Note, that if you select this, sorting parameter will be auto-reset to NEWEST
subtitlesFormatstringOptionalSelect in what format you want to download subtitles · Options: srt, vtt, xml, plaintext · Default: "srt"
srtvttxmlplaintext
maxResultStreamsintegerOptionalLimit the number of Stream videos you want to crawl. · Min: 0 · Max: 999999 · Default: 0
maxResultsShortsintegerOptionalLimit the number of Shorts videos you want to crawl. · Min: 0 · Max: 999999 · Default: 0
downloadSubtitlesbooleanOptionalIf set to true, the scraper will download subtitles for the video and convert them to .srt format.
subtitlesLanguagestringOptionalLanguage to download subtitles in.Note: Download subtitles must be turned on for this option to work. · Options: any, en, de, es, fr, it, ja, ko, nl, pt, ru · Default: "en"
anyendeesfritjakonlptru
aiVideoDescriptionbooleanOptionalIf enabled, uses AI to generate a time-segmented description of the video, covering both visual and audio content for each segment. · Default: false
preferAutoGeneratedSubtitlesbooleanOptionalIf set to true, automatically generated subtitles are preferred to user subtitles. Note: A subtitle language must be selected and download subtitles must be turned on for this option to work.
02

Output Schema

FieldTypeDescription
idstringUnique identifier for the generation task
statusstringTask status: pending, running, completed, failed, timeout
modelstringModel used for the generation
outputsarrayArray of output items
outputs[].urlstringURL of the generated artifact
outputs[].content_typestringMIME type (e.g. image/png, video/mp4)
errorobject | nullError details if failed, null on success
error.typestringMachine-readable error type code
error.messagestringHuman-readable error description

Async Workflow

This model uses asynchronous execution. Submit a request and poll for the result.

  1. Submit — POST to /v1/run, receive an id
  2. Poll — GET /v1/run/{id} until status is completed, failed, or timeout
  3. Retrieve — Read outputs from the completed response
03

Code Examples

Ready-to-run snippets

# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "model": "youtube/bulk/search",
  "maxResults": 0,
  "aiVideoSummary": false,
  "subtitlesFormat": "srt",
  "maxResultStreams": 0,
  "maxResultsShorts": 0,
  "subtitlesLanguage": "en",
  "aiVideoDescription": false,
  "prompt": "a beautiful sunset over mountains"
}'

# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
  -H "Authorization: Bearer YOUR_API_KEY"