{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube AI Summary, Transcript & Channel Analytics",
    "description": "AI summaries (short, detailed, key points), timestamped AI descriptions and official captions for YouTube videos, plus channel analytics: posting frequency, engagement, rising topics and keywords. Bring your own AI key. Captions only, never audio. Not affiliated with YouTube.",
    "version": "1.0",
    "x-build-id": "0XdWZPW18uAvft5I5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/badr_xba~youtube-ai-channel-analytics/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-badr_xba-youtube-ai-channel-analytics",
        "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/badr_xba~youtube-ai-channel-analytics/runs": {
      "post": {
        "operationId": "runs-sync-badr_xba-youtube-ai-channel-analytics",
        "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/badr_xba~youtube-ai-channel-analytics/run-sync": {
      "post": {
        "operationId": "run-sync-badr_xba-youtube-ai-channel-analytics",
        "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": {
          "videoUrls": {
            "title": "Videos",
            "type": "array",
            "description": "Video or Short links (https://www.youtube.com/watch?v=..., https://youtu.be/..., /shorts/...) or bare 11-character video IDs. Several per run.",
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Channel links (https://www.youtube.com/@handle, /channel/UC..., legacy /c/ and /user/), @handles or channel IDs (UC...). Several per run.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Keyword searches",
            "type": "array",
            "description": "One search per line, as in the YouTube search bar. Several per run.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerChannel": {
            "title": "Max videos per channel",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Newest videos opened and written per channel (each one is a video row). 0 = only the channel row and its analysis.",
            "default": 20
          },
          "maxResultsPerQuery": {
            "title": "Max videos per search",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Videos written per keyword search.",
            "default": 10
          },
          "maxItems": {
            "title": "Max rows per run",
            "minimum": 0,
            "type": "integer",
            "description": "Overall cap on dataset rows (videos + channels). 0 = no cap. \"Maximum cost per run\" is always respected too.",
            "default": 0
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only videos published on or after this date: 2026-01-31, or relative such as \"30 days\", \"6 months\". Applies to channels, searches and videos. Free (no extra event)."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only videos published on or before this date (2026-06-30). Free."
          },
          "maxAgeDays": {
            "title": "Max age (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Only videos published in the last N days. Free."
          },
          "videoType": {
            "title": "Video type",
            "enum": [
              "all",
              "videos",
              "shorts",
              "live"
            ],
            "type": "string",
            "description": "Keep all videos, only Shorts, only long videos or only live streams.",
            "default": "all"
          },
          "order": {
            "title": "Search sort",
            "enum": [
              "relevance",
              "date",
              "viewCount",
              "rating"
            ],
            "type": "string",
            "description": "Order of keyword search results.",
            "default": "relevance"
          },
          "searchUploadDate": {
            "title": "Search upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "YouTube's own search filter.",
            "default": "any"
          },
          "includeCaptions": {
            "title": "Return official captions with timestamps",
            "type": "boolean",
            "description": "Adds youtube.captions: segments [{start, end, text}] of the caption track published by the channel (or YouTube's automatic captions when allowed). Charged per video WITH captions returned (event \"captions\"). Videos without captions are never charged. No audio is ever downloaded or transcribed.",
            "default": false
          },
          "includeCaptionText": {
            "title": "Also return the plain text",
            "type": "boolean",
            "description": "Adds youtube.captions.text (the whole caption text in one string) next to the segments.",
            "default": false
          },
          "captionLanguage": {
            "title": "Caption language",
            "type": "string",
            "description": "Preferred language code (en, fr, es, pt-BR...). Empty = the video's own language."
          },
          "allowAutoCaptions": {
            "title": "Allow YouTube automatic captions",
            "type": "boolean",
            "description": "When the channel published no caption track, use YouTube's automatic captions (marked source: auto). Off = only published tracks.",
            "default": true
          },
          "aiSummary": {
            "title": "AI summary",
            "type": "boolean",
            "description": "Summarizes each video from its captions with your own AI key. Charged once per summarized video (event \"ai-summary\"), never for a video without captions or when the AI fails.",
            "default": false
          },
          "summaryFormats": {
            "title": "Summary formats",
            "type": "array",
            "description": "Any of short (1-2 sentences), detailed (2-4 paragraphs), keyPoints (3-8 bullets). All three come from ONE AI call.",
            "items": {
              "type": "string",
              "enum": [
                "short",
                "detailed",
                "keyPoints"
              ],
              "enumTitles": [
                "Short",
                "Detailed",
                "Key points"
              ]
            },
            "default": [
              "short",
              "detailed",
              "keyPoints"
            ]
          },
          "aiDescription": {
            "title": "AI description (timestamped sections)",
            "type": "boolean",
            "description": "Splits each video into timestamped sections and describes what is SAID in each one (from captions; images are not analysed). Charged once per described video (event \"ai-description\").",
            "default": false
          },
          "maxSections": {
            "title": "Max sections per video",
            "minimum": 2,
            "maximum": 12,
            "type": "integer",
            "description": "Upper limit of AI description sections.",
            "default": 12
          },
          "aiProvider": {
            "title": "AI provider",
            "enum": [
              "gemini",
              "claude",
              "openai"
            ],
            "type": "string",
            "description": "Whose API your key belongs to. The cheapest default model of each provider is used unless you set one.",
            "default": "gemini"
          },
          "aiApiKey": {
            "title": "AI API key",
            "type": "string",
            "description": "Your own key for the provider above. Stored encrypted by Apify, never written to logs, results or the report. You pay the AI tokens directly to your provider."
          },
          "aiModel": {
            "title": "AI model (optional)",
            "type": "string",
            "description": "Leave empty for the default: gemini-3.5-flash-lite, claude-haiku-5-5 or gpt-6-luna."
          },
          "outputLanguage": {
            "title": "AI output language",
            "type": "string",
            "description": "Language code of summaries and descriptions (en, fr, es...). Empty = the caption language."
          },
          "aiKeyMode": {
            "title": "AI key mode",
            "type": "string",
            "description": "\"own\" = your key (the only available mode). \"managed\" is not available."
          },
          "failRunOnError": {
            "title": "Mark the run as FAILED on errors",
            "type": "boolean",
            "description": "Off (default): when your input or AI key stops the work (managed key asked, AI key missing, refused or out of quota, unknown model), the run ends SUCCEEDED with a clear status message and nothing is charged for the work not done. On: such runs end FAILED, for schedules, webhooks or integrations that must react to a failed run.",
            "default": false
          },
          "channelAnalysis": {
            "title": "Channel analysis",
            "type": "boolean",
            "description": "For each channel: posting frequency, regularity, best weekday, views, engagement, Shorts / live share, durations, captions coverage, top keywords, tags, hashtags and rising topics. Computed by the Actor (no AI). Charged once per analysed channel (event \"channel-analysis\").",
            "default": true
          },
          "analysisSampleSize": {
            "title": "Videos analysed per channel",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Newest videos used for the analysis (from the channel list; the opened videos give exact dates and engagement). Up to 500.",
            "default": 50
          },
          "aiChannelInsights": {
            "title": "AI channel insights",
            "type": "boolean",
            "description": "Adds AI topics, content pillars, an audience guess (labelled as an AI estimate) and video ideas per channel, with your own key. Charged once per channel (event \"ai-channel-insights\").",
            "default": false
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "nested",
              "flat"
            ],
            "type": "string",
            "description": "nested = youtube / computed / ai objects (JSON). flat = the same values on one level (youtube_title, computed_engagementRate, ai_summaryShort...) for spreadsheets.",
            "default": "nested"
          },
          "regionCode": {
            "title": "Region",
            "type": "string",
            "description": "Optional two-letter country code for YouTube results (US, FR...)."
          },
          "language": {
            "title": "Interface language",
            "type": "string",
            "description": "Optional YouTube interface language (en, fr...)."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Off by default: the first attempt uses the run's own address and every retry a new Apify datacenter IP (up to 8 attempts within about a minute).",
            "default": {
              "useApifyProxy": false
            }
          },
          "maxEnhancedRecoveries": {
            "title": "Enhanced recovery (residential proxy) — max items",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "OFF by default (0). When YouTube refuses every datacenter attempt for an item, retry it through the residential proxy, at most this many items per run. Charged per item recovered (event \"enhanced-recovery\"), never for failed attempts; available only when that event is live.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Parallel pages",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Pages read at the same time (capped by memory).",
            "default": 6
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}