{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Search Scraper - Videos, Shorts & Channels",
    "description": "Scrape YouTube search results by keyword, hashtag, channel or search URL: videos, Shorts, channels, playlists and movies with exact views, likes, publish dates, tags and channel stats. Every YouTube filter, exact date ranges and deep search. No login, no API key.",
    "version": "0.1",
    "x-build-id": "9v9dy0E3Lx1s5vNeV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/eiv~youtube-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-eiv-youtube-search-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/eiv~youtube-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-eiv-youtube-search-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/eiv~youtube-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-eiv-youtube-search-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "What you would type into YouTube's search bar, one per line. Quoted phrases work (\"iphone 17\"); YouTube ignores -word, so this Actor removes those results for you. Each term runs once per result type. YouTube links pasted here are read like the URLs below.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "YouTube URLs",
            "type": "array",
            "description": "Search results pages (youtube.com/results?search_query=…, keeping their filters), hashtag pages (/hashtag/…), searches inside a channel (/@handle/search?query=…), playlists (playlist?list=…) and single videos. Channel pages are listed by YouTube Channel Scraper instead.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtag feeds, with or without #: cooking, #travel. Returns the videos and Shorts YouTube shows on /hashtag/<tag> (only Shorts when Result types is Shorts alone).",
            "items": {
              "type": "string"
            }
          },
          "searchInChannels": {
            "title": "Search inside channels",
            "type": "array",
            "description": "Channel handles, URLs or IDs (@mkbhd, youtube.com/@mkbhd, UC…). When set, every search term is searched inside each of these channels instead of all of YouTube.",
            "items": {
              "type": "string"
            }
          },
          "resultTypes": {
            "title": "Result types",
            "type": "array",
            "description": "What to search for. Each search term runs once per type, with its own limit. Videos leaves out Shorts; Everything is the mixed page YouTube shows (videos, Shorts, playlists, channels, movies).",
            "items": {
              "type": "string",
              "enum": [
                "video",
                "short",
                "channel",
                "playlist",
                "movie",
                "all"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Channels",
                "Playlists, mixes and courses",
                "Movies",
                "Everything (as YouTube shows it)"
              ]
            },
            "default": [
              "video"
            ]
          },
          "maxResults": {
            "title": "Max results per search",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Per search term and result type. YouTube itself ends a search after roughly 200-500 results; turn on Deep search to go further. You pay per result, so this also caps the cost.",
            "default": 100
          },
          "maxItems": {
            "title": "Max results in total",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stops the whole run after this many results, across all searches.",
            "default": 10000
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "popularity",
              "newest",
              "mostViewed"
            ],
            "type": "string",
            "description": "Relevance and Popularity are YouTube's own rankings. YouTube removed its upload-date sort, so Newest first and Most viewed are sorted by this Actor, over every result YouTube returns for the search.",
            "default": "relevance"
          },
          "dateFilter": {
            "title": "Upload date",
            "enum": [
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only results uploaded in this period. Last hour is gone from YouTube's menu but still works."
          },
          "lengthFilter": {
            "title": "Length",
            "enum": [
              "under3",
              "between320",
              "plus20",
              "under4",
              "between420"
            ],
            "type": "string",
            "description": "YouTube's length buckets. The two older ones (under 4 minutes, 4-20 minutes) still work. For exact bounds use Min and Max length below."
          },
          "isLive": {
            "title": "Live now",
            "type": "boolean",
            "description": "Only streams that are live right now."
          },
          "is4K": {
            "title": "4K",
            "type": "boolean",
            "description": "Only videos available in 4K."
          },
          "isHD": {
            "title": "HD",
            "type": "boolean",
            "description": "Only HD videos."
          },
          "hasSubtitles": {
            "title": "Subtitles/CC",
            "type": "boolean",
            "description": "Only videos with creator-provided subtitles."
          },
          "hasCC": {
            "title": "Creative Commons",
            "type": "boolean",
            "description": "Only videos under a Creative Commons licence (reuse allowed)."
          },
          "is360": {
            "title": "360°",
            "type": "boolean",
            "description": "Only 360° videos."
          },
          "isVR180": {
            "title": "VR180",
            "type": "boolean",
            "description": "Only VR180 videos."
          },
          "is3D": {
            "title": "3D",
            "type": "boolean",
            "description": "Only 3D videos."
          },
          "isHDR": {
            "title": "HDR",
            "type": "boolean",
            "description": "Only HDR videos."
          },
          "hasLocation": {
            "title": "Location",
            "type": "boolean",
            "description": "Only videos with a location set. YouTube rarely returns results for this filter."
          },
          "exactQuery": {
            "title": "Exact search (no autocorrect)",
            "type": "boolean",
            "description": "Search exactly what you typed. Without it YouTube silently searches a corrected spelling, and returns unrelated videos for terms it does not know; the correctedQuery field shows when that happened.",
            "default": false
          },
          "language": {
            "title": "Language",
            "enum": [
              "af",
              "sq",
              "am",
              "ar",
              "hy",
              "as",
              "az",
              "bn",
              "eu",
              "be",
              "bs",
              "bg",
              "my",
              "ca",
              "zh-HK",
              "zh-CN",
              "zh-TW",
              "hr",
              "cs",
              "da",
              "nl",
              "en-IN",
              "en-GB",
              "en",
              "et",
              "fil",
              "fi",
              "fr",
              "fr-CA",
              "gl",
              "ka",
              "de",
              "el",
              "gu",
              "iw",
              "hi",
              "hu",
              "is",
              "id",
              "it",
              "ja",
              "kn",
              "kk",
              "km",
              "ko",
              "ky",
              "lo",
              "lv",
              "lt",
              "mk",
              "ms",
              "ml",
              "mr",
              "mn",
              "ne",
              "no",
              "or",
              "fa",
              "pl",
              "pt",
              "pt-PT",
              "pa",
              "ro",
              "ru",
              "sr",
              "sr-Latn",
              "si",
              "sk",
              "sl",
              "es-419",
              "es",
              "es-US",
              "sw",
              "sv",
              "ta",
              "te",
              "th",
              "tr",
              "uk",
              "ur",
              "uz",
              "vi",
              "zu"
            ],
            "type": "string",
            "description": "YouTube's interface language: which languages rank higher and the language of the text YouTube adds. With English, YouTube translates foreign titles; video details restore the original (translatedTitle keeps YouTube's translation).",
            "default": "en"
          },
          "country": {
            "title": "Location",
            "enum": [
              "DZ",
              "AR",
              "AM",
              "AU",
              "AT",
              "AZ",
              "BH",
              "BD",
              "BY",
              "BE",
              "BO",
              "BA",
              "BR",
              "BG",
              "KH",
              "CA",
              "CL",
              "CO",
              "CR",
              "HR",
              "CY",
              "CZ",
              "DK",
              "DO",
              "EC",
              "EG",
              "SV",
              "EE",
              "FI",
              "FR",
              "GE",
              "DE",
              "GH",
              "GR",
              "GT",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IQ",
              "IE",
              "IL",
              "IT",
              "JM",
              "JP",
              "JO",
              "KZ",
              "KE",
              "KW",
              "LA",
              "LV",
              "LB",
              "LY",
              "LI",
              "LT",
              "LU",
              "MY",
              "MT",
              "MX",
              "MD",
              "ME",
              "MA",
              "NP",
              "NL",
              "NZ",
              "NI",
              "NG",
              "MK",
              "NO",
              "OM",
              "PK",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PL",
              "PT",
              "PR",
              "QA",
              "RO",
              "RU",
              "SA",
              "SN",
              "RS",
              "SG",
              "SK",
              "SI",
              "ZA",
              "KR",
              "ES",
              "LK",
              "SE",
              "CH",
              "TW",
              "TZ",
              "TH",
              "TN",
              "TR",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UY",
              "VE",
              "VN",
              "YE",
              "ZW"
            ],
            "type": "string",
            "description": "Ranks results for this country, like YouTube's location setting.",
            "default": "US"
          },
          "restrictedMode": {
            "title": "Restricted Mode",
            "type": "boolean",
            "description": "YouTube's Restricted Mode (safe search): leaves out potentially mature videos.",
            "default": false
          },
          "publishedAfter": {
            "title": "Uploaded after",
            "type": "string",
            "description": "A date (2024-01-31) or a period back from now (30 days). Also sent to YouTube as a date operator, so the search itself is narrowed, not just its first pages."
          },
          "publishedBefore": {
            "title": "Uploaded before",
            "type": "string",
            "description": "A date (2024-12-31, inclusive) or a period back from now (7 days)."
          },
          "minViews": {
            "title": "Min views",
            "minimum": 0,
            "type": "integer",
            "description": "Only videos and Shorts with at least this many views."
          },
          "maxViews": {
            "title": "Max views",
            "minimum": 0,
            "type": "integer",
            "description": "Only videos and Shorts with at most this many views, e.g. to find small creators."
          },
          "minDurationSeconds": {
            "title": "Min length",
            "minimum": 0,
            "type": "integer",
            "description": "Only videos at least this long, in seconds (600 = 10 minutes)."
          },
          "maxDurationSeconds": {
            "title": "Max length",
            "minimum": 0,
            "type": "integer",
            "description": "Only videos at most this long, in seconds."
          },
          "minSubscribers": {
            "title": "Min channel subscribers",
            "minimum": 0,
            "type": "integer",
            "description": "Only results from channels with at least this many subscribers (YouTube rounds the counts). For video rows this switches on Channel details."
          },
          "excludeKeywords": {
            "title": "Exclude words",
            "type": "array",
            "description": "Drop results whose title or description contains any of these. Whole words: \"case\" does not drop \"showcase\". Phrases work too.",
            "items": {
              "type": "string"
            }
          },
          "excludeChannels": {
            "title": "Exclude channels",
            "type": "array",
            "description": "Drop results from these channels: handles (@mkbhd), channel IDs, channel URLs or names.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerChannel": {
            "title": "Max results per channel",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "At most this many results from any one channel across the run (0 = no limit), for a list of distinct creators.",
            "default": 0
          },
          "includeVideoDetails": {
            "title": "Video details",
            "type": "boolean",
            "description": "Exact publish time, likes, tags, category, full description with links and hashtags, chapters, the channel's subscribers and a comment count. Completes Shorts (channel, date, length, exact views). Two small requests per video (player data and the watch page), included in the price.",
            "default": true
          },
          "includeCommentCount": {
            "title": "Comment count",
            "type": "boolean",
            "description": "The exact number of comments and whether comments are turned off. One extra request per video (about 30 KB).",
            "default": false
          },
          "includeChannelDetails": {
            "title": "Channel details",
            "type": "boolean",
            "description": "The channel's subscribers, total views, video count, country, joined date, links, business-email flag and description, on every row. One request per channel.",
            "default": false
          },
          "deepSearch": {
            "title": "Deep search",
            "type": "boolean",
            "description": "YouTube ends each search after roughly 200-500 results. Deep search repeats a video search in date windows, newest first, to reach results the plain search never shows. Slower. Works for Videos, Movies and Everything (not Shorts), also inside an Upload date or date range.",
            "default": false
          },
          "includeShelves": {
            "title": "Shelf results",
            "type": "boolean",
            "description": "Also return items from YouTube's extra shelves: \"Latest from <channel>\", \"Channels new to you\", \"Popular in <city>\", \"From health sources\", artist cards and community posts. Off: only the search results themselves.",
            "default": false
          },
          "deduplicateResults": {
            "title": "Remove duplicates across searches",
            "type": "boolean",
            "description": "A result found by several search terms or types is returned, and charged, once. Off: each search returns its own full list (repeats within one search are always removed).",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed: YouTube's own API answers without one. If YouTube refuses the run's address, the Actor switches to Apify datacenter proxy by itself. Residential proxy is never used.",
            "default": {
              "useApifyProxy": false
            }
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many searches run at the same time.",
            "default": 5
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "How long to wait for one response before giving up on it.",
            "default": 30
          },
          "maxRetries": {
            "title": "Retries per request",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries for blocked, rate-limited or failed connections. Timeouts are not retried.",
            "default": 2
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}