{
  "openapi": "3.0.1",
  "info": {
    "title": "Youtube Video Summarizer & Most-Replayed Highlights",
    "description": "YouTube Video Summarizer extracts and summarizes video content with most-replayed highlights, key moments, video details, and audience engagement insights. Ideal for content research, competitor analysis, audience analysis, and YouTube trend discovery.",
    "version": "0.1",
    "x-build-id": "sG5KKGEGmLPQd1joB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapio~youtube-video-summarizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapio-youtube-video-summarizer",
        "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/scrapio~youtube-video-summarizer/runs": {
      "post": {
        "operationId": "runs-sync-scrapio-youtube-video-summarizer",
        "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/scrapio~youtube-video-summarizer/run-sync": {
      "post": {
        "operationId": "run-sync-scrapio-youtube-video-summarizer",
        "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": {
          "videoLinks": {
            "title": "🔗 YouTube Video Links",
            "type": "array",
            "description": "📺 **One line per video.** Paste watch links (`https://www.youtube.com/watch?v=...`), short links (`https://youtu.be/...`) or Shorts links. Every link is processed on its own and written to the output table as soon as it is ready. Example: 3 links in, 3 rows out.",
            "items": {
              "type": "string",
              "pattern": "^(https?://)"
            }
          },
          "searchTopics": {
            "title": "🔍 Search Topics (used when no links are given)",
            "type": "array",
            "description": "🔎 **Topics to look up on YouTube when the link list above is empty.** Every matching video runs through the same pipeline - chapters, most-replayed key moments, transcript and metadata.\n\nExample: `official trailer` + `guitar tutorial` with 2 videos per topic = 4 rows. Leave the link list empty and press Start to use the topics below.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerTopic": {
            "title": "🔢 Videos Per Search Topic",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many videos to take from each topic above. Only applies when the link list is empty. Example: `2` (default) with 2 topics returns 4 videos.",
            "default": 2
          },
          "includeChapters": {
            "title": "📑 Collect video chapters",
            "type": "boolean",
            "description": "Adds `chapters[]` - every chapter marker published for the video, with `startTimestamp`, `endTimestamp`, a `deepLinkUrl` and `transcriptText` (the words spoken inside that chapter). `chapterSource` tells you whether the creator wrote the chapters or YouTube generated them. Videos without chapters honestly return an empty list. Default: on.",
            "default": true
          },
          "includeKeyMoments": {
            "title": "🔥 Collect most-replayed key moments",
            "type": "boolean",
            "description": "Adds `keyMoments[]` — the distinct peaks of the audience replay curve, ranked, each with `timestamp`, `replayIntensityPercent`, `deepLinkUrl`, the matching `chapterTitle` and the words spoken there. Also sets `mostReplayedAvailable` so you can tell 'no peaks' apart from 'not published for this video'. Default: on.",
            "default": true
          },
          "maxKeyMoments": {
            "title": "🔢 How many key moments per video",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Keeps only the top N peaks, ranked by replay intensity. Example: 5 → the 5 most-rewatched spots of the video. Set to 0 to keep every peak. Default: 5.",
            "default": 5
          },
          "minReplayIntensity": {
            "title": "📈 Minimum replay intensity (0-100%)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Percentage filter on the replay score of a moment, as a whole number: 0 keeps everything, 80 keeps only moments rewatched at 80% or more of the video's hottest spot. Example: 90 → only near-peak moments survive. Default: 0.",
            "default": 0
          },
          "includeMomentTranscript": {
            "title": "💬 Attach the words spoken at each key moment",
            "type": "boolean",
            "description": "Fills `keyMoments[].transcriptText` with the caption text covering that moment, so you can read what was actually said at the most-rewatched spot. Needs captions to exist on the video. Default: on.",
            "default": true
          },
          "includeReplayHeatmap": {
            "title": "🌡️ Attach the full replay curve",
            "type": "boolean",
            "description": "Adds `replayHeatmap[]` — every bucket of the raw replay-intensity curve (about 100 points across the video) for charting. Off by default because it makes the rows much larger; the ranked key moments above are the summary of it.",
            "default": false
          },
          "includeTranscript": {
            "title": "📜 Include the full timestamped transcript",
            "type": "boolean",
            "description": "Adds `transcript[]` as `{start, dur, text}` entries plus `transcriptSource`, `transcriptEntryCount` and `transcriptWordCount`. Turn off for smaller rows — chapters, key moments and summaries still use the transcript internally. Default: on.",
            "default": true
          },
          "aiSummaries": {
            "title": "🤖 Generate AI summaries",
            "type": "boolean",
            "description": "Adds `summary` (3-4 sentences) and `long_summary` (structured markdown) from the transcript. Requires your own AI API key below. Without a key the run still returns all data and leaves the summary fields empty — nothing is ever invented. Default: on.",
            "default": true
          },
          "aiApiKey": {
            "title": "🔑 Your AI API Key",
            "type": "string",
            "description": "The API key of the provider that matches the model you picked below (OpenAI, Anthropic, Google, xAI, DeepSeek, Perplexity or Mistral). Stored as a secret. If you prefer, leave this empty and set the provider's own environment variable on the Actor instead (OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY, XAI_API_KEY, DEEPSEEK_API_KEY, PERPLEXITY_API_KEY or MISTRAL_API_KEY)."
          },
          "aiModel": {
            "title": "🧠 AI Model / Provider",
            "enum": [
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1-mini",
              "gpt-4.1",
              "o3-mini",
              "claude-haiku-4-5",
              "claude-sonnet-5",
              "claude-opus-4-8",
              "gemini-2.0-flash-lite",
              "gemini-2.0-flash",
              "gemini-2.5-flash",
              "gemini-2.5-pro",
              "grok-3-mini",
              "grok-3",
              "deepseek-chat",
              "sonar",
              "sonar-pro",
              "mistral-small-latest",
              "mistral-large-latest"
            ],
            "type": "string",
            "description": "Provider is detected from the model name: claude-* = Anthropic, gpt-*/o1/o3 = OpenAI, gemini-* = Google, grok-* = xAI, deepseek-* = DeepSeek, sonar* = Perplexity, mistral-* = Mistral. The cheaper mini/flash/haiku models are usually enough for summaries.",
            "default": "gpt-4o-mini"
          },
          "aiApiEndpoint": {
            "title": "🔧 Custom AI endpoint (optional)",
            "type": "string",
            "description": "Only if you run your model somewhere else — an Azure OpenAI deployment or any OpenAI-compatible gateway. Paste the full chat-completions URL and your key above is sent to it instead of the provider's public endpoint. Leave empty for the normal providers."
          },
          "chapterSummaries": {
            "title": "📝 Also summarise every chapter",
            "type": "boolean",
            "description": "Fills `chapters[].chapterSummary` with a one-to-two sentence summary of each chapter. Needs chapters, captions and an AI key, and costs one extra model call per video. Default: off.",
            "default": false
          },
          "maxDurationSeconds": {
            "title": "⏱️ Skip videos longer than (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap for very long videos. Example: 7200 → anything over 2 hours is skipped with a clear reason instead of being processed. Set to 0 for no limit at all. Default: 0 (no limit).",
            "default": 0
          },
          "maxRetries": {
            "title": "🔁 Attempts per video",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many times a video is attempted before its row is written with an explanatory message. Example: 3 → up to 3 attempts. Default: 3.",
            "default": 3
          },
          "urls": {
            "title": "🧩 Video URLs (legacy field name)",
            "type": "array",
            "description": "Backwards-compatible alias for 🔗 YouTube Video Links above. Anything you put here is processed identically; it exists so older input files and API calls keep working. Use the field at the top for new runs.",
            "items": {
              "type": "string",
              "pattern": "^(https?://)"
            }
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "Optional. Leave as is for a normal run. Turning on Apify Proxy can help on large batches or from restricted regions."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}