{
  "openapi": "3.0.1",
  "info": {
    "title": "Youtube Scraper - Cheapest",
    "description": "Youtube Scraper collects video, Shorts and livestream data from YouTube search terms or URLs: title, views, likes, channel, subscribers, publish date and optional subtitles. Many filters. No API key or login. Export as JSON, CSV or Excel, or use the API.",
    "version": "0.1",
    "x-build-id": "tNDyCuHHzFOFj0nq8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/socialdataapi~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-socialdataapi-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/socialdataapi~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-socialdataapi-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/socialdataapi~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-socialdataapi-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": {
          "searchTerms": {
            "title": "🔍 Search terms",
            "type": "array",
            "description": "Enter one or more YouTube search keywords (for example \"Crawlee\", \"fitness workout\"). The actor will run a full scrape for each term and collect matching videos, shorts, and streams.",
            "items": {
              "type": "string"
            }
          },
          "maxVideos": {
            "title": "🎞️ Maximum videos per search term",
            "minimum": 0,
            "maximum": 9999,
            "type": "integer",
            "description": "Set how many regular (non‑Shorts, non‑live) videos to scrape for each search term. Use 0 to skip long‑form videos completely and focus only on Shorts or streams. Free plan: up to 20 items per run (all search terms, URLs, videos, Shorts and streams together) and 200 per month; paid plans have no limit.",
            "default": 10
          },
          "maxShorts": {
            "title": "📱 Maximum Shorts per search term",
            "minimum": 0,
            "maximum": 9999,
            "type": "integer",
            "description": "Control how many YouTube Shorts (vertical clips) to collect per keyword. Use 0 if you do not want to include Shorts in your dataset. Free plan: up to 20 items per run (all search terms, URLs, videos, Shorts and streams together) and 200 per month; paid plans have no limit.",
            "default": 0
          },
          "maxStreams": {
            "title": "📡 Maximum streams per search term",
            "minimum": 0,
            "maximum": 9999,
            "type": "integer",
            "description": "Limit how many live or upcoming streams are scraped for each search term. Use 0 to ignore live content entirely. Free plan: up to 20 items per run (all search terms, URLs, videos, Shorts and streams together) and 200 per month; paid plans have no limit.",
            "default": 0
          },
          "startUrls": {
            "title": "🔗 Direct URLs",
            "type": "array",
            "description": "Provide direct YouTube video/Shorts URLs (single video), channel URLs (e.g. youtube.com/@handle, /channel/UC..., /c/name, /user/name — expands to up to maxVideos videos + maxShorts Shorts from that channel), playlist URLs (?list=... — expands to up to maxVideos+maxShorts member videos), or a youtube.com/results?search_query=... URL (runs the same search flow as a searchTerms entry). Every discovered video gets the same full metadata as a search result.",
            "items": {
              "type": "string"
            }
          },
          "downloadSubtitles": {
            "title": "💬 Download subtitles",
            "type": "boolean",
            "description": "Download video subtitles/transcripts when available. When enabled, the actor will try to fetch caption tracks and optionally full transcripts for each scraped video.",
            "default": false
          },
          "saveSubtitlesToKvs": {
            "title": "🗄️ Save subtitles to key‑value store",
            "type": "boolean",
            "description": "When enabled, every downloaded transcript is stored in the default Apify key‑value store under its own key (e.g. \"transcript-VIDEO_ID\") so you can download large subtitle files separately from the main dataset.",
            "default": false
          },
          "subtitlesLanguage": {
            "title": "🌐 Subtitle language",
            "enum": [
              "en",
              "es",
              "fr",
              "de",
              "pt",
              "it",
              "ru",
              "ja",
              "ko",
              "zh",
              "ar",
              "hi",
              "bn",
              "tr",
              "pl",
              "nl",
              "sv",
              "id",
              "th",
              "vi"
            ],
            "type": "string",
            "description": "Choose the primary language for subtitles/transcripts (e.g. en, es, fr, de). The actor will look for this language first and fall back to available tracks where possible.",
            "default": "en"
          },
          "preferAutoGenerated": {
            "title": "⚙️ Prefer automatically generated subtitles",
            "type": "boolean",
            "description": "If turned on, the actor will prefer auto‑generated subtitles over manually uploaded caption tracks. This can increase coverage for less localized videos at the cost of some accuracy.",
            "default": false
          },
          "subtitlesFormat": {
            "title": "📄 Subtitle format",
            "enum": [
              "srt",
              "text",
              "timestamp"
            ],
            "type": "string",
            "description": "Decide how transcripts should look in the output: classic SRT (with timestamps), simple plain text, or structured timestamped JSON that is easy to post‑process programmatically.",
            "default": "srt"
          },
          "sortingOrder": {
            "title": "🧮 Sorting order",
            "enum": [
              "",
              "relevance",
              "date",
              "viewCount",
              "rating"
            ],
            "type": "string",
            "description": "Sort the final dataset by relevance (original order), upload date, view count, or rating. Applied as post-processing for reliable results.",
            "default": ""
          },
          "dateFilter": {
            "title": "🕒 Date filter",
            "enum": [
              "",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Apply YouTube’s built‑in \"Upload date\" filter: last hour, today, this week, this month, or this year — just like clicking the filter in the YouTube interface.",
            "default": ""
          },
          "videoTypeFilter": {
            "title": "📂 Video type filter",
            "enum": [
              "",
              "video"
            ],
            "type": "string",
            "description": "Filter search results to only standard long-form videos (excludes Shorts and live streams from the search-term flow). This filters the SEARCH results; to scrape a channel or playlist directly, add its URL under Direct URLs instead.",
            "default": ""
          },
          "lengthFilter": {
            "title": "⏱️ Length filter",
            "enum": [
              "",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Use YouTube’s length presets to keep only short clips, medium‑length videos, or long‑form content over 20 minutes.",
            "default": ""
          },
          "isHD": {
            "title": "📺 HD",
            "type": "boolean",
            "description": "Only include HD videos (720p or higher). The actor inspects YouTube's streaming formats to verify resolution before including the video.",
            "default": false
          },
          "hasCC": {
            "title": "📝 Subtitles / CC",
            "type": "boolean",
            "description": "Only include videos that have at least one proper closed‑caption track (not just auto‑generated). Great for accessibility‑critical workflows.",
            "default": false
          },
          "isCreativeCommons": {
            "title": "⚖️ Creative Commons",
            "type": "boolean",
            "description": "Filter for videos marked by YouTube as Creative Commons licensed. This can help discover content that is more remix‑friendly (always check final license conditions yourself).",
            "default": false
          },
          "is3D": {
            "title": "🕶️ 3D",
            "type": "boolean",
            "description": "Keep only stereoscopic 3D videos that YouTube flags as special 3D content.",
            "default": false
          },
          "isLive": {
            "title": "📺 Live only",
            "type": "boolean",
            "description": "Restrict results to live or live‑style content. Combine this with maxStreams to build focused dashboards of live events or streams.",
            "default": false
          },
          "isPurchased": {
            "title": "💳 Purchased content",
            "type": "boolean",
            "description": "Best-effort filter for purchased/paid content. YouTube rarely exposes this in scraped data, so results may be limited. Use for niche use cases only.",
            "default": false
          },
          "is4K": {
            "title": "🖥️ 4K only",
            "type": "boolean",
            "description": "Keep only videos that offer at least one 2160p (4K) stream in their available formats.",
            "default": false
          },
          "is360": {
            "title": "🌐 360° video",
            "type": "boolean",
            "description": "Filter results down to immersive 360° videos (spherical / equirectangular projection) that can be explored in all directions.",
            "default": false
          },
          "hasLocation": {
            "title": "📍 With location",
            "type": "boolean",
            "description": "Only keep videos where YouTube exposes explicit location metadata in the player response (for example city/country information).",
            "default": false
          },
          "isHDR": {
            "title": "🌈 HDR only",
            "type": "boolean",
            "description": "Limit the dataset to High Dynamic Range (HDR) videos, detected from color information and HDR‑specific flags in the available formats.",
            "default": false
          },
          "isVR180": {
            "title": "🥽 VR180 only",
            "type": "boolean",
            "description": "Filter for VR180 immersive content suitable for VR headsets when YouTube marks the video as VR180.",
            "default": false
          },
          "publishedAfter": {
            "title": "📆 Scrape videos published after (date)",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^$",
            "type": "string",
            "description": "Only include videos published after this date. Pick a date in the calendar (absolute format YYYY-MM-DD). Leave empty to include all dates.",
            "default": ""
          },
          "sortBy": {
            "title": "📊 Sort by (post‑processing)",
            "enum": [
              "",
              "date",
              "viewCount",
              "likes"
            ],
            "type": "string",
            "description": "After scraping, optionally sort the final dataset by a chosen field (date, viewCount, or likes) so that the default dataset view is ordered exactly how you like it.",
            "default": ""
          },
          "fetchMetadata": {
            "title": "🔧 Fetch full video metadata",
            "type": "boolean",
            "description": "When enabled (default), the actor opens each video's page to fill in likes, comments, subscriber count, full description, and other enrichment fields. Turn this off for a faster, lighter run that returns only the fields available directly from the search results (title, URL, thumbnail, view count, channel name).",
            "default": true
          },
          "maxPagesPerQuery": {
            "title": "🔢 Max pages per search term",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety limit on how many search-result pages the actor will paginate through for a single search term before stopping, even if `maxVideos`/`maxShorts`/`maxStreams` have not been reached yet.",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy configuration & anti‑blocking",
            "type": "object",
            "description": "Select the proxy setup for this actor. By default every request uses Apify's residential proxy group from the first attempt, with up to 3 retries on a fresh session if YouTube blocks the request; it only falls back to a direct connection if residential proxy access itself is unavailable on the account. Supplying your own proxy here overrides this and is used as-is."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}