{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper – Videos, Comments & Channels (no browser)",
    "description": "Scrape YouTube search results, channel videos/Shorts/live and video URLs via YouTube's own JSON API: views, duration, dates, likes, tags, chapters, comments with replies and channel info. Filters before charging, shared cache, no browser, no API key.",
    "version": "1.0",
    "x-build-id": "6vaZJ4CYsCc9aUNbW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/budoucnost-ai~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-budoucnost-ai-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/budoucnost-ai~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-budoucnost-ai-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/budoucnost-ai~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-budoucnost-ai-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 queries",
            "type": "array",
            "description": "YouTube search terms, one per line. Each query is a separate source (see maxItemsPerSource). Searches always return videos (no playlists/channels); use sortBy, uploadDate, durationFilter and features to narrow them on YouTube’s side.",
            "items": {
              "type": "string"
            }
          },
          "channelUrls": {
            "title": "Channels",
            "type": "array",
            "description": "Channel URL (https://www.youtube.com/@veritasium, /channel/UC…, /c/name), @handle or UC… channel id. Lists the Videos tab (newest first, or most popular with sortBy = views), plus the Shorts and Live tabs when includeShorts / includeLive are on.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs",
            "type": "array",
            "description": "Individual videos: watch, youtu.be, /shorts/, /live/ URLs or 11-character video ids. Combine with includeComments to scrape comments of known videos.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max videos (total)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many video rows across all sources. Comments and channel rows are not counted here (see maxCommentsPerVideo).",
            "default": 50
          },
          "maxItemsPerSource": {
            "title": "Max videos per query/channel",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "0 = only the total limit applies.",
            "default": 0
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "date",
              "views",
              "rating"
            ],
            "type": "string",
            "description": "Sent to YouTube. For channels, \"views\" switches to the Popular chip, anything else lists newest first. YouTube treats date/rating sorting as a hint, not a strict order.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "YouTube search filter, also enforced client-side (on channels too) before charging.",
            "default": "any"
          },
          "durationFilter": {
            "title": "Length (YouTube filter)",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "YouTube search filter. For exact limits use minDurationSec / maxDurationSec.",
            "default": "any"
          },
          "features": {
            "title": "Features (YouTube filter)",
            "type": "array",
            "description": "Search only: videos must have all selected features.",
            "items": {
              "type": "string",
              "enum": [
                "hd",
                "4k",
                "subtitles",
                "creativeCommons",
                "live",
                "360",
                "vr180",
                "3d",
                "hdr",
                "location",
                "purchased"
              ],
              "enumTitles": [
                "HD",
                "4K",
                "Subtitles/CC",
                "Creative Commons",
                "Live",
                "360°",
                "VR180",
                "3D",
                "HDR",
                "Location",
                "Purchased"
              ]
            },
            "default": []
          },
          "country": {
            "title": "Country (gl)",
            "type": "string",
            "description": "Two-letter region for search results and trending context, e.g. US, CZ, DE. Texts stay in English so counts and dates parse reliably.",
            "default": "US"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "ISO date (2026-01-31) or relative (\"30 days\", \"6 months\"). Without the details add-on, YouTube's relative date (\"3 weeks ago\") is used conservatively; with it, the exact publish date. On channels the listing stops paging once videos are older."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "ISO date or relative (\"1 year\")."
          },
          "minViews": {
            "title": "Min views",
            "minimum": 0,
            "type": "integer",
            "description": "0 = off.",
            "default": 0
          },
          "maxViews": {
            "title": "Max views",
            "minimum": 0,
            "type": "integer",
            "description": "0 = off. Useful to find small, emerging videos.",
            "default": 0
          },
          "minDurationSec": {
            "title": "Min duration (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "0 = off.",
            "default": 0
          },
          "maxDurationSec": {
            "title": "Max duration (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "0 = off.",
            "default": 0
          },
          "includeShorts": {
            "title": "Include Shorts",
            "type": "boolean",
            "description": "Shorts from search shelves and the channel Shorts tab. Shorts in listings have no channel/duration/date unless the details add-on is on.",
            "default": true
          },
          "includeLive": {
            "title": "Include live & upcoming",
            "type": "boolean",
            "description": "Live streams, premieres and scheduled streams (channel Live tab included).",
            "default": true
          },
          "includeRegex": {
            "title": "Include regex",
            "type": "string",
            "description": "Keep only videos whose title, channel name or description (snippet, or full description with the details add-on) match. Case-insensitive."
          },
          "excludeRegex": {
            "title": "Exclude regex",
            "type": "string",
            "description": "Drop videos matching this regex (same text as includeRegex)."
          },
          "excludeIds": {
            "title": "Exclude video ids",
            "type": "array",
            "description": "Video ids or URLs to skip, e.g. those you already have from a previous run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeVideoDetails": {
            "title": "Video details add-on",
            "type": "boolean",
            "description": "Full description, tags/keywords, hashtags, like count, comment count, category, exact publish date, chapters, channel subscriber count and verified flag. Two extra requests per video; charged as video-details per video.",
            "default": false
          },
          "includeComments": {
            "title": "Comments",
            "type": "boolean",
            "description": "Scrape comments of every returned video (charged per comment).",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Including replies.",
            "default": 20
          },
          "commentsSort": {
            "title": "Comments order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top comments (YouTube ranking, pinned first) or newest first.",
            "default": "top"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Fetch reply threads (rows have parentId). Counted in maxCommentsPerVideo.",
            "default": false
          },
          "includeChannelInfo": {
            "title": "Channel info add-on",
            "type": "boolean",
            "description": "One channel row per channel: subscribers, total views, video count, country, joined date, description, external links, avatar, banner. Charged as channel-info per channel.",
            "default": false
          },
          "cacheHours": {
            "title": "Cache (hours)",
            "minimum": 0,
            "maximum": 720,
            "type": "integer",
            "description": "Reuse listing pages, video details and channel info fetched within this many hours (named store youtube-scraper-cache in your account). 0 = always fresh, also disables the shared cache.",
            "default": 24
          },
          "useSharedCache": {
            "title": "Use shared cache",
            "type": "boolean",
            "description": "Also read video details and channel info that any user of this actor fetched recently (public data only, never search listings or anything about you). Faster, fewer blocks.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Parallel requests. Lower it if you see blocked rows.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify datacenter proxy by default. Residential is your choice if YouTube blocks datacenter IPs.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}