{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper: Videos, Shorts, Channels & Comments",
    "description": "Fast YouTube scraper with no browser and no API key: keyword search with filters, channel videos and Shorts, channel About data, playlists, video details (exact likes, date, description) and comments with replies. $1.00 per 1,000 results.",
    "version": "0.1",
    "x-build-id": "0fB0PdrtFfJrD3tkA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/subimpact~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-subimpact-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/subimpact~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-subimpact-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/subimpact~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-subimpact-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 Queries",
            "type": "array",
            "description": "Keyword searches to run. Each query yields up to 'maxResultsPerQuery' results.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "YouTube URLs: videos (/watch?v=, youtu.be), Shorts (/shorts/), channels (@handle, /channel/, /c/, /user/) or playlists (?list=).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResultsPerQuery": {
            "title": "Max Results Per Search Query",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum rows per search query.",
            "default": 20
          },
          "maxVideosPerChannel": {
            "title": "Max Items Per Channel Or Playlist URL",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum video/short rows per channel or playlist URL.",
            "default": 20
          },
          "channelSource": {
            "title": "Channel Source",
            "enum": [
              "tabs",
              "rss"
            ],
            "type": "string",
            "description": "How channel URLs are scraped. 'tabs' reads the channel Videos/Shorts tabs over YouTube's internal API. 'rss' reads YouTube's public uploads feed (one small request per channel, the 15 newest uploads including Shorts and live streams). Video URLs and searchQueries behave the same in both modes.",
            "default": "tabs"
          },
          "onlyNewVideos": {
            "title": "Only New Videos (RSS mode)",
            "type": "boolean",
            "description": "RSS mode: deliver only video ids not delivered by an earlier run of this actor. Delivered ids are kept in a named key-value store in your account (stateStoreName). Leave off for the first run.",
            "default": false
          },
          "stateStoreName": {
            "title": "State Store Name",
            "pattern": "^[a-zA-Z0-9-]{1,63}$",
            "maxLength": 63,
            "type": "string",
            "description": "Named key-value store that holds the delivered ids for onlyNewVideos. 1-63 letters, digits or dashes.",
            "default": "youtube-scraper-state"
          },
          "publishedAfter": {
            "title": "Published After (RSS mode)",
            "type": "string",
            "description": "RSS mode: skip feed entries published before this date or datetime, for example 2026-10-01 or 2026-10-01T00:00:00Z. Leave empty for no cutoff."
          },
          "channelContent": {
            "title": "Channel Content",
            "enum": [
              "videos",
              "shorts",
              "both"
            ],
            "type": "string",
            "description": "Which tab to scrape for channel URLs ('videos', 'shorts' or 'both'). A /@handle/shorts URL always forces Shorts.",
            "default": "videos"
          },
          "includeChannelInfo": {
            "title": "Include Channel Info",
            "type": "boolean",
            "description": "For every channel URL, also deliver one 'channel' row with subscriber counts, About-panel info and links.",
            "default": true
          },
          "searchSortBy": {
            "title": "Search Sort By",
            "enum": [
              "relevance",
              "date",
              "views",
              "rating"
            ],
            "type": "string",
            "description": "Sort order for search results.",
            "default": "relevance"
          },
          "searchUploadDate": {
            "title": "Search Upload Date Filter",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Upload-date filter for search results.",
            "default": "any"
          },
          "searchIncludeShorts": {
            "title": "Include Shorts In Search",
            "type": "boolean",
            "description": "Also extract Shorts rows from search result shelves.",
            "default": false
          },
          "enrichVideoDetails": {
            "title": "Enrich Video Details",
            "type": "boolean",
            "description": "Fetch the video page for every result for exact like counts, exact publish date, full description and comment count. One extra request per video.",
            "default": false
          },
          "scrapeComments": {
            "title": "Scrape Comments",
            "type": "boolean",
            "description": "Also scrape comments for each video (adds 'comment' rows to the dataset).",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max Comments Per Video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum TOP-LEVEL comment rows per video. Replies are capped separately by Max Replies Per Comment and do not count toward this limit.",
            "default": 20
          },
          "commentsSortBy": {
            "title": "Comments Sort By",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Comment order: 'top' (most upvoted) or 'newest'.",
            "default": "top"
          },
          "includeReplies": {
            "title": "Include Comment Replies",
            "type": "boolean",
            "description": "Also scrape replies to comments.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max Replies Per Comment",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum reply rows per comment thread. Reply rows do not count toward Max Comments Per Video.",
            "default": 5
          },
          "maxTotalResults": {
            "title": "Max Total Results (All Inputs)",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Global cap on total rows across all inputs. Hard stop: no rows past this number.",
            "default": 1000
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many inputs are processed in parallel. Pagination inside one input is sequential.",
            "default": 5
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Interface language code (hl), e.g. 'en'.",
            "default": "en"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code (gl), e.g. 'US'.",
            "default": "US"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional. Proxies are usually not needed: the scrape works over plain HTTPS from datacenter IPs. Enable Apify Proxy only for high volumes.",
            "default": {
              "useApifyProxy": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}