{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper: Videos, Comments, Transcripts & Channels",
    "description": "Scrape YouTube videos, Shorts, live streams, channels, playlists, search results, comments and transcripts in one run. Engagement metrics, delta monitoring and optional AI summaries. No login, no YouTube API key. From $0.80 per 1,000 videos.",
    "version": "0.0",
    "x-build-id": "y6IhrvF46DfaZUO6T"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/prs_scraper~YouTube-Intelligence-Scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-prs_scraper-YouTube-Intelligence-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/prs_scraper~YouTube-Intelligence-Scraper/runs": {
      "post": {
        "operationId": "runs-sync-prs_scraper-YouTube-Intelligence-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/prs_scraper~YouTube-Intelligence-Scraper/run-sync": {
      "post": {
        "operationId": "run-sync-prs_scraper-YouTube-Intelligence-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": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Any mix of YouTube URLs or bare IDs: video (https://www.youtube.com/watch?v=dQw4w9WgXcQ), Short (/shorts/ID), live (/live/ID), channel (/@handle, /channel/UC…, /c/name, /user/name, optionally ending in /videos, /shorts, /streams, /playlists), playlist (/playlist?list=PL…), search results (/results?search_query=…), hashtag (/hashtag/python). Bare IDs work too: dQw4w9WgXcQ, UC_x5XG1OV2P6uZZ5FSM9Ttw, PL…, @handle. Unrecognised lines become INVALID_URL error records and do not stop the run.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to search on YouTube, e.g. 'python tutorial'. Each term is one source for maxVideos / maxShorts. The search filters below apply to these terms.",
            "items": {
              "type": "string"
            }
          },
          "maxVideos": {
            "title": "Max videos per source",
            "minimum": 0,
            "type": "integer",
            "description": "Long-form videos to collect from each channel, playlist or search. 0 = none. Example: 50.",
            "default": 50
          },
          "includeShorts": {
            "title": "Include Shorts",
            "type": "boolean",
            "description": "Off (default): no Shorts are collected from channels, searches, hashtags or playlists - only long-form videos. On: Shorts are collected too, up to 'Max Shorts per source'. A Shorts link you add yourself (/shorts/ID, a channel's /shorts tab) and Result type = Shorts (searches and channel URLs then return Shorts only) are always collected.",
            "default": false
          },
          "maxShorts": {
            "title": "Max Shorts per source",
            "minimum": 0,
            "type": "integer",
            "description": "Used when 'Include Shorts' is on: Shorts to collect from each channel, search or hashtag. Example: 20.",
            "default": 20
          },
          "maxStreams": {
            "title": "Max live streams per channel",
            "minimum": 0,
            "type": "integer",
            "description": "Past, current and upcoming live streams / premieres from each channel's Live tab. 0 = none. Example: 10.",
            "default": 0
          },
          "oldestPostDate": {
            "title": "Published after",
            "type": "string",
            "description": "Skip items published before this date. ISO date ('2025-01-31') or relative ('30 days', '2 weeks', '6 months'). Channel listings stop early once they reach older uploads, which saves requests."
          },
          "newestPostDate": {
            "title": "Published before",
            "type": "string",
            "description": "Skip items published after this date. ISO date ('2025-06-30') or relative ('7 days')."
          },
          "includeVideoDetails": {
            "title": "Full video details",
            "type": "boolean",
            "description": "On: likes, full description, tags, category, exact publish date, chapters. Off: fast listing mode (title, views, duration, thumbnail, relative date) - cheaper and much faster.",
            "default": true
          },
          "includeChannelInfo": {
            "title": "Channel records",
            "type": "boolean",
            "description": "Emit one channel record per channel (subscribers, total views, links, country, upload summary) instead of repeating channel data in every video.",
            "default": true
          },
          "includeComments": {
            "title": "Comments",
            "type": "boolean",
            "description": "Collect comments for every video in the same run (no second Actor needed).",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 0,
            "type": "integer",
            "description": "Top-level comments per video. Example: 100.",
            "default": 100
          },
          "includeReplies": {
            "title": "Comment replies",
            "type": "boolean",
            "description": "Also collect replies to each comment. Requires Comments.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "type": "integer",
            "description": "Example: 20.",
            "default": 20
          },
          "commentsSort": {
            "title": "Comment order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top comments (YouTube's ranking) or newest first.",
            "default": "top"
          },
          "includeTranscript": {
            "title": "Transcripts",
            "type": "boolean",
            "description": "Download existing captions (manual or auto-generated) for every video. No speech-to-text is run.",
            "default": false
          },
          "transcriptLanguages": {
            "title": "Transcript languages",
            "type": "array",
            "description": "Language codes in order of preference, e.g. ['en', 'en-GB', 'de']. The first available one is used.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "preferAutoGenerated": {
            "title": "Prefer auto-generated captions",
            "type": "boolean",
            "description": "By default manual captions win over auto-generated ones in the same language.",
            "default": false
          },
          "transcriptFormat": {
            "title": "Transcript format",
            "enum": [
              "segments",
              "text",
              "srt",
              "vtt"
            ],
            "type": "string",
            "description": "segments = list of {start, duration, text}; text = one plain string; srt / vtt = subtitle files as text.",
            "default": "segments"
          },
          "translateTranscriptTo": {
            "title": "Translate transcript to",
            "type": "string",
            "description": "Optional language code, e.g. 'de'. Uses YouTube's own caption translation when YouTube allows it; otherwise the original language is returned with isTranslated=false."
          },
          "includePlaylists": {
            "title": "Channel playlists",
            "type": "boolean",
            "description": "For channel sources, also emit a record for each of the channel's playlists.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "date",
              "views",
              "rating"
            ],
            "type": "string",
            "description": "Order of search results. Note: YouTube currently applies only relevance and views; date and rating are sent but YouTube returns its own order (checked 2026-11-04). For recent videos use Upload date.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only results uploaded within this period.",
            "default": "any"
          },
          "type": {
            "title": "Result type",
            "enum": [
              "any",
              "video",
              "short",
              "channel",
              "playlist",
              "movie"
            ],
            "type": "string",
            "description": "Only this kind of result. Shorts also applies to channel URLs: a channel then returns only its Shorts (up to 'Max Shorts per source'), even with 'Include Shorts' off.",
            "default": "any"
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "any",
              "under4",
              "4to20",
              "over20"
            ],
            "type": "string",
            "description": "Video length.",
            "default": "any"
          },
          "features": {
            "title": "Features",
            "uniqueItems": true,
            "type": "array",
            "description": "Results must have all selected features, e.g. ['hd', 'subtitles'].",
            "items": {
              "type": "string",
              "enum": [
                "live",
                "4k",
                "hd",
                "subtitles",
                "cc",
                "360",
                "vr180",
                "3d",
                "hdr",
                "location",
                "purchased"
              ],
              "enumTitles": [
                "Live",
                "4K",
                "HD",
                "Subtitles/CC",
                "Creative Commons",
                "360°",
                "VR180",
                "3D",
                "HDR",
                "Location",
                "Purchased"
              ]
            }
          },
          "gl": {
            "title": "Region",
            "type": "string",
            "description": "Two-letter country code for results and region-dependent data, e.g. 'US', 'IN', 'DE'.",
            "default": "US"
          },
          "hl": {
            "title": "Language",
            "type": "string",
            "description": "Interface language for titles and texts YouTube localises, e.g. 'en', 'de', 'pt-BR'.",
            "default": "en"
          },
          "channelSortBy": {
            "title": "Channel videos order",
            "enum": [
              "newest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Order in which a channel's videos, Shorts and streams are listed.",
            "default": "newest"
          },
          "deltaMode": {
            "title": "Only new items (delta mode)",
            "type": "boolean",
            "description": "Skip videos already collected by a previous run with the same state key. Ideal for scheduled monitoring.",
            "default": false
          },
          "stateName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of the key-value store that keeps state between runs, e.g. 'my-channel-monitor'. Use a different name for each monitoring task. Letters, digits and '-'. (Formerly 'stateKey', which is still accepted.)"
          },
          "trackStatChanges": {
            "title": "Track stat changes",
            "type": "boolean",
            "description": "In delta mode, also re-emit known videos with a statsDelta (views, likes, comments gained since the previous run). Requires delta mode.",
            "default": false
          },
          "aiEnabled": {
            "title": "Enable AI enrichment",
            "type": "boolean",
            "description": "Add an 'ai' object to videos with the selected tasks: one OpenAI-compatible chat call per video, using its title, description, transcript (if includeTranscript) and comments (if includeComments). A failed call sets ai.error; the video is always saved.",
            "default": false
          },
          "aiBaseUrl": {
            "title": "AI base URL",
            "type": "string",
            "description": "OpenAI-compatible endpoint, e.g. 'https://api.openai.com/v1' (the default). Only used with your own aiApiKey."
          },
          "aiApiKey": {
            "title": "AI API key",
            "type": "string",
            "description": "Key for the AI endpoint. Leave empty to use the Actor's hosted AI if the owner offers it (charged per enriched video); otherwise the run fails with a hint."
          },
          "aiModel": {
            "title": "AI model",
            "type": "string",
            "description": "Model name at the endpoint, e.g. 'gpt-4o-mini' (the default). Only used with your own aiApiKey."
          },
          "aiTasks": {
            "title": "AI tasks",
            "uniqueItems": true,
            "type": "array",
            "description": "What to compute for each video. Comment sentiment needs includeComments; sponsor segments and key moments need includeTranscript (with timestamps: transcriptFormat segments, srt or vtt).",
            "items": {
              "type": "string",
              "enum": [
                "summary",
                "topics",
                "sentiment_of_comments",
                "sponsor_segments",
                "key_moments"
              ],
              "enumTitles": [
                "Summary",
                "Topics / keywords",
                "Comment sentiment",
                "Sponsor segments",
                "Key moments"
              ]
            }
          },
          "aiMaxVideos": {
            "title": "Max videos to enrich",
            "minimum": 0,
            "type": "integer",
            "description": "AI enrichment is applied to at most this many videos per run.",
            "default": 50
          },
          "outputMode": {
            "title": "Output layout",
            "enum": [
              "flat",
              "nested"
            ],
            "type": "string",
            "description": "flat = one record per entity (video, channel, comment, transcript…) with a recordType field; nested = comments and transcript inside each video record.",
            "default": "flat"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. The run summary is POSTed here as JSON when the run finishes, e.g. 'https://example.com/hooks/youtube'."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}