{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Channel Scraper - Videos, Playlists, Comments, Stats",
    "description": "Channel, playlist and video data from YouTube: titles, views, likes, duration, publish dates and comments. Search is NOT available from Apify - YouTube answers 302 to its datacenter addresses, measured three runs in a row - so this Actor works from channel, playlist and video addresses instead.",
    "version": "0.1",
    "x-build-id": "fSGfDdDNmP1xKe7ar"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/snow_leo_data~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-snow_leo_data-youtube-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/snow_leo_data~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-snow_leo_data-youtube-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/snow_leo_data~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-snow_leo_data-youtube-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": "One YouTube search per line. A plain search stops at 289 videos per term - YouTube itself stops handing out the next page there. Turn on Deep search below to go past it. Note: YouTube refuses search requests coming from Apify's datacenter addresses (measured: HTTP 302 on three runs in a row), so search returns nothing here. Channel, playlist and video addresses in Start URLs do work.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "🔗 YouTube URLs",
            "type": "array",
            "description": "Video, channel, @handle or playlist addresses. Bare IDs work too: a video ID, a UC... channel ID or a PL... playlist ID.",
            "default": [
              "https://www.youtube.com/@NASA"
            ],
            "items": {
              "type": "string"
            }
          },
          "searchFor": {
            "title": "Search for",
            "enum": [
              "videos",
              "shorts",
              "live",
              "channels",
              "playlists"
            ],
            "type": "string",
            "description": "What the search terms should return. Shorts are a separate listing on YouTube's side: asking for videos excludes them and asking for shorts excludes regular videos.",
            "default": "videos"
          },
          "deepSearch": {
            "title": "🚀 Deep search (go past YouTube's 289-video ceiling)",
            "type": "boolean",
            "description": "Only affects keyword search, which does not work from Apify's datacenter addresses (YouTube answers HTTP 302; measured three runs in a row). Leave it off unless you run this Actor somewhere else. Runs the same term as up to 64 separate searches - four sort orders x four upload windows x four durations - and merges them. Measured on 'excavator repair': 289 videos without it, 3860 with it, 13.4x more. Costs more requests, so raise 'Max results per search term' to match. That 13.4x figure was measured off-platform and is NOT reachable from a run here.",
            "default": false
          },
          "maxResultsPerQuery": {
            "title": "Max results per search term",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop collecting a term after this many rows. Also the per-tab limit for a channel and the per-playlist limit.",
            "default": 100
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "date",
              "views",
              "rating"
            ],
            "type": "string",
            "description": "Handed to YouTube itself, so it filters before you are charged for a row.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Uploaded within",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Handed to YouTube inside the request. Non-matching videos never reach your dataset and never reach your bill.",
            "default": "any"
          },
          "videoDuration": {
            "title": "Duration",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "YouTube's own duration buckets. Shorts carry no duration at all, so this filter and a Shorts search cannot be combined.",
            "default": "any"
          },
          "features": {
            "title": "Must have",
            "type": "array",
            "description": "YouTube's own feature filters. Several may be combined.",
            "items": {
              "type": "string",
              "enum": [
                "hd",
                "is4k",
                "subtitles",
                "creativeCommons",
                "live",
                "is360",
                "vr180",
                "is3d",
                "hdr",
                "location",
                "purchased"
              ],
              "enumTitles": [
                "HD",
                "4K",
                "Subtitles / CC",
                "Creative Commons",
                "Live",
                "360°",
                "VR180",
                "3D",
                "HDR",
                "Location",
                "Purchased"
              ]
            },
            "default": []
          },
          "channelTabs": {
            "title": "Channel tabs to read",
            "type": "array",
            "description": "Only used for channel and @handle addresses.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "live",
                "playlists"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Live",
                "Playlists"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "includeVideoDetails": {
            "title": "Fetch full video details",
            "type": "boolean",
            "description": "Opens each video page for the exact view count, like count, comment count, full description, tags, category and the publication date to the second. One extra request per video.",
            "default": false
          },
          "includeComments": {
            "title": "Fetch comments",
            "type": "boolean",
            "description": "Adds one row per comment, with author, likes, replies and a direct link. Comments are rows too, so they count towards Max rows.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Comments per video",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Comments to take from each video, newest or top first depending on the order below. Zero switches comments off.",
            "default": 20
          },
          "commentsSortBy": {
            "title": "Comment order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top comments are the ones YouTube ranks highest; newest first is the raw chronological feed.",
            "default": "top"
          },
          "titleContains": {
            "title": "Title contains any of",
            "type": "array",
            "description": "Case-insensitive. A row whose title is unknown is kept, not dropped - the count of such rows is in the REPORT record.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "channelContains": {
            "title": "Channel name contains",
            "type": "string",
            "description": "Case-insensitive substring of the channel name. A row whose channel is unknown is kept, not dropped.",
            "default": ""
          },
          "minViews": {
            "title": "Minimum views",
            "type": "integer",
            "description": "Rows with fewer views are dropped before they are written. A row with no view count is kept, not dropped."
          },
          "maxViews": {
            "title": "Maximum views",
            "type": "integer",
            "description": "Rows with more views are dropped before they are written. A row with no view count is kept, not dropped."
          },
          "minDurationSeconds": {
            "title": "Minimum duration",
            "type": "integer",
            "description": "Rows shorter than this are dropped before they are written. Shorts and channels carry no duration, so they are kept, not dropped."
          },
          "maxDurationSeconds": {
            "title": "Maximum duration",
            "type": "integer",
            "description": "Rows longer than this are dropped before they are written. Shorts and channels carry no duration, so they are kept, not dropped."
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "YYYY-MM-DD. Search listings carry only '4 years ago', so the date used is an estimate unless 'Fetch full video details' is on.",
            "default": ""
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "YYYY-MM-DD.",
            "default": ""
          },
          "onlyNew": {
            "title": "Only new and changed rows",
            "type": "boolean",
            "description": "Remembers what earlier runs delivered in a named key-value store and writes only what is new or changed. Scheduled runs stop paying for the same rows twice.",
            "default": false
          },
          "emitUnchanged": {
            "title": "Emit unchanged rows too",
            "type": "boolean",
            "description": "Brings back the rows that have not changed as well, marked UNCHANGED, when you want a full snapshot rather than a diff.",
            "default": false
          },
          "maxItems": {
            "title": "Max rows",
            "type": "integer",
            "description": "Hard stop on delivered rows, comments included. Zero means no limit."
          },
          "compactOutput": {
            "title": "Compact output",
            "type": "boolean",
            "description": "Fifteen decision-making columns instead of all of them. Handy for AI agents and small files.",
            "default": false
          },
          "dropEmptyFields": {
            "title": "Drop empty fields",
            "type": "boolean",
            "description": "Removes null cells from every row entirely, instead of returning them empty. Smaller files, fewer tokens for an AI agent.",
            "default": false
          },
          "language": {
            "title": "Language (hl)",
            "type": "string",
            "description": "Two-letter interface language. It changes the wording YouTube returns, such as '4 years ago'.",
            "default": "en"
          },
          "country": {
            "title": "Country (gl)",
            "type": "string",
            "description": "Two-letter country code. YouTube ranks and filters results per country.",
            "default": "US"
          },
          "concurrency": {
            "title": "Parallel detail requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many video or channel pages are opened at the same time. Higher is faster and more likely to make YouTube ask you to slow down.",
            "default": 4
          },
          "inputDatasetId": {
            "title": "Read URLs from a dataset",
            "type": "string",
            "description": "Dataset ID of another Actor's output. Its rows feed YouTube URLs into this run.",
            "default": ""
          },
          "urlField": {
            "title": "Field holding the URL",
            "type": "string",
            "description": "Which column of that dataset holds the YouTube address.",
            "default": "url"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}