{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Outlier Finder: Breakout Videos vs Channel Median",
    "description": "Find YouTube videos that beat their channel's median views. Score channels or a search term, filter by days back and minimum score, and get views per day, publish date, duration and rank. A Shorts mode scores each channel's Shorts. Empty input runs an example of up to 10 rows.",
    "version": "0.1",
    "x-build-id": "Kgk6EzkbSRfvI3odk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automatic~youtube-outlier-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automatic-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/automatic~youtube-outlier-finder/runs": {
      "post": {
        "operationId": "runs-sync-automatic-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/automatic~youtube-outlier-finder/run-sync": {
      "post": {
        "operationId": "run-sync-automatic-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": {
          "contentType": {
            "title": "Content type",
            "enum": [
              "long",
              "shorts"
            ],
            "type": "string",
            "description": "long (default) scores long-form uploads from channels and search. shorts scores each channel's Shorts against its own recent Shorts; it reads channels only, so a search term with shorts stops the run.",
            "default": "long"
          },
          "channels": {
            "title": "Channels",
            "maxItems": 500,
            "type": "array",
            "description": "Channel links, @handles or channel IDs, for example https://www.youtube.com/@mkbhd, @mkbhd or UCBJycsmduvYEL83R_U4JriQ. Paste up to 500 channels one per line or send an array; duplicate channels are read once. Every upload in the lookback window is scored. Shorts mode reads channels only.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Search term",
            "type": "string",
            "description": "Find recent videos on a topic, then score each one against its own channel. Combine with Channels or use on its own. Leave Channels and Search term empty to run the 10-row example."
          },
          "lookbackDays": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Only uploads published within this many days are scored. Shorts mode needs at least 3.",
            "default": 30
          },
          "minOutlierScore": {
            "title": "Minimum outlier score",
            "minimum": 0,
            "maximum": 1000,
            "type": "number",
            "description": "Keep only videos with at least this many times their channel's median views. 0 keeps every recent upload, ranked; 2 keeps videos with double the usual views.",
            "default": 0
          },
          "maxResults": {
            "title": "Maximum videos",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many top-ranked videos to return for the whole run. With no channels and no search term, the example run returns at most 10.",
            "default": 20
          },
          "baselineVideos": {
            "title": "Uploads in the channel baseline",
            "minimum": 5,
            "maximum": 90,
            "type": "integer",
            "description": "How many of each channel's latest long-form uploads make up its median views. In Shorts mode: how many of its Shorts old enough for the baseline (at least 11).",
            "default": 30
          },
          "searchSort": {
            "title": "Search order",
            "enum": [
              "relevance",
              "uploadDate",
              "viewCount"
            ],
            "type": "string",
            "description": "Which videos the search term brings back before scoring: YouTube's relevance ranking, the newest uploads or the most viewed.",
            "default": "relevance"
          },
          "baselineMinAgeDays": {
            "title": "Shorts: minimum baseline age (days)",
            "minimum": 0,
            "maximum": 14,
            "type": "integer",
            "description": "Shorts mode only. Shorts younger than this stay out of the channel baseline (they can still be returned).",
            "default": 3
          },
          "baselineMaxAgeDays": {
            "title": "Shorts: maximum baseline age (days)",
            "minimum": 30,
            "maximum": 730,
            "type": "integer",
            "description": "Shorts mode only. When the oldest Short in the baseline is older than this, the channel's Shorts are reported as uncertain instead of returned.",
            "default": 365
          },
          "maxTabPagesPerChannel": {
            "title": "Shorts: tab pages per channel",
            "minimum": 1,
            "maximum": 2,
            "type": "integer",
            "description": "Shorts mode only. How many pages of each channel's Shorts tab may be read (48 Shorts a page).",
            "default": 2
          },
          "maxDateLookupsPerChannel": {
            "title": "Shorts: date checks per channel",
            "minimum": 2,
            "maximum": 16,
            "type": "integer",
            "description": "Shorts mode only. How many Shorts per channel may be opened to find their publish day for the baseline.",
            "default": 8
          },
          "maxConfirmationsPerChannel": {
            "title": "Shorts: candidates checked per channel",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Shorts mode only. How many promising Shorts per channel are opened to check their exact views, day and owner.",
            "default": 10
          },
          "maxRequestsPerChannel": {
            "title": "Shorts: requests per channel",
            "minimum": 5,
            "maximum": 80,
            "type": "integer",
            "description": "Shorts mode only. Hard limit on requests to YouTube for one channel.",
            "default": 30
          },
          "maxBytesPerChannel": {
            "title": "Shorts: MB per channel",
            "minimum": 2,
            "maximum": 50,
            "type": "integer",
            "description": "Shorts mode only. Download budget per channel in MB (1 MB = 1,000,000 bytes). Checked before each request, so a channel can pass it by the pages already on their way.",
            "default": 15
          },
          "maxRequestsPerRun": {
            "title": "Shorts: requests per run",
            "minimum": 10,
            "maximum": 5000,
            "type": "integer",
            "description": "Shorts mode only. Hard limit on requests to YouTube for the whole run.",
            "default": 400
          },
          "maxBytesPerRun": {
            "title": "Shorts: MB per run",
            "minimum": 10,
            "maximum": 2000,
            "type": "integer",
            "description": "Shorts mode only. Download budget for the whole run in MB (1 MB = 1,000,000 bytes). Checked before each request, so a run can pass it by the pages already on their way.",
            "default": 200
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "The default works for most runs. Change it only if you need a specific country or your own proxies. Use a direct connection, Apify datacenter proxy or your own proxy URLs; other Apify proxy groups are refused.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}