{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper & Monitor ($0.50/1K)",
    "description": "No login or API key. Scrape YouTube search, channels, Shorts, live streams, playlists and videos: exact views, likes, comments, publish date, tags, full description and subscribers. Add transcripts and comments, and monitor channels or searches for new videos with Slack or Discord alerts.",
    "version": "0.1",
    "x-build-id": "z0Iryb8bmhGdu8gbW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hydedata~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hydedata-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/hydedata~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-hydedata-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/hydedata~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-hydedata-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 terms",
            "type": "array",
            "description": "Search YouTube like you would in its search bar. Each term returns up to \"Max videos per search, channel or playlist\" videos, with the filters below.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "YouTube links",
            "type": "array",
            "description": "Videos, Shorts, channels (@handle, /channel/, /c/ or /user/ links, or a channel's /videos, /shorts or /streams tab), playlists and search result pages. Bare video IDs and @handles work too.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResults": {
            "title": "Max videos per search, channel or playlist",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Upper limit per search term, per channel tab and per playlist. Channels go newest first. Videos you link directly are always included.",
            "default": 20
          },
          "maxVideos": {
            "title": "Max videos per run",
            "minimum": 1,
            "type": "integer",
            "description": "Upper limit of videos delivered by the whole run. Leave empty for no limit."
          },
          "channelTabs": {
            "title": "Channel tabs",
            "type": "array",
            "description": "Which of a channel's tabs to scrape when you link the channel itself. Each tab gets its own limit. A link to one tab (youtube.com/@mkbhd/shorts) scrapes just that tab.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "streams"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Live streams"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "views"
            ],
            "type": "string",
            "description": "Relevance is YouTube's default order. View count puts the most watched first. For the newest videos, use Upload date below.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only videos uploaded in this window.",
            "default": "any"
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "any",
              "under4",
              "between4and20",
              "over20"
            ],
            "type": "string",
            "description": "Only videos of this length.",
            "default": "any"
          },
          "searchType": {
            "title": "Result type",
            "enum": [
              "video",
              "shorts"
            ],
            "type": "string",
            "description": "Regular videos, or Shorts only.",
            "default": "video"
          },
          "features": {
            "title": "Features",
            "type": "array",
            "description": "Only videos with all of these.",
            "items": {
              "type": "string",
              "enum": [
                "subtitles",
                "hd",
                "4k",
                "live",
                "creativeCommons",
                "hdr",
                "360",
                "vr180",
                "3d",
                "location",
                "purchased"
              ],
              "enumTitles": [
                "Subtitles/CC",
                "HD",
                "4K",
                "Live now",
                "Creative Commons",
                "HDR",
                "360°",
                "VR180",
                "3D",
                "Location",
                "Purchased"
              ]
            }
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "Only videos published on or after this date, or within this many days (e.g. 7 days). Channel tabs stop reading once they're past it."
          },
          "minViews": {
            "title": "At least this many views",
            "minimum": 0,
            "type": "integer",
            "description": "Drop videos with fewer views. Live streams have no view count yet and are kept."
          },
          "includeDetails": {
            "title": "Video details",
            "type": "boolean",
            "description": "Exact views, likes, comment count, publish date, full description, tags, hashtags and the channel's subscriber count. Included at no extra cost. Turn off for faster listings with just what search and channel pages show.",
            "default": true
          },
          "includeTranscript": {
            "title": "Transcripts",
            "type": "boolean",
            "description": "The video's captions as text: uploaded by the creator when there are some, else YouTube's auto-generated ones. Charged per video that gets one. Videos without captions are free.",
            "default": false
          },
          "transcriptLanguages": {
            "title": "Transcript languages",
            "type": "array",
            "description": "Language codes in order of preference (e.g. en, es, de). en matches every English track (en-US, en-GB).",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "transcriptAnyLanguage": {
            "title": "Fall back to the spoken language",
            "type": "boolean",
            "description": "When a video has none of your languages, get its captions in the language spoken in it instead of none.",
            "default": true
          },
          "transcriptAutoGenerated": {
            "title": "Allow auto-generated captions",
            "type": "boolean",
            "description": "Use YouTube's automatic captions when the creator didn't upload any. Most videos only have those.",
            "default": true
          },
          "transcriptFormat": {
            "title": "Transcript format",
            "enum": [
              "text",
              "timestamped",
              "srt",
              "vtt"
            ],
            "type": "string",
            "description": "Plain text is always included. Timestamped adds every line with its start time and duration. SRT and VTT add a ready subtitle file as text.",
            "default": "text"
          },
          "maxComments": {
            "title": "Comments per video",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Top-level comments to include per video: text, likes, reply count, when posted, pinned, and whether the channel owner wrote it. Commenters' names aren't collected. Charged per comment. 0 turns comments off.",
            "default": 0
          },
          "commentsSort": {
            "title": "Comment order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top comments as YouTube ranks them, or the newest first.",
            "default": "top"
          },
          "monitorMode": {
            "title": "Monitor mode (new videos only)",
            "type": "boolean",
            "description": "Remembers what each search, channel and playlist returned and only outputs videos that are new since the last run. Use with a Schedule. The first run returns the current videos as the baseline. Runs that find nothing new cost nothing but the start.",
            "default": false
          },
          "notifyWebhookUrl": {
            "title": "Send new videos to a webhook (optional)",
            "type": "string",
            "description": "Paste a Discord or Slack incoming webhook URL to get each run's videos as a message with thumbnails. Any other URL gets the rows as JSON. Only sent when the run delivers something; in monitor mode the first run's baseline isn't sent."
          },
          "stateStoreName": {
            "title": "Monitor state store name",
            "type": "string",
            "description": "Named key-value store that keeps monitor memory between runs. Use different names to run independent monitors.",
            "default": "youtube-monitor-state"
          },
          "stateRetentionDays": {
            "title": "Forget sources after (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Searches, channels and playlists not checked for this many days are dropped from monitor memory.",
            "default": 90
          },
          "maxConcurrency": {
            "title": "Videos at once",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Videos fetched at the same time, each request on its own proxy IP.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify datacenter proxies work for YouTube. When YouTube asks a datacenter IP to sign in before listing a video's captions, the Actor retries that one request on a residential IP by itself.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}