{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Video Scraper — Views, Likes, Tags & Captions",
    "description": "Scrape YouTube video data from video URLs: title, channel, duration, upload date, view, like and comment counts, tags, thumbnail and description, plus caption text in your languages. Export JSON, CSV or Excel. No login and no video download. $0.005 per video or less, captions included.",
    "version": "0.1",
    "x-build-id": "g9KWkkCqC1e5szzOx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/andronixmd~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-andronixmd-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/andronixmd~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-andronixmd-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/andronixmd~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-andronixmd-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": {
          "urls": {
            "title": "YouTube video URLs",
            "maxItems": 1000,
            "type": "array",
            "description": "Public YouTube video links, one result per URL. Accepted forms: youtube.com/watch?v=…, youtu.be/…, youtube.com/shorts/…, /live/… and /embed/… (also m.youtube.com and music.youtube.com watch links). Channel and playlist URLs go in YouTube channels and playlists below; search and private video URLs are rejected. Submit up to 1,000 URLs, or leave this list empty and fill in channels and playlists or Dataset ID below.",
            "items": {
              "type": "string",
              "pattern": "^\\s*[Hh][Tt][Tt][Pp][Ss]://(?=[\\s\\S]{0,8184}\\s*$)(?:(?:(?:www|m|music)\\.)?youtube\\.com/watch\\?(?:[^#\\s]*&)?v=[A-Za-z0-9_-]{11}(?:&\\S*)?(?:#\\S*)?|(?:(?:(?:www|m|music)\\.)?youtube\\.com|(?:www\\.)?youtube-nocookie\\.com)/(?:embed|shorts|live|v)/[A-Za-z0-9_-]{11}/?(?:[?#]\\S*)?|youtu\\.be/[A-Za-z0-9_-]{11}(?:[/?#]\\S*)?)\\s*$"
            }
          },
          "includeCaptions": {
            "title": "Include captions text",
            "type": "boolean",
            "description": "Warning: caption_text can exceed 50,000 characters per video. To avoid overflow, read rows with limit 1, or turn this off when only metadata is needed. Adds caption_text (plain text) and caption_segments (timed lines) when the video has a caption track in one of your chosen languages. Read the whole caption_segments field (fields=caption_segments): dotted paths such as caption_segments.t0 return nothing. No audio is downloaded and no AI speech-to-text is run.",
            "default": true
          },
          "captionLanguages": {
            "title": "Caption languages",
            "maxItems": 10,
            "type": "array",
            "description": "Language codes in priority order, for example en, ru, pt-BR. The first language with an available caption track is returned; manual captions are preferred over auto-generated ones. Ignored when captions are off.",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$"
            },
            "default": [
              "en"
            ]
          },
          "channelUrls": {
            "title": "YouTube channels and playlists",
            "maxItems": 100,
            "type": "array",
            "description": "Channel URLs such as https://www.youtube.com/@TED, /channel/UC…, /c/… or /user/…, optionally ending in /videos, /shorts or /streams, and playlist URLs such as https://www.youtube.com/playlist?list=PL…. Each listed video is processed exactly like a video URL above, and each row names the channel or playlist it came from. Up to 100 sources. The example URL above is processed and charged too: remove it if you want only listed videos.",
            "items": {
              "type": "string",
              "pattern": "^\\s*[Hh][Tt][Tt][Pp][Ss]://(?=[\\s\\S]{0,8184}\\s*$)(?:(?:[wW][wW][wW]|[mM])\\.)?[yY][oO][uU][tT][uU][bB][eE]\\.[cC][oO][mM](?::443)?/(?:(?:@[\\w.%-]{1,150}|channel/UC[\\w-]{22}|c/[\\w.%-]{1,150}|user/[\\w.%-]{1,150})(?:/(?:videos|shorts|streams))?/?(?:[?#]\\S*)?|playlist/?\\?(?:[^#\\s]*&)?list=[\\w-]{10,64}(?:&\\S*)?(?:#\\S*)?)\\s*$"
            }
          },
          "channelTab": {
            "title": "Channel tab",
            "enum": [
              "videos",
              "shorts",
              "streams"
            ],
            "type": "string",
            "description": "Which tab of a channel to list when its URL names none. Playlists ignore it.",
            "default": "videos"
          },
          "maxItemsPerSource": {
            "title": "Max items per source",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "List at most this many of the newest videos from each source (up to 200). Each listed item is processed and billed like a URL you submit; listing itself is free. A run holds at most 1,000 items in total, counting URLs and dataset rows.",
            "default": 20
          },
          "publishedAfter": {
            "title": "Published on or after",
            "pattern": "^\\s*\\d{4}-\\d{2}-\\d{2}\\s*$",
            "type": "string",
            "description": "Optional date as YYYY-MM-DD (UTC); videos published before it are left out. Approximate: YouTube shows only relative ages (\"3 weeks ago\") on channel and playlist pages, so videos up to one such unit older can pass. Shorts carry no date and cannot be filtered. Only listed entries are filtered: a channel tab lists newest first, maxItemsPerSource deep; a playlist keeps its creator's order and is listed up to 200 entries deep, so newer videos further down are not found."
          },
          "datasetId": {
            "title": "Dataset ID",
            "pattern": "^\\s*(?:[A-Za-z0-9][A-Za-z0-9._-]{0,62}[~/])?[A-Za-z0-9-]{1,63}\\s*$",
            "type": "string",
            "description": "The example URL above is processed and charged too: remove it if you want only the dataset's items. Pick the dataset, or paste its ID, from another run that lists YouTube videos to get data and captions for every video in it. The Actor reads the rows with your run's own token and processes each row's URL like a URL above, after the listed URLs. Rows without a usable URL become uncharged error items. A named dataset works as username~dataset-name."
          },
          "datasetUrlField": {
            "title": "Dataset URL field",
            "pattern": "^\\s*[\\w$#@-]+(?:\\.[\\w$#@-]+)*\\s*$",
            "maxLength": 200,
            "type": "string",
            "description": "Optional. The row field that holds the URL, for example webVideoUrl, or a dotted path such as video.url. Leave it empty to use the first accepted URL from webVideoUrl, url, postUrl, videoUrl, inputUrl or link."
          },
          "maxItems": {
            "title": "Max dataset items",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Read at most this many dataset rows, in dataset order. A run processes at most 1,000 URLs in total, counting the list above.",
            "default": 100
          },
          "skipPreviouslyProcessed": {
            "title": "Skip items processed by earlier runs",
            "type": "boolean",
            "description": "Remember every item that was delivered and charged, in a key-value store in your Apify account, and skip those items in later runs. Use it with a schedule to get only new videos or episodes. Items that failed are tried again next time. When every item was already processed, the run ends without any charge. If the store cannot be read, the run stops before any charge and the next run tries again.",
            "default": false
          },
          "memoryKey": {
            "title": "Memory name",
            "pattern": "^\\s*[A-Za-z0-9](?:[A-Za-z0-9-]{0,23}[A-Za-z0-9])?\\s*$",
            "type": "string",
            "description": "Optional. Keeps a separate memory for this schedule, for example my-weekly-podcasts. The store is named polyglot-processed-youtube-scraper--<name>, and other Actors never share it; without a name every run of this Actor shares polyglot-processed-youtube-scraper. Delete the store in Apify Console (Storage, Key-value stores) to start over. Used only with the option above."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}