{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper: Outlier Videos, Channels, Comments & Alerts",
    "description": "Videos and Shorts of any YouTube channel, search or playlist, each scored against its channel: views per hour and an outlier score (views over the channel's median), with a filter for breakout videos. New-video alerts, subscribers, comments. No API key. $1 per 1,000 videos.",
    "version": "0.1",
    "x-build-id": "hWVqySuOMtjXubSzd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pikoulas~youtube/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pikoulas-youtube",
        "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/pikoulas~youtube/runs": {
      "post": {
        "operationId": "runs-sync-pikoulas-youtube",
        "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/pikoulas~youtube/run-sync": {
      "post": {
        "operationId": "run-sync-pikoulas-youtube",
        "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": {
          "videos": {
            "title": "Videos and Shorts",
            "type": "array",
            "description": "Video or Shorts URLs or IDs: watch, youtu.be, Shorts, embed and live links all work. These read YouTube's player, which usually stops the run on Apify's IPs.",
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Channel URLs, @handles or channel IDs (UC...). Gives the channel's details and its videos, Shorts and live streams, as set below.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerChannel": {
            "title": "Max videos per channel",
            "minimum": 0,
            "type": "integer",
            "description": "Videos from each channel's Videos tab. 0 for none.",
            "default": 50
          },
          "maxShortsPerChannel": {
            "title": "Max Shorts per channel",
            "minimum": 0,
            "type": "integer",
            "description": "Shorts from each channel's Shorts tab. 0 for none.",
            "default": 0
          },
          "maxStreamsPerChannel": {
            "title": "Max live streams per channel",
            "minimum": 0,
            "type": "integer",
            "description": "Past, current and upcoming streams from each channel's Live tab. 0 for none.",
            "default": 0
          },
          "channelSort": {
            "title": "Channel videos order",
            "enum": [
              "newest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "The order the channel's tabs are read in: newest, most popular or oldest first.",
            "default": "newest"
          },
          "minOutlierScore": {
            "title": "Outliers only: min outlier score",
            "minimum": 0,
            "type": "number",
            "description": "Only videos with at least this many times their channel's median views (of its latest 30 uploads of the kind), such as 3 for breakouts. The video limits then count the videos checked, and only those given are charged."
          },
          "onlyNew": {
            "title": "New videos only",
            "type": "boolean",
            "description": "Leave out videos an earlier run with the same memory gave, and they aren't charged: schedule it for new-video alerts on channels or searches. The video limits then count the videos checked. Channels still come, with subscribersChange since the last run.",
            "default": false
          },
          "memory": {
            "title": "Memory name",
            "type": "string",
            "description": "One per alert, so two schedules don't share a memory. Kept in your account's key-value store youtube-memory; a video not listed for 180 days is forgotten.",
            "default": "default"
          },
          "includeChannelDetails": {
            "title": "Include channel details",
            "type": "boolean",
            "description": "One item per channel: subscribers, video and view counts, description, links, country, join date.",
            "default": true
          },
          "playlists": {
            "title": "Playlists",
            "type": "array",
            "description": "Playlist URLs or IDs (PL...).",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerPlaylist": {
            "title": "Max videos per playlist",
            "minimum": 1,
            "type": "integer",
            "description": "How many videos to take from each playlist.",
            "default": 100
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords searched on YouTube, results in YouTube's order.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerSearch": {
            "title": "Max results per search",
            "minimum": 1,
            "type": "integer",
            "description": "How many videos or Shorts to take from each search.",
            "default": 50
          },
          "searchType": {
            "title": "Search for",
            "enum": [
              "videos",
              "shorts",
              "all"
            ],
            "type": "string",
            "description": "Videos only, Shorts only, or both as YouTube mixes them.",
            "default": "videos"
          },
          "searchSort": {
            "title": "Search order",
            "enum": [
              "relevance",
              "popularity"
            ],
            "type": "string",
            "description": "YouTube's two orders: relevance, or popularity (views).",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Uploaded",
            "enum": [
              "any",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Search filter on the upload date.",
            "default": "any"
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Search filter on the length.",
            "default": "any"
          },
          "features": {
            "title": "Features",
            "type": "array",
            "description": "Search filters: only results with all of these.",
            "items": {
              "type": "string",
              "enum": [
                "live",
                "4k",
                "hd",
                "subtitles",
                "creativeCommons",
                "360",
                "vr180",
                "3d",
                "hdr",
                "location",
                "purchased"
              ],
              "enumTitles": [
                "Live",
                "4K",
                "HD",
                "Subtitles/CC",
                "Creative Commons",
                "360°",
                "VR180",
                "3D",
                "HDR",
                "Location",
                "Purchased"
              ]
            }
          },
          "includeVideoDetails": {
            "title": "Include video details",
            "type": "boolean",
            "description": "Exact views, likes, publish date, description, tags, category, comment count and the channel's subscribers, from YouTube's player. It usually asks Apify's IPs to confirm they aren't bots, and the run then stops there and keeps what it has. Off: the title, rounded views, approximate date and duration channel tabs, playlists and search show.",
            "default": false
          },
          "publishedAfter": {
            "title": "Published after",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Only videos published on or after this date (YYYY-MM-DD). With channels sorted newest first, the run stops reading a tab once it gets past it."
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 0,
            "type": "integer",
            "description": "Comments per video, replies included. 0 for none.",
            "default": 0
          },
          "commentsSort": {
            "title": "Comments order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top comments first, or newest first.",
            "default": "top"
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "type": "integer",
            "description": "Replies to take under each comment. 0 for none.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}