{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper",
    "description": "YouTube videos, channels and playlists without an API key or quota: views, likes, comments, tags, duration, date and subscriber count, plus full transcripts in plain text, SRT or VTT. List mode returns 50 videos per request. Example: 'lofi hip hop', 10 videos with transcripts.",
    "version": "1.0",
    "x-build-id": "HXe5VYxgpIUTk9B9m"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/badr_xba~youtube-data-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-badr_xba-youtube-data-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/badr_xba~youtube-data-scraper/runs": {
      "post": {
        "operationId": "runs-sync-badr_xba-youtube-data-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/badr_xba~youtube-data-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-badr_xba-youtube-data-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": "Keywords as you would type them in YouTube search, one per line: \"lofi hip hop\", \"python tutorial\", \"iphone 17 review\". Leave empty if you only want channels, videos or playlists.",
            "items": {
              "type": "string"
            }
          },
          "channelUrls": {
            "title": "📺 Channels",
            "type": "array",
            "description": "Channel URLs, @handles or channel IDs: https://www.youtube.com/@LofiGirl, @LofiGirl, LofiGirl, UCSJ4gkVC6NrvII8umztf0Ow, /c/ or /user/ links. Returns the channel profile row plus its latest videos. You can paste several per line (comma or new line); duplicates are removed.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "videoUrls": {
            "title": "🎬 Videos",
            "type": "array",
            "description": "URLs or 11-character IDs of specific videos: https://www.youtube.com/watch?v=dQw4w9WgXcQ, https://youtu.be/dQw4w9WgXcQ, https://www.youtube.com/shorts/aqz-KE-bpKQ, live links or just dQw4w9WgXcQ. Several per line are fine.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "playlistUrls": {
            "title": "📃 Playlists",
            "type": "array",
            "description": "Playlist URLs or IDs: https://www.youtube.com/playlist?list=PL…, a watch link containing &list=PL…, or the bare PL… ID. Returns the playlist's videos.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxVideosPerSource": {
            "title": "Maximum videos per source",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "How many videos to read per search, channel or playlist. In full-detail mode each video is one request; list mode returns up to fifty videos per request.",
            "default": 10
          },
          "maxItems": {
            "title": "Maximum results for the whole run",
            "minimum": 0,
            "type": "integer",
            "description": "Hard ceiling on rows saved (and billed) for the whole run — videos, channel rows and comments together. 0 = no ceiling. The run also stops cleanly when your maximum cost per run is reached.",
            "default": 0
          },
          "videoDetails": {
            "title": "How much detail per video",
            "enum": [
              "full",
              "listing"
            ],
            "type": "string",
            "description": "YouTube returns a list of fifty videos in a single request, but without likes, comment counts or the exact publication date — those live on the video's own page, one request each. Full detail is the default; the list mode is about eighty times faster when you only need titles, views, durations and channels.",
            "default": "full"
          },
          "includeChannelDetails": {
            "title": "Add channel data to every video",
            "type": "boolean",
            "description": "Adds channel subscribers, the average views of its 30 latest videos, and performanceVsChannel to each video. One extra request per channel, cached.",
            "default": true
          },
          "includeComments": {
            "title": "Get comments",
            "type": "boolean",
            "description": "Adds the top comments of each video as separate rows (type \"comment\"): text, author, likes, date, pinned. Each comment row is a billed result.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Maximum comments per video",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many comments to read per video, best ones first.",
            "default": 20
          },
          "startUrls": {
            "title": "🔗 Start URLs (any type)",
            "type": "array",
            "description": "One field for everything: video, Short, channel, playlist, hashtag or search-results links, @handles, video IDs — or plain words, which are searched like in the YouTube search bar. The type of each item is detected automatically; anything that is not YouTube is listed in FAILED_INPUTS (not billed).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResultsShorts": {
            "title": "Maximum Shorts",
            "minimum": 0,
            "type": "integer",
            "description": "Separate cap for Shorts. Empty means no specific cap."
          },
          "maxResultStreams": {
            "title": "Maximum live streams",
            "minimum": 0,
            "type": "integer",
            "description": "Separate cap for live streams and replays. Empty means no specific cap."
          },
          "hasSubtitles": {
            "title": "Only videos with subtitles",
            "type": "boolean",
            "description": "Keep only videos for which the channel published subtitles.",
            "default": false
          },
          "lengthFilter": {
            "title": "Duration",
            "enum": [
              "",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Filter on video length.",
            "default": ""
          },
          "includeTranscript": {
            "title": "Get the transcript",
            "type": "boolean",
            "description": "Adds the full spoken text, from the channel's published subtitles or, failing that, YouTube's automatic captions. Useful for content analysis, keyword research or an AI summary.",
            "default": false
          },
          "transcriptLanguage": {
            "title": "Transcript language",
            "type": "string",
            "description": "Two-letter language code (en, fr, ar…). Empty: the video language, then English, then the first available track."
          },
          "subtitlesFormat": {
            "title": "Transcript format",
            "enum": [
              "text",
              "srt",
              "vtt"
            ],
            "type": "string",
            "description": "Plain text for analysis and AI, SRT or VTT if you need timecodes.",
            "default": "text"
          },
          "preferAutoGeneratedSubtitles": {
            "title": "Prefer automatic subtitles",
            "type": "boolean",
            "description": "By default the channel’s own subtitles win. Switch on to use YouTube's automatic captions first, often closer to the spoken words.",
            "default": false
          },
          "saveSubsToKVS": {
            "title": "Save subtitles as files",
            "type": "boolean",
            "description": "Stores one subtitle file per video in the run's storage, in addition to the field in the results.",
            "default": false
          },
          "maxTranscriptChars": {
            "title": "Maximum transcript length",
            "minimum": 0,
            "type": "integer",
            "description": "0 means the whole text. Useful to keep files small on long videos.",
            "default": 0
          },
          "anonymizeComments": {
            "title": "Anonymise comments",
            "type": "boolean",
            "description": "Removes each comment author's name and link, keeping only the text. Switch on when your processing must contain no personal data (GDPR).",
            "default": false
          },
          "videoType": {
            "title": "Video type",
            "enum": [
              "all",
              "videos",
              "shorts",
              "live"
            ],
            "type": "string",
            "description": "Filter on format and length.",
            "default": "all"
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only videos with at least this many views."
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only videos with at least this many likes."
          },
          "maxAgeDays": {
            "title": "Published within the last (days)",
            "minimum": 1,
            "type": "integer",
            "description": "For example 30 to keep only videos from the last month."
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "ISO date, e.g. 2026-01-01."
          },
          "titleKeywords": {
            "title": "Title contains",
            "type": "array",
            "description": "Keep only videos whose title contains one of these words.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Title excludes",
            "type": "array",
            "description": "Exclude videos whose title contains one of these words.",
            "items": {
              "type": "string"
            }
          },
          "order": {
            "title": "Sort searches",
            "enum": [
              "relevance",
              "date",
              "viewCount"
            ],
            "type": "string",
            "description": "Order of results for keyword searches.",
            "default": "relevance"
          },
          "regionCode": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code to steer results (US, FR, MA…)."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Two-letter language code to steer results and texts (fr, ar, en…)."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Off by default. If YouTube starts refusing requests (\"confirm you're not a bot\"), switch on Apify Proxy: each retry then uses a new IP address.",
            "default": {
              "useApifyProxy": false
            }
          },
          "maxConcurrency": {
            "title": "Videos read in parallel",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many videos are read at the same time. Each video is one yt-dlp extraction, so this sets the pace. Above 8, raise the run memory as well.",
            "default": 8
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}