{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper - Videos, Shorts, Channels & Playlists",
    "description": "[$1.5/1000] Scrape YouTube videos, shorts, live streams, channels and playlists from links or @handles: views, likes, tags, chapters, captions list, related videos and channel stats. No key needed; your own free API key adds comments and full pagination.",
    "version": "0.1",
    "x-build-id": "gCnid5s3wUv5wgdwR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/amethys~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-amethys-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/amethys~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-amethys-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/amethys~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-amethys-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": {
          "targets": {
            "title": "Videos, channels, shorts or playlists",
            "type": "array",
            "description": "Any mix of YouTube links or IDs, detected automatically: video links (watch, youtu.be, /shorts/, /live/), 11-character video IDs, channel links (/@handle, /channel/UC..., /c/..., /user/...), bare @handles, channel IDs (UC...), and playlist links or IDs (PL...).",
            "items": {
              "type": "string"
            }
          },
          "channelTabs": {
            "title": "Channel tabs",
            "type": "array",
            "description": "Which channel tabs to scrape for every channel target. Without an API key each tab returns its first page (about 30 videos, 48 shorts, 30 streams or 30 playlists).",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "streams",
                "playlists"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Live / past streams",
                "Playlists"
              ]
            },
            "default": [
              "videos",
              "shorts"
            ]
          },
          "maxVideosPerTab": {
            "title": "Max items per channel tab",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper limit per channel tab. Without an API key the first page is the ceiling; with your own key the actor paginates up to this number.",
            "default": 30
          },
          "includeChannelAbout": {
            "title": "Save channel profile",
            "type": "boolean",
            "description": "Save one channel item per channel: subscribers, total views, video count, joined date, country, links, description, avatar, banner and verified badge.",
            "default": true
          },
          "maxPlaylistVideos": {
            "title": "Max videos per playlist",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Without an API key the playlist page lists its first 100 videos; with your own key the actor paginates up to this number.",
            "default": 100
          },
          "scrapeVideoDetails": {
            "title": "Open every video for full detail",
            "type": "boolean",
            "description": "Open the watch page of every listed video: exact views and likes, full description and links, tags, category, publish date, chapters, caption languages, channel info and related videos. Turn off for faster, card-level results. Single video targets are always opened.",
            "default": true
          },
          "includeRelatedVideos": {
            "title": "Include related videos",
            "type": "boolean",
            "description": "Add the ~20 related videos shown next to each video (title, channel, views, duration).",
            "default": true
          },
          "youtubeApiKey": {
            "title": "Your YouTube Data API key (optional)",
            "type": "string",
            "description": "Your own free key for the official YouTube Data API v3 (Google Cloud Console > APIs & Services > enable 'YouTube Data API v3' > Credentials > Create API key). It unlocks comments with replies, every video of a channel tab or playlist, exact statistics and most-popular charts. Most calls cost 1 quota unit of your 10,000 free daily units. Stored encrypted."
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video (needs API key)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Top-level comments to save inside each video item (author, text, likes, date). 0 = no comments. 1 quota unit per 100 comments.",
            "default": 0
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment (needs API key)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Replies to keep under each comment. Up to 5 come free with the comment; more cost 1 quota unit per 100 replies. 0 = no replies.",
            "default": 0
          },
          "commentsOrder": {
            "title": "Comment order",
            "enum": [
              "relevance",
              "time"
            ],
            "type": "string",
            "description": "Order of top-level comments: YouTube's top comments or newest first.",
            "default": "relevance"
          },
          "trendingRegions": {
            "title": "Most-popular chart regions (needs API key)",
            "type": "array",
            "description": "Two-letter country codes (US, ID, GB, IN, ...). Saves YouTube's official most-popular videos for each region, with rank. YouTube retired the Trending page in 2025; this chart is its API counterpart.",
            "items": {
              "type": "string"
            }
          },
          "trendingCategoryId": {
            "title": "Most-popular category ID",
            "type": "string",
            "description": "Optional video category ID for the chart, e.g. 10 = Music, 20 = Gaming, 17 = Sports, 25 = News & Politics, 24 = Entertainment."
          },
          "maxTrendingPerRegion": {
            "title": "Max chart videos per region",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many chart videos to save per country (up to 200).",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Not needed in most runs. If YouTube starts asking to 'confirm you're not a bot', switch to a residential proxy."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}