{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Search Scraper — All Filters, Video & Channel Data",
    "description": "Scrape YouTube search results by keyword with every filter YouTube offers: 4 sort orders, 6 upload windows (from last hour), 6 result types, 4 durations, 11 feature flags. Each row: video ID, title, description snippet, channel name/ID/handle, views, duration, thumbnails, badges, chapters.",
    "version": "0.1",
    "x-build-id": "fS2Vvf3kcPEXiRWiO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapersdelight~youtube-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapersdelight-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/scrapersdelight~youtube-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapersdelight-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/scrapersdelight~youtube-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapersdelight-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 queries",
            "type": "array",
            "description": "The keywords to search YouTube for — one per line, exactly what you would type into YouTube's own search box. A single query runs dry at roughly 200-340 unique results (that is YouTube's ceiling, not ours), so volume comes from running MANY queries, not one deep one. Leave empty and the actor runs the sample query \"web scraping\" so a blank run still returns data.",
            "default": [
              "web scraping"
            ],
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "uploadDate",
              "viewCount",
              "rating"
            ],
            "type": "string",
            "description": "YouTube's own sort order. `relevance` is the default ranking you see on youtube.com. `uploadDate` and `rating` are not exposed by any other Store actor — they are encoded straight into YouTube's search protobuf.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "lastHour",
              "today",
              "thisWeek",
              "thisMonth",
              "thisYear"
            ],
            "type": "string",
            "description": "Only return results uploaded inside this window. `lastHour` is a real YouTube filter that competing actors do not expose — verified live returning videos 26-56 minutes old.",
            "default": "any"
          },
          "resultType": {
            "title": "Result type",
            "enum": [
              "video",
              "any",
              "shorts",
              "channel",
              "playlist",
              "movie"
            ],
            "type": "string",
            "description": "Which kind of result YouTube should return. These are server-side filters, verified live: `video` returned 64 video rows and zero Shorts over 3 pages, `channel` returned 20 channel rows and zero videos. `any` reproduces youtube.com exactly, which means the Shorts shelf is mixed in and you pay for those rows too — over the same 3 pages `any` returned 40 videos + 70 Shorts + 1 channel. Default is `video` so you are not billed for Shorts you did not ask for.",
            "default": "video"
          },
          "duration": {
            "title": "Video duration",
            "enum": [
              "any",
              "under3min",
              "from3to20min",
              "over20min"
            ],
            "type": "string",
            "description": "Server-side length filter. Verified live: `under3min` returned 0:45-1:52, `from3to20min` returned 6:39-19:39, `over20min` returned 55:11-11:55:00.",
            "default": "any"
          },
          "features": {
            "title": "Feature filters",
            "type": "array",
            "description": "YouTube's feature checkboxes. Pick any combination — they are encoded together into one request, so the full cross-product with the sort/date/type/duration filters is reachable. Note: `live` results legitimately have no duration and no publish date.",
            "items": {
              "type": "string",
              "enum": [
                "live",
                "fourK",
                "hd",
                "subtitles",
                "creativeCommons",
                "threeSixty",
                "vr180",
                "threeD",
                "hdr",
                "location",
                "purchased"
              ],
              "enumTitles": [
                "Live",
                "4K",
                "HD",
                "Subtitles / CC",
                "Creative Commons",
                "360°",
                "VR180",
                "3D",
                "HDR",
                "Location",
                "Purchased"
              ]
            },
            "default": []
          },
          "maxResultsPerQuery": {
            "title": "Max results per query",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop each query after this many unique results. YouTube's own continuation chain runs dry at roughly 200-340 unique results per query (measured: 206 for \"plumber\", 337 for \"best crm software\"), so asking for much more than that just ends the query early — it does not under-deliver silently, the log says \"no further pages\".",
            "default": 200
          },
          "maxResults": {
            "title": "Max results in total",
            "minimum": 0,
            "type": "integer",
            "description": "Hard stop across every query combined. 0 = no overall limit (each query is still bounded by \"Max results per query\").",
            "default": 0
          },
          "language": {
            "title": "Language (hl)",
            "type": "string",
            "description": "YouTube interface language code sent as `hl`. Changes the language of relative dates (\"6 years ago\") and badge labels, and nudges which results rank.",
            "default": "en"
          },
          "region": {
            "title": "Country (gl)",
            "type": "string",
            "description": "Two-letter country code sent as `gl`. YouTube ranks search results per country, so this is how you scrape the German or Brazilian result set for the same keyword.",
            "default": "US"
          },
          "deduplicateAcrossQueries": {
            "title": "De-duplicate across queries",
            "type": "boolean",
            "description": "Duplicates INSIDE one query are always dropped before billing (YouTube's continuation chain repeats 8-14% of rows). This switch also drops a result that already appeared under a DIFFERENT query. Leave it off for rank tracking, where the same video ranking for two keywords is two real data points; switch it on when you just want a unique list of videos.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy on `auto` is enough — verified HTTP 200 through auto and through residential on the same day. Switch to RESIDENTIAL only if a very large job starts seeing 403/429 in the log; residential bandwidth is billed and each result is ~36 KB.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}