{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Channel Scraper With Comments",
    "description": "Scrape complete YouTube channel data with ease. This actor gathers videos, stats, descriptions, tags, and publishing details from any public channel. Built for analysts, marketers, and developers needing reliable YouTube data for research or monitoring.",
    "version": "0.1",
    "x-build-id": "hSJM2JHo3gvyrCWde"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapio~youtube-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapio-youtube-channel-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/scrapio~youtube-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapio-youtube-channel-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/scrapio~youtube-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapio-youtube-channel-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",
        "required": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "🔗 YouTube channels",
            "type": "array",
            "description": "Channel URLs (https://www.youtube.com/@Handle or .../channel/UC…), bare @handles, or bare UC… channel IDs. One per line. Keyword search is not supported — every entry must resolve to a channel.",
            "default": [
              "https://www.youtube.com/@MrBeast"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "🔢 Items per section, per channel",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Upper limit for each enabled section (videos, Shorts, live streams, posts) on each channel. Comments have their own cap and never eat this budget.",
            "default": 10
          },
          "sortOrderVideos": {
            "title": "🎥 Videos tab order",
            "enum": [
              "date",
              "viewCount",
              "oldest"
            ],
            "type": "string",
            "description": "Which of YouTube's own Videos-tab sort chips to use. Channels that do not offer Popular/Oldest chips fall back to newest-first, and the run log says so. YouTube publishes no sort chips at all on the Shorts, Live and Community tabs, so those tabs are always newest-first and no dead toggle is offered for them.",
            "default": "date"
          },
          "scrapeChannelInfo": {
            "title": "🏠 Channel profile & About",
            "type": "boolean",
            "description": "Emit one channel row per channel: description, join date, country, subscriber text, lifetime view count, video count, avatar, banner, external links and verification badge.",
            "default": true
          },
          "scrapeVideos": {
            "title": "🎬 Long-form videos",
            "type": "boolean",
            "description": "Emit one video row per upload from the Videos tab.",
            "default": true
          },
          "scrapeShorts": {
            "title": "📱 Shorts",
            "type": "boolean",
            "description": "Emit one short row per Short. Channels without a Shorts tab return no Shorts rows.",
            "default": true
          },
          "scrapeLiveStreams": {
            "title": "🔴 Live & past streams",
            "type": "boolean",
            "description": "Emit one livestream row per item on the Live tab. Channels without a Live tab return no livestream rows — YouTube silently serves the Home tab there, and this Actor detects that instead of mislabelling home videos as streams.",
            "default": true
          },
          "scrapePosts": {
            "title": "💬 Community posts",
            "type": "boolean",
            "description": "Emit one post row per community post (rowType `post`), including image, poll and video attachments. The attachment kind is reported separately in `postType`.",
            "default": true
          },
          "videoComments": {
            "title": "💬 Read the comment threads",
            "type": "boolean",
            "description": "Fetch the comments under every collected item. Each comment becomes its own row with rowType `comment`, `isChild: true` and the video id in `parentId`.",
            "default": true
          },
          "commentSources": {
            "title": "🎯 Which items to read comments on",
            "uniqueItems": true,
            "type": "array",
            "description": "Long-form videos, Shorts and live streams all have comment sections. Every extra source multiplies the request count.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "liveStreams"
              ],
              "enumTitles": [
                "🎬 Long-form videos",
                "📱 Shorts",
                "🔴 Live streams"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "maxCommentsPerVideo": {
            "title": "📊 Comments per item",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "YouTube serves 20 comments per request, so 20 = one request, 100 = five. Replies are counted separately.",
            "default": 20
          },
          "commentsSortBy": {
            "title": "↕️ Comment order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Exactly the two orders YouTube itself offers. The token is read out of YouTube's own sort menu, so `newest` really is chronological, not a re-sorted top page.",
            "default": "top"
          },
          "includeCommentReplies": {
            "title": "🧵 Follow the reply threads",
            "type": "boolean",
            "description": "Adds one request per commented-on thread. Replies come back as rows too, with `parentCommentId` set and `replyLevel: 1` (YouTube flattens deeper nesting).",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "↩️ Replies per comment",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Cap on replies kept per thread when reply following is on.",
            "default": 10
          },
          "exactVideoStats": {
            "title": "📈 Absolute publish date from the watch page",
            "type": "boolean",
            "description": "The channel grid only shows `5 days ago`. This reads the watch endpoint for YouTube's own absolute date (`Jul 27, 2026`) and the exact view figure. Free when comments are on — it is the same request.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "Apify Proxy is attached to every request the Actor makes, channel pages and comment pages alike. US residential is the most reliable option for YouTube; datacenter IPs are more likely to hit consent or bot interstitials.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}