{
  "openapi": "3.0.1",
  "info": {
    "title": "$3/1K | YouTube Scraper - Search, Videos & Transcripts",
    "description": "Scrape YouTube search results, video details (exact views, likes, dates, chapters), transcripts with timestamps, comments with likes and reply counts, channel and playlist videos, and trending charts. Filters for type, upload date and duration; batch many inputs. Made by ScraperCompany.",
    "version": "1.0",
    "x-build-id": "2i1Tourzy7dN6iYpt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapercompany~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapercompany-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/scrapercompany~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapercompany-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/scrapercompany~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapercompany-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "video",
              "transcript",
              "comments",
              "channel",
              "playlist",
              "trending",
              "channels",
              "shorts"
            ],
            "type": "string",
            "description": "Search YouTube by keyword, read details, transcripts or comments of known videos, list a channel's latest videos or a playlist's videos, read a country's trending chart, find channels by keyword, or search Shorts.",
            "default": "search"
          },
          "queries": {
            "title": "Search queries (Search, Channel search, Shorts search)",
            "type": "array",
            "description": "One YouTube search per line, as typed in YouTube's search box.",
            "default": [
              "sourdough bread recipe"
            ],
            "items": {
              "type": "string"
            }
          },
          "videoIds": {
            "title": "Videos (Video details, Transcript, Comments)",
            "type": "array",
            "description": "One video per line: the 11-character id (<code>arj7oStGLkU</code>) or any YouTube video link (<code>watch?v=</code>, <code>youtu.be/</code>, <code>/shorts/</code>, <code>/live/</code>).",
            "default": [
              "arj7oStGLkU"
            ],
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "title": "Channels (Channel videos)",
            "type": "array",
            "description": "One channel per line: an <code>@handle</code>, a <code>UC...</code> channel id or a channel link.",
            "default": [
              "@NASA"
            ],
            "items": {
              "type": "string"
            }
          },
          "playlists": {
            "title": "Playlists (Playlist videos)",
            "type": "array",
            "description": "One playlist per line: its id (<code>PLBCF2DAC6FFB574DE</code>) or any link with <code>list=</code>.",
            "default": [
              "PLBCF2DAC6FFB574DE"
            ],
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries (Trending)",
            "type": "array",
            "description": "One two-letter country code per line, such as <code>US</code>, <code>GB</code> or <code>IN</code>. Each country is one trending chart.",
            "default": [
              "US"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxPages": {
            "title": "Pages per query, video, channel or playlist",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many pages to fetch for each search (up to 20), video's comments, channel's videos or playlist (up to 50). Each page is a separate request and is charged separately; paging stops when YouTube has no further page.",
            "default": 1
          },
          "type": {
            "title": "Result type (Search)",
            "enum": [
              "video",
              "channel",
              "playlist",
              "movie",
              "shorts"
            ],
            "type": "string",
            "description": "Only one kind of result. Leave empty for YouTube's mixed page."
          },
          "upload_date": {
            "title": "Upload date (Search)",
            "enum": [
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only videos uploaded within this period."
          },
          "duration": {
            "title": "Duration (Search)",
            "enum": [
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "YouTube's length buckets."
          },
          "features": {
            "title": "Features (Search)",
            "type": "array",
            "description": "YouTube's Features filters, combined: <code>hd</code>, <code>subtitles</code>, <code>creative_commons</code>, <code>3d</code>, <code>live</code>, <code>purchased</code>, <code>4k</code>, <code>360</code>, <code>location</code>, <code>hdr</code>, <code>vr180</code>.",
            "items": {
              "type": "string"
            }
          },
          "searchSort": {
            "title": "Sort (Search)",
            "enum": [
              "relevance",
              "popularity"
            ],
            "type": "string",
            "description": "Relevance (YouTube's default) or most viewed first."
          },
          "commentSort": {
            "title": "Sort (Comments)",
            "enum": [
              "newest",
              "top"
            ],
            "type": "string",
            "description": "YouTube's comment order: Top comments (default) or Newest first.",
            "default": "top"
          },
          "lang": {
            "title": "Caption language (Transcript)",
            "type": "string",
            "description": "Language code such as <code>en</code>, <code>es</code> or <code>pt-BR</code>. Creator captions win over auto-generated ones. Leave empty for English when the video has it, else the video's default track. A language the video has no captions in fails (free) and lists the languages it has."
          },
          "hl": {
            "title": "Interface language",
            "type": "string",
            "description": "Language YouTube writes relative dates and view counts in, e.g. <code>en</code>, <code>de</code>. Counts are parsed to numbers for English-style formats only.",
            "default": "en"
          },
          "gl": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code for YouTube content and rankings, e.g. <code>US</code>, <code>GB</code>, <code>IN</code>.",
            "default": "US"
          },
          "customRequests": {
            "title": "Custom requests (advanced)",
            "type": "array",
            "description": "Optional list of JSON objects, one request each, using the field names shown above. Each object is merged over the options above, so you only need to give what differs. Add <code>\"mode\"</code> to an object to mix modes; a comment thread's <code>replies_page_token</code> with mode <code>comments</code> reads its replies. Example: <code>{\"mode\":\"search\",\"q\":\"marathon training\",\"type\":\"video\",\"duration\":\"long\"}</code>"
          },
          "includeErrors": {
            "title": "Include failed requests in the dataset",
            "type": "boolean",
            "description": "When on, a request that fails (for example an unknown property id) is saved as a dataset item with an <code>error</code> message so you can see what went wrong. Failed requests are never charged.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many requests run at the same time (1-8). Parallel runs share one limit, so extra requests wait for a free slot instead of failing.",
            "default": 3
          },
          "maxRetries": {
            "title": "Retries per request",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "How many times a request that failed for a temporary reason is tried again right away. A request still failing then gets one more try at the end of the run, after a 30-second pause. Invalid input is never retried.",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}