{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper",
    "description": "Scrape YouTube search results, videos, Shorts, live streams, channels with social links, playlists, community posts, comments with nested replies and transcripts. Full search filters, exact counts, fast and low cost.",
    "version": "0.0",
    "x-build-id": "6QsZZPObckUOgKLH8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/calm_builder~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-calm_builder-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/calm_builder~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-calm_builder-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/calm_builder~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-calm_builder-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": "Keywords to search on YouTube, one per row - exactly as you would type them in YouTube's search box. Use the search filters below to narrow the results.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "YouTube links or channel handles",
            "type": "array",
            "description": "One per row. Accepts video, Short and live links, channels (URL or @handle - add /videos, /shorts, /streams, /posts or /playlists to scrape only that tab), playlists, community posts, hashtag pages and YouTube search result links (their own filters are kept).",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Maximum videos",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Regular videos to collect per search term, channel or playlist.",
            "default": 10
          },
          "maxResultsShorts": {
            "title": "Maximum Shorts",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Shorts to collect per search term or channel.",
            "default": 0
          },
          "maxResultStreams": {
            "title": "Maximum live streams",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Live and past live streams to collect per search term or channel.",
            "default": 0
          },
          "maxSearchChannels": {
            "title": "Maximum channels from search",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Channels to collect for each search term (full channel details including social links).",
            "default": 0
          },
          "maxSearchPlaylists": {
            "title": "Maximum playlists from search",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Playlists to collect for each search term (playlist details only; add the playlist link above to also get its videos).",
            "default": 0
          },
          "searchSortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "popularity"
            ],
            "type": "string",
            "description": "YouTube's 'Prioritize' option.",
            "default": "relevance"
          },
          "searchUploadDate": {
            "title": "Upload date",
            "enum": [
              "",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only videos uploaded within this period.",
            "default": ""
          },
          "searchDuration": {
            "title": "Duration",
            "enum": [
              "",
              "under3",
              "3to20",
              "over20"
            ],
            "type": "string",
            "description": "Video length (applies to regular videos).",
            "default": ""
          },
          "searchFeatures": {
            "title": "Features",
            "type": "array",
            "description": "Only videos with all of the selected features. For live streams use 'Maximum live streams' above.",
            "items": {
              "type": "string",
              "enum": [
                "hd",
                "4k",
                "subtitles",
                "creative_commons",
                "360",
                "vr180",
                "3d",
                "hdr",
                "location",
                "purchased"
              ],
              "enumTitles": [
                "HD",
                "4K",
                "Subtitles/CC",
                "Creative Commons",
                "360°",
                "VR180",
                "3D",
                "HDR",
                "Location",
                "Purchased"
              ]
            },
            "default": []
          },
          "channelSortBy": {
            "title": "Channel videos order",
            "enum": [
              "latest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Order of a channel's videos, Shorts and streams.",
            "default": "latest"
          },
          "oldestPostDate": {
            "title": "Published after",
            "pattern": "^$|^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Only keep videos, Shorts, streams and posts published after this date - an exact date or a relative period like '7 days'. Free. Channel order is set to Latest when used."
          },
          "includeChannelInfo": {
            "title": "$ Add channel details (also for every video's channel)",
            "type": "boolean",
            "description": "Extra charge per channel. Adds one row per channel: the channels you entered AND the channel of every collected video, so 100 videos from 100 different channels can add up to 100 channel rows. Each row has subscribers, total views, video count, country, join date, description, avatar, banner, verified badge and all social / website links. Each channel is collected and charged once per run.",
            "default": false
          },
          "maxChannelPosts": {
            "title": "Maximum community posts per channel",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Text, image, poll and video posts from the channel's Posts tab.",
            "default": 0
          },
          "maxChannelPlaylists": {
            "title": "Maximum playlists per channel",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Playlists from the channel's Playlists tab (playlist details).",
            "default": 0
          },
          "includeVideoExtras": {
            "title": "$ Add chapters and AI summary",
            "type": "boolean",
            "description": "Extra charge per video. Adds chapters (with start times), YouTube's AI-generated video summary where shown, the members-only flag and collaborating channels. Regular videos only.",
            "default": false
          },
          "includeShortsSound": {
            "title": "$ Add Shorts sound",
            "type": "boolean",
            "description": "Extra charge per Short. Adds the sound / music a Short uses (or 'Original sound').",
            "default": false
          },
          "includeTranscripts": {
            "title": "$ Add transcripts",
            "type": "boolean",
            "description": "Extra charge per video and language. Adds the video's captions (manual captions preferred over auto-generated). Only languages the video actually has are returned - YouTube does not offer translated captions to scrapers.",
            "default": false
          },
          "transcriptLanguages": {
            "title": "Transcript languages",
            "type": "array",
            "description": "Language codes in order of preference, e.g. en, es, de, hi, ar, pt, fr (up to 5; each language found is one transcript). Leave empty for the video's main language.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "transcriptFormat": {
            "title": "Transcript format",
            "enum": [
              "text",
              "segments",
              "srt",
              "all"
            ],
            "type": "string",
            "description": "How transcripts appear in each video row.",
            "default": "text"
          },
          "maxComments": {
            "title": "Maximum comments per video",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Top-level comments to collect per video, Short or post. 0 = no comments.",
            "default": 0
          },
          "commentsSortBy": {
            "title": "Comments order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "YouTube's comment order.",
            "default": "top"
          },
          "maxReplyDepth": {
            "title": "Reply depth",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "How many levels of replies to collect: 0 = no replies, 1 = direct replies, up to 6 for replies to replies.",
            "default": 1
          },
          "maxRepliesPerComment": {
            "title": "Maximum replies per comment",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Replies to collect under each comment, at every level.",
            "default": 5
          },
          "commentsNewerThan": {
            "title": "Comments published after",
            "pattern": "^$|^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Only keep comments published after this date (exact date or e.g. '7 days'). Sets the order to Newest first."
          },
          "country": {
            "title": "Country",
            "enum": [
              "US",
              "GB",
              "CA",
              "AU",
              "IN",
              "PK",
              "DE",
              "FR",
              "ES",
              "IT",
              "NL",
              "BR",
              "MX",
              "JP",
              "KR",
              "ID",
              "PH",
              "TR",
              "AE",
              "SA"
            ],
            "type": "string",
            "description": "YouTube shows search results and availability for this country.",
            "default": "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}