{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper: Videos, Channels, Comments & Shorts",
    "description": "Get YouTube videos from searches, channels, playlists and links with exact views, likes, comment counts, dates and tags, plus channel profiles and comments. Monitor channels for new videos.",
    "version": "0.1",
    "x-build-id": "xf19j9toxzyZLwy16"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/stratumics~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-stratumics-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/stratumics~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-stratumics-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/stratumics~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-stratumics-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": "Words to search on YouTube, one per line, exactly as you would type them in the YouTube search box. A copied YouTube search link (youtube.com/results?search_query=...) works too and keeps its filters.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Channel links or handles, one per line: @mkbhd, https://www.youtube.com/@mkbhd, a /channel/UC... link, an old /c/ or /user/ link, or a bare channel id. A link to one tab (for example youtube.com/@mkbhd/shorts) reads only that tab. Videos come newest first.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video links",
            "type": "array",
            "description": "Links to single videos or Shorts (watch, youtu.be, shorts, live and embed links all work), or bare 11-character video ids. Every video link gets full details: likes, exact date, full description, tags and comment count.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "playlistUrls": {
            "title": "Playlist links",
            "type": "array",
            "description": "Playlist links (youtube.com/playlist?list=...) or bare playlist ids. Videos come in the playlist's own order.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerInput": {
            "title": "Maximum results per input",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "The most videos (or channels and playlists, for those search types) to save from each search term, each channel tab and each playlist. YouTube itself stops search results at about 500 to 600 per term. Set 0 with channels to get only the channel profiles. Video links are not limited by this.",
            "default": 50
          },
          "searchType": {
            "title": "Search for",
            "enum": [
              "video",
              "shorts",
              "channel",
              "playlist"
            ],
            "type": "string",
            "description": "What a search returns: videos, Shorts, channels (saved as channel profiles) or playlists.",
            "default": "video"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only videos uploaded within this period, as YouTube's filter defines it.",
            "default": "any"
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "any",
              "under3",
              "from3to20",
              "over20"
            ],
            "type": "string",
            "description": "Only videos of this length.",
            "default": "any"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "date",
              "views"
            ],
            "type": "string",
            "description": "Relevance and view count are YouTube's own orders, except for Shorts: YouTube no longer sorts Shorts by view count, so the scraper reads them and saves the most viewed first. YouTube no longer sorts searches by upload date either, so Newest first reads the results and saves them newest first; pair it with Upload date for recent videos.",
            "default": "relevance"
          },
          "channelTabs": {
            "title": "Channel tabs",
            "type": "array",
            "description": "Which tabs to read for each channel: long videos, Shorts, and past or current live streams. Each tab gets up to the maximum results per input.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "streams"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Live"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "includeChannelInfo": {
            "title": "Save the channel profile",
            "type": "boolean",
            "description": "Save one channel row per channel input: name, handle, id, subscribers, video count, total views, join date, country, description, links, avatar and banner.",
            "default": true
          },
          "includeVideoDetails": {
            "title": "Get full video details",
            "type": "boolean",
            "description": "Open every video found by searches, channels and playlists for its like count, comment count, exact publish date and time, full description, links in the description, tags and category. Costs extra per video (see Pricing). Video links always get details.",
            "default": false
          },
          "includeComments": {
            "title": "Get comments",
            "type": "boolean",
            "description": "Save the comments of every video the run finds, each as its own row.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Maximum comments per video",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "The most comments (replies included) to save per video. 0 means every comment YouTube lists, which can be tens of thousands on popular videos, so set a limit to control cost.",
            "default": 0
          },
          "commentsSortBy": {
            "title": "Comment order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top comments (YouTube's default order) or newest first.",
            "default": "top"
          },
          "includeCommentReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Also save the replies under each comment. Replies count toward the maximum comments per video.",
            "default": false
          },
          "newerThan": {
            "title": "Only videos newer than",
            "pattern": "^$|^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])(T[0-2]\\d:[0-5]\\d(:[0-5]\\d)?(\\.\\d+)?(Z|[+-][0-2]\\d:?[0-5]\\d)?)?$|^(\\d+)\\s*(minute|hour|day|week|month|year)s?$",
            "type": "string",
            "description": "Keep videos published on or after this date. Use a date (2026-10-01), an ISO date-time in UTC (2026-10-01T12:00:00Z), or a relative value such as \"7 days\" or \"12 hours\". Channels stop reading at the first older video, and dates near the cut-off are checked exactly. Searches use YouTube's upload-date filter as well. Video links are not filtered.",
            "default": ""
          },
          "onlyNewVideos": {
            "title": "Only new videos (monitoring)",
            "type": "boolean",
            "description": "For channels: return only videos that earlier runs with the same monitor name have not returned. The first run returns the newest videos up to the maximum and saves each channel profile; later runs (for example on a schedule) return only what was posted since, without repeating the profile. Upcoming premieres are left out until they go live.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of the memory that monitoring runs share (letters, digits and hyphens). Use one name per schedule; runs with different names do not affect each other.",
            "default": "default"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language YouTube uses for titles (when creators translated them) and for its own texts. Pick one or type any YouTube language code. In languages other than English, each video's exact date and views are read with one extra small request.",
            "default": "en"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Country whose YouTube you see: it changes search ranking and which videos are available. Pick one or type any two-letter country code.",
            "default": "US"
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many requests to YouTube run at once. The default is fast and stays under YouTube's limits; higher values finish sooner but are more likely to be refused.",
            "default": 8
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "YouTube answers Apify's servers directly, so no proxy is needed. If YouTube starts rate-limiting a run, it switches to Apify datacenter proxy on its own. Pick a proxy here only to use one from the start.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}