{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Search Scraper - Videos, Views & Channels",
    "description": "For content research, trend tracking and AI datasets: search YouTube and get one row per video with title, channel, views as text and as a number, length, thumbnail and description. YouTube never says a search found nothing - it returns unrelated videos - so every row carries what was searched.",
    "version": "0.1",
    "x-build-id": "kRy4ifiGh4ZBMpp5M"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/neverempty~youtube-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-neverempty-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/neverempty~youtube-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-neverempty-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/neverempty~youtube-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-neverempty-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": {
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "What to search for on YouTube. Each query is run separately and every row says which query produced it.",
            "default": [
              "web scraping tutorial"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerQuery": {
            "title": "Results per query",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "How many videos to collect for each query. YouTube returns roughly 16-20 per page and this Actor follows the pages for you.",
            "default": 50
          },
          "maxRecords": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "The most rows this run may return and charge for. When the limit cuts the result, rows are taken evenly from every query, so no query disappears completely, and a free row says what was left out.",
            "default": 200
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "upload_date",
              "view_count",
              "rating"
            ],
            "type": "string",
            "description": "relevance is YouTube's default. upload_date, view_count and rating use YouTube's own sort filters.",
            "default": "relevance"
          },
          "dropUnrelated": {
            "title": "Drop videos that do not contain your search terms",
            "type": "boolean",
            "description": "YouTube never returns an empty result: when nothing matches, it quietly serves unrelated videos. Every row already carries how many of your terms it contains; turn this on to remove the ones that contain none.",
            "default": false
          },
          "excludeShorts": {
            "title": "Exclude Shorts (60 seconds or less)",
            "type": "boolean",
            "description": "Remove videos that are 60 seconds or less. Videos whose length YouTube does not show (live streams) are kept. In practice few Shorts appear in search results at all.",
            "default": false
          },
          "onlyShorts": {
            "title": "Only Shorts",
            "type": "boolean",
            "description": "Keep only videos that are 60 seconds or less. Note (measured 2026-09-08): YouTube search results rarely contain Shorts - they are returned in a separate shelf this Actor does not read - so this filter often leaves nothing.",
            "default": false
          },
          "minViews": {
            "title": "Minimum view count",
            "minimum": 0,
            "type": "integer",
            "description": "Live streams show \"watching\" instead of a view count, so their view count is empty and they are not compared against this.",
            "default": 0
          },
          "maxLengthSeconds": {
            "title": "Maximum length (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "0 means no limit. Videos whose length YouTube does not show (live streams) are kept rather than dropped.",
            "default": 0
          },
          "publishedWithinDays": {
            "title": "Published within (days)",
            "minimum": 0,
            "type": "integer",
            "description": "0 means no limit. YouTube only shows relative times (\"6 months ago\"), so this compares an approximation - the field is named publishedApproxDaysAgo for that reason, and the original wording is kept in publishedText.",
            "default": 0
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep only videos whose title, description or channel name contain these words.",
            "items": {
              "type": "string"
            }
          },
          "keywordMatch": {
            "title": "Keyword match",
            "enum": [
              "any",
              "all"
            ],
            "type": "string",
            "description": "any = at least one keyword must appear. all = every keyword must appear.",
            "default": "any"
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop videos containing any of these words.",
            "items": {
              "type": "string"
            }
          },
          "monitoringMode": {
            "title": "Only return videos that are new since the last run",
            "type": "boolean",
            "description": "Remembers which video ids this Actor has already returned and skips them next time. Filtering happens before this, so a video you filtered out is not held back for later.",
            "default": false
          },
          "resetMonitoringState": {
            "title": "Forget what was already returned",
            "type": "boolean",
            "description": "Clears the memory of what was already returned, once, so the next run returns everything again.",
            "default": false
          },
          "maxRequests": {
            "title": "Maximum requests",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "A hard ceiling on how many requests this run may send to YouTube, across all queries and pages.",
            "default": 40
          },
          "useProxy": {
            "title": "Use an Apify proxy if YouTube asks for one",
            "type": "boolean",
            "description": "Off by default: a plain connection works and is faster and cheaper. Turn this on if you see bot-check rows in the output.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}