{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Outlier Finder – Viral Videos vs Channel Median",
    "description": "YouTube outlier finder and viral video finder: spot videos that beat their channel's usual views with an outlier score (views ÷ channel median), velocity, AI thumbnail analysis and AI insights on what the outliers share, for channels or keyword searches. Tracks new outliers between runs.",
    "version": "0.1",
    "x-build-id": "ak5vErBwKTc57LqJw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/awsystems~youtube-outlier-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-awsystems-youtube-outlier-finder",
        "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/awsystems~youtube-outlier-finder/runs": {
      "post": {
        "operationId": "runs-sync-awsystems-youtube-outlier-finder",
        "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/awsystems~youtube-outlier-finder/run-sync": {
      "post": {
        "operationId": "run-sync-awsystems-youtube-outlier-finder",
        "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": {
          "channelUrls": {
            "title": "Channels",
            "type": "array",
            "description": "Channels to scan, one per line: https://www.youtube.com/@name, @name or https://www.youtube.com/channel/UC…",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Keyword searches",
            "type": "array",
            "description": "Find outliers in a niche: each search's results are scored against their own channel's usual views (the channel's latest 30 videos).",
            "items": {
              "type": "string"
            }
          },
          "videosPerChannel": {
            "title": "Latest videos per channel",
            "minimum": 10,
            "maximum": 500,
            "type": "integer",
            "description": "How many of each channel's latest videos to read and score (10 to 500). The median is computed over these.",
            "default": 50
          },
          "searchResults": {
            "title": "Results per search",
            "minimum": 5,
            "maximum": 100,
            "type": "integer",
            "description": "Videos taken from each keyword search (5 to 100).",
            "default": 20
          },
          "includeShorts": {
            "title": "Include Shorts",
            "type": "boolean",
            "description": "Also read each channel's latest Shorts. Shorts are compared only with the channel's other Shorts.",
            "default": false
          },
          "minOutlierScore": {
            "title": "Outlier threshold (× median)",
            "minimum": 1.5,
            "maximum": 100,
            "type": "number",
            "description": "A video is an outlier when its views are at least this many times the channel's median (1.5 to 100).",
            "default": 3
          },
          "onlyOutliers": {
            "title": "Only return outliers",
            "type": "boolean",
            "description": "Return (and pay for) only the videos above the threshold. Off: every video is returned with its score.",
            "default": false
          },
          "maxAgeDays": {
            "title": "Only videos from the last N days",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Return only videos published in the last N days (0 = any age). The median still uses all the videos read. Dates are approximate (as YouTube shows them: \"3 weeks ago\").",
            "default": 0
          },
          "analyzeThumbnails": {
            "title": "AI thumbnail analysis",
            "enum": [
              "outliers",
              "all",
              "none"
            ],
            "type": "string",
            "description": "Describe thumbnails with AI: faces, emotion, exact text, style, colors and the click hook. Charged per thumbnail.",
            "default": "outliers"
          },
          "aiInsights": {
            "title": "AI insights",
            "type": "boolean",
            "description": "For each channel and search, an AI summary of what the outliers share (titles, topics, formats, thumbnails, length) and 5 video ideas to replicate. Charged per channel or search.",
            "default": true
          },
          "outputLanguage": {
            "title": "Language of the AI text",
            "enum": [
              "English",
              "Spanish",
              "Portuguese",
              "French",
              "German",
              "Italian",
              "Dutch",
              "Polish",
              "Turkish",
              "Indonesian",
              "Japanese",
              "Korean",
              "Chinese",
              "Arabic",
              "Hindi",
              "Russian"
            ],
            "type": "string",
            "description": "Language of the insights and thumbnail descriptions. Titles and thumbnail text stay as written.",
            "default": "English"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}