# YouTube AI Summary, Transcript & Channel Analytics (`badr_xba/youtube-ai-channel-analytics`) Actor

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.

- **URL**: https://apify.com/badr_xba/youtube-ai-channel-analytics.md
- **Developed by:** [Badr Bouargan](https://apify.com/badr_xba) (community)
- **Categories:** AI, Videos, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.85 / 1,000 video or channel rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube AI Summary & Channel Analytics

**Summarize hundreds of YouTube videos and whole channels in one run with your own AI key, and get one clean dataset with real timestamps.**

- 📦 **Channels, searches and hundreds of videos in one run**: mix video links, channels and keyword searches.
- 🕒 **Clean output with real timestamps**: summaries, sections and captions in JSON, CSV or Excel.
- 🔑 **Your own Gemini, Claude or OpenAI key**, and your model. **Captions only, never audio** or video: far fewer AI tokens than sending the video.

> 💰 **Cost example (Free plan prices):** 1 channel and 30 videos with captions, AI summary, AI sections and channel analysis cost **about $0.87** (about $0.94 from December 13, 2026, when the video row price changes), plus your own AI tokens. Details in [Pricing](#pricing-pay-per-event).

![Cover: hundreds of videos turned into one clean dataset of AI summaries, with your own AI key and model](https://api.apify.com/v2/key-value-stores/R1P4OnWyoV0LnGBin/records/yt-ai-analytics-v4-1-cover.png)

> Images marked **Illustrative example** and the JSON examples on this page use **fictional data**. This Actor is **not affiliated with, endorsed by or sponsored by YouTube or Google.**

**Try it:** run it with the prefilled input (no AI key needed for videos, captions and channel analytics), then add your AI key for summaries.

***

### What you get

| Feature | Details |
|---|---|
| 🎬 **Videos, channels and searches** | Video links or IDs, channels (URL, `UC…` ID or `@handle`) and keyword searches. You can give several of each in one run, with limits per channel and per search. |
| 📅 **Date filter, free** | Use `publishedAfter` / `publishedBefore` (`2026-01-31` or `"30 days"`) or `maxAgeDays`. It works on channels, searches and videos and costs nothing extra. |
| 📝 **Official captions with timestamps** | `[{start, end, text}]` segments from the caption track the channel published. If there is none, YouTube's automatic captions are used, and they are **always marked** `source: "auto"` with a plain-English note. |
| 🤖 **AI summary in 3 formats** | Short (1–2 sentences), detailed (2–4 paragraphs) and key points (3–8 bullets), all from **one** AI call per video. |
| 🧭 **AI description by sections** | The video is split into timestamped sections, each with a title and what is said in it. Every section starts on a real caption timestamp. |
| 📊 **Channel analytics** | Uploads per week, days between uploads, a consistency score, the most active weekday and hour, median views, views per day, outliers, engagement, Shorts and live share, durations, caption coverage, top keywords, tags and hashtags, and rising topics. |
| 💡 **AI channel insights (optional)** | Main topics, content pillars, an audience guess (clearly labelled as an AI estimate) and video ideas. |
| 🧱 **Clean, separated output** | Each row has `youtube` (what YouTube publishes), `computed` (what this Actor calculates) and `ai` (what your AI wrote), plus `sourceUrl` and `collectedAt`. A flat mode is available for spreadsheets. |

![AI summary in three formats: short, detailed and key points](https://api.apify.com/v2/key-value-stores/R1P4OnWyoV0LnGBin/records/yt-ai-analytics-v4-2-ai-summary.png)

### Who it is for

- **Researchers and analysts**: summarize dozens of talks, lectures or reviews and keep the timestamps to cite them.
- **Marketers and agencies**: audit a creator's channel before a partnership (rhythm, engagement, topics).
- **Content teams**: see which subjects are rising on a channel and turn videos into notes, show notes or briefs.
- **AI and RAG builders**: get timestamped caption segments plus structured summaries as clean JSON.

### Why not just paste the video into ChatGPT or Gemini?

For **one** video, an AI chat is enough. This Actor is built for the rest:

- **Bulk work:** whole channels, keyword searches and hundreds of videos in one run, on a schedule, connected to Make, n8n, Zapier or Google Sheets.
- **Structured output:** JSON, CSV or Excel with the **real caption timestamps**, ready for a spreadsheet, a database or a RAG pipeline.
- **Channel analytics without AI:** posting frequency, regularity, engagement, views per day and rising topics, computed from public data.
- **Lower AI cost:** only the caption **text** is sent to your AI, not the video, so each summary uses far fewer AI tokens.

![One video: an AI chat is enough. Hundreds of videos: this Actor, with a dataset, a schedule and channel analytics](https://api.apify.com/v2/key-value-stores/R1P4OnWyoV0LnGBin/records/yt-ai-analytics-v4-5-chat-vs-actor.png)

### How to use it

1. Paste **videos**, **channels** and/or **keyword searches**.
2. Pick the options you need: captions, AI summary, AI description, channel analysis, AI insights.
3. For AI options, choose your provider (Gemini, Claude or OpenAI) and paste **your own API key**.
   No AI key? Gemini offers a free tier in many countries: create a key at [aistudio.google.com/app/apikey](https://aistudio.google.com/app/apikey).
4. Run, then download JSON, CSV or Excel, or open the **visual report**.

#### Example 1: summarize two videos

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=VIDEO_ID_1", "https://youtu.be/VIDEO_ID_2"],
  "includeCaptions": true,
  "aiSummary": true,
  "summaryFormats": ["short", "detailed", "keyPoints"],
  "aiDescription": true,
  "aiProvider": "gemini",
  "aiApiKey": "YOUR_OWN_KEY"
}
```

#### Example 2: analyse channels over the last 90 days

```json
{
  "channels": ["@examplechannel", "https://www.youtube.com/channel/UCxxxxxxxxxxxxxxxxxxxxxx"],
  "publishedAfter": "90 days",
  "maxVideosPerChannel": 20,
  "channelAnalysis": true,
  "analysisSampleSize": 100
}
```

#### Example 3: keyword research with AI insights, flat output

```json
{
  "searchQueries": ["home espresso tips", "budget travel japan"],
  "maxResultsPerQuery": 15,
  "aiSummary": true,
  "summaryFormats": ["short", "keyPoints"],
  "aiProvider": "claude",
  "aiApiKey": "YOUR_OWN_KEY",
  "outputFormat": "flat"
}
```

### Output

*Illustrative example with fictional data, shortened.*

```json
{
  "type": "video",
  "sourceUrl": "https://www.youtube.com/watch?v=ZooWalk0001",
  "input": "@fictionalzoo",
  "collectedAt": "2026-11-12T10:00:00+00:00",
  "videoId": "ZooWalk0001",
  "youtube": {
    "title": "Zoo Walk at Night: How Tigers Hunt",
    "channelName": "Fictional Zoo Channel",
    "publishedAt": "2026-11-05T17:00:00+00:00",
    "durationSeconds": 760,
    "viewCount": 18240,
    "likeCount": 912,
    "commentCount": 64,
    "tags": ["tigers", "night safari"],
    "captions": {
      "language": "en",
      "source": "manual",
      "isAutoGenerated": false,
      "note": "Based on the caption track published by the channel.",
      "segments": [{"start": 0, "end": 6.1, "text": "Welcome back to the big-cat house."}]
    }
  },
  "computed": {
    "videoAgeDays": 7,
    "viewsPerDay": 2606,
    "engagementRate": 5.351,
    "likesPerThousandViews": 50.0
  },
  "ai": {
    "provider": "gemini",
    "model": "gemini-3.5-flash-lite",
    "basedOn": "captions:manual",
    "captionSource": "manual",
    "captionNote": "Based on the caption track published by the channel.",
    "summaryShort": "A keeper explains how tigers use darkness, scent and patience to hunt.",
    "summaryDetailed": "The video follows a night shift at the big-cat house…",
    "keyPoints": ["Tigers see far better than humans at night", "Scent trails keep instincts active"],
    "descriptionSections": [
      {"start": 0, "end": 220, "startLabel": "00:00", "endLabel": "03:40", "title": "Night vision", "text": "Why tigers hunt at dusk."}
    ],
    "inputTruncated": false,
    "error": null
  },
  "status": {"detailsLevel": "full", "captions": "ok", "captionSource": "manual", "aiSummary": "ok", "aiDescription": "ok"}
}
```

Each channel also gives a `type: "channel"` row. Its `youtube` block holds the profile (title, handle, subscribers, verified, description) and its `computed.analysis` block holds the analytics: `activity`, `performance`, `engagement`, `format`, `keywords` (top keywords, tags, hashtags, rising topics) and `limits`. With AI insights on, its `ai.channelInsights` block is filled too.

![Video sections that start on real caption timestamps](https://api.apify.com/v2/key-value-stores/R1P4OnWyoV0LnGBin/records/yt-ai-analytics-v4-3-sections.png)
![Channel dashboard: uploads per week, regularity, typical views, engagement, videos per month and rising topics](https://api.apify.com/v2/key-value-stores/R1P4OnWyoV0LnGBin/records/yt-ai-analytics-v4-4-channel-dashboard.png)

**Automatic captions are always marked.** When a channel published no caption track and YouTube's automatic captions are used, you see:

- `youtube.captions.source: "auto"` and `isAutoGenerated: true`;
- `ai.captionSource: "auto"` and `status.captionSource: "auto"`;
- a note: *"Based on YouTube automatic captions… names and technical words may be wrong."*

To use only captions the channel published, set `allowAutoCaptions: false`.

**Dataset views:** Overview, AI summaries, Captions, Channel analytics. **Run files:** visual report, `RUN_SUMMARY` (units counted and charged per event, AI tokens) and `FAILED_INPUTS` (never charged).

### Pricing (pay per event)

> The **Pricing tab of this Store page** is the reference for current prices.

![Simple prices and a cost example: 1 channel and 30 videos for about $0.87 plus your AI tokens](https://api.apify.com/v2/key-value-stores/R1P4OnWyoV0LnGBin/records/yt-ai-analytics-v4-6-pricing-example.png)

| Event (per 1,000) | Free | Starter | Scale | Business | Platinum | Diamond |
|---|---|---|---|---|---|---|
| Video or channel row | $3.20 | $2.50 | $2.10 | $1.85 | $1.85 | $1.85 |
| Video or channel row **from December 13, 2026** | $5.50 | $5.00 | $4.50 | $4.00 | $4.00 | $4.00 |
| Captions with timestamps (only videos that have them) | $1.00 | $0.80 | $0.70 | $0.60 | $0.60 | $0.60 |
| AI summary (short + detailed + key points, per video) | $12.00 | $9.60 | $8.40 | $6.00 | $6.00 | $6.00 |
| AI description by sections (per video) | $12.00 | $9.60 | $8.40 | $6.00 | $6.00 | $6.00 |
| Channel analysis (per channel) | $20.00 | $16.00 | $14.00 | $12.00 | $12.00 | $12.00 |
| AI channel insights (per channel) | $12.00 | $9.60 | $8.40 | $6.00 | $6.00 | $6.00 |
| Enhanced recovery (residential proxy, opt-in) | $20.00 | $20.00 | $20.00 | $20.00 | $20.00 | $20.00 |
| Date filters | free | free | free | free | free | free |

- **AI events are counted per video** (see the table above).
- **Nothing is charged** for a video without captions, an AI error, a failed input or a row that could not be saved.
- **Rows with incomplete details are free.** If YouTube refuses the full video page, the row is still saved (`status.detailsLevel: "partial"` or `"listing"`), but no video, captions or AI event is charged for it. The run summary counts these rows in `partialRowsNotCharged`.
- **Your AI tokens** are paid to your AI provider directly. With the default cheapest models this is usually a fraction of a cent per video; check your provider's prices.
- "Maximum cost per run" is always respected.

*Example (Free plan prices): 1 channel and 30 videos, with captions, AI summary, AI description and channel analysis: 30 × ($3.20 + $1.00 + $12.00 + $12.00) / 1,000 + $3.20 / 1,000 for the channel row + $20.00 / 1,000 for the channel analysis = **about $0.87**, plus your own AI tokens. From December 13, 2026 (video or channel row $5.50 on Free): 30 × ($5.50 + $1.00 + $12.00 + $12.00) / 1,000 + $5.50 / 1,000 + $20.00 / 1,000 = **about $0.94**.*

### API and integrations

Run it from your code with the Apify API client, or connect it to **Make, n8n, Zapier or Google Sheets**, or to AI assistants through the **Apify MCP server**.

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("badr_xba/youtube-ai-channel-analytics").call(run_input={
    "channels": ["@examplechannel"], "maxVideosPerChannel": 20,
    "aiSummary": True, "aiProvider": "gemini", "aiApiKey": "YOUR_OWN_KEY",
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["youtube"]["title"], (item.get("ai") or {}).get("summaryShort"))
```

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('badr_xba/youtube-ai-channel-analytics').call({
    searchQueries: ['home espresso tips'], maxResultsPerQuery: 10, channelAnalysis: false,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, 'rows');
```

### FAQ

**Does it transcribe audio for videos without captions?** No. The Actor reads only caption **text** that YouTube already publishes. It never downloads or transcribes audio or video. A video without captions gets `status.captions: "noCaptions"`, and no AI or caption event is charged for it.

**Does the AI see the images of the video?** No. Summaries and sections describe what is **said**, from the captions.

**Which AI providers work?** Google Gemini (default model `gemini-3.5-flash-lite`), Anthropic Claude (`claude-haiku-5-5`) and OpenAI (`gpt-6-luna`). You can set another model id in `aiModel`.

**Is my API key safe?** The key field is a secret field, encrypted by Apify. The key is sent only to your provider, in a header. It is never written to logs, the dataset, the report or the key-value store. If the key is wrong or your account is out of credit, the run stops with a clear message and nothing more is charged.

**Can you use your own key for me (managed key)?** Not at the moment. This Actor works only with your own key.

**Am I charged for rows with incomplete details?** No. Rows with incomplete details are free: if YouTube refuses the full page of a video, the Actor still saves what it got (`status.detailsLevel` is `"partial"` or `"listing"`, and `status.detailsNote` says what is missing) and charges nothing for that row.

**How many videos can I analyse?** Up to 1,000 per channel or search per run. Channel analysis uses up to 500 recent videos (`analysisSampleSize`). Dates of videos that are not opened come from the channel list, where YouTube shows "3 weeks ago", so they are **approximate**. The analysis says so in `datesPrecision`.

**What are "rising topics"?** Keywords whose share of views is higher in the recent half of a channel's analysed videos than in the older half. They show what is growing **on that channel**, not YouTube's Trending page.

**I need comments, playlists in bulk or the cheapest raw data.** Use [YouTube Data Scraper](https://apify.com/badr_xba/youtube-data-scraper). It is built for raw data at scale.

### Limits

- Public videos and channels only. No login, no cookies, no CAPTCHA solving, and no access to private, members-only or age-restricted content.

- Subscriber history, audience data, watch time and revenue are not public, so the Actor does not provide them.

- Very long videos (about 2 hours of speech or more) are sent to the AI in a shortened form that still covers the whole video. These rows show `ai.inputTruncated: true`.

- YouTube sometimes refuses automated requests. Each item is retried up to 8 times with new IPs. Enhanced recovery through a residential proxy is **off by default** and only runs if you turn it on.

- When YouTube refuses the full page of several videos in a row, the next videos are delivered with the data from the channel or search list only: title, views, duration and channel. These rows are marked `status.detailsLevel: "listing"` and carry a `status.detailsNote`. Likes, comments, the exact date, captions and AI are missing on them, and **these rows are free** (no video, captions or AI event). For full details, choose the RESIDENTIAL proxy group or turn on enhanced recovery.

- Sometimes YouTube answers with the video page but not the player data. The row is then marked `status.detailsLevel: "partial"`, and its `status.detailsNote` lists the missing values. Captions cannot be read in that case, so the row shows `status.captions: "captionsUnavailable"` instead of `"noCaptions"`, and **the row is free** (no video, captions or AI event).

- A video that YouTube refuses after every attempt, with no list data to fall back on, goes to `FAILED_INPUTS` with the code `BLOCKED_BY_YOUTUBE` and is never charged.

- If a run gets close to its timeout, the Actor stops starting new work about 90 seconds before. It saves everything done so far and ends normally; the items it did not reach are listed in `FAILED_INPUTS` with the code `TIME_LIMIT`. To finish them, raise the timeout or lower the limits.

### Privacy and compliance

- The Actor reads only public pages, and only the information YouTube shows to every visitor.
- No media files are downloaded or stored.
- Channel rows describe channels (public profiles). The audience guess is labelled as an AI estimate.
- You are responsible for using the data in line with the laws that apply to you (for example GDPR) and with YouTube's terms.

### Related Actors

Other Actors by the same developer that work well with this one:

- [YouTube Scraper](https://apify.com/badr_xba/youtube-data-scraper) – bulk videos, channels, playlists and comments.
- [YouTube Email Scraper](https://apify.com/badr_xba/youtube-email-scraper) – contact the creators you analysed through the e-mails they publish.

# Changelog

This Actor's version history is a separate document: https://apify.com/badr_xba/youtube-ai-channel-analytics/changelog.md

# Actor input Schema

## `videoUrls` (type: `array`):

Video or Short links (https://www.youtube.com/watch?v=..., https://youtu.be/..., /shorts/...) or bare 11-character video IDs. Several per run.

## `channels` (type: `array`):

Channel links (https://www.youtube.com/@handle, /channel/UC..., legacy /c/ and /user/), @handles or channel IDs (UC...). Several per run.

## `searchQueries` (type: `array`):

One search per line, as in the YouTube search bar. Several per run.

## `maxVideosPerChannel` (type: `integer`):

Newest videos opened and written per channel (each one is a video row). 0 = only the channel row and its analysis.

## `maxResultsPerQuery` (type: `integer`):

Videos written per keyword search.

## `maxItems` (type: `integer`):

Overall cap on dataset rows (videos + channels). 0 = no cap. "Maximum cost per run" is always respected too.

## `publishedAfter` (type: `string`):

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` (type: `string`):

Only videos published on or before this date (2026-06-30). Free.

## `maxAgeDays` (type: `integer`):

Only videos published in the last N days. Free.

## `videoType` (type: `string`):

Keep all videos, only Shorts, only long videos or only live streams.

## `order` (type: `string`):

Order of keyword search results.

## `searchUploadDate` (type: `string`):

YouTube's own search filter.

## `includeCaptions` (type: `boolean`):

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.

## `includeCaptionText` (type: `boolean`):

Adds youtube.captions.text (the whole caption text in one string) next to the segments.

## `captionLanguage` (type: `string`):

Preferred language code (en, fr, es, pt-BR...). Empty = the video's own language.

## `allowAutoCaptions` (type: `boolean`):

When the channel published no caption track, use YouTube's automatic captions (marked source: auto). Off = only published tracks.

## `aiSummary` (type: `boolean`):

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.

## `summaryFormats` (type: `array`):

Any of short (1-2 sentences), detailed (2-4 paragraphs), keyPoints (3-8 bullets). All three come from ONE AI call.

## `aiDescription` (type: `boolean`):

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").

## `maxSections` (type: `integer`):

Upper limit of AI description sections.

## `aiProvider` (type: `string`):

Whose API your key belongs to. The cheapest default model of each provider is used unless you set one.

## `aiApiKey` (type: `string`):

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` (type: `string`):

Leave empty for the default: gemini-3.5-flash-lite, claude-haiku-5-5 or gpt-6-luna.

## `outputLanguage` (type: `string`):

Language code of summaries and descriptions (en, fr, es...). Empty = the caption language.

## `aiKeyMode` (type: `string`):

"own" = your key (the only available mode). "managed" is not available.

## `failRunOnError` (type: `boolean`):

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.

## `channelAnalysis` (type: `boolean`):

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").

## `analysisSampleSize` (type: `integer`):

Newest videos used for the analysis (from the channel list; the opened videos give exact dates and engagement). Up to 500.

## `aiChannelInsights` (type: `boolean`):

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").

## `outputFormat` (type: `string`):

nested = youtube / computed / ai objects (JSON). flat = the same values on one level (youtube_title, computed_engagementRate, ai_summaryShort...) for spreadsheets.

## `regionCode` (type: `string`):

Optional two-letter country code for YouTube results (US, FR...).

## `language` (type: `string`):

Optional YouTube interface language (en, fr...).

## `proxyConfiguration` (type: `object`):

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).

## `maxEnhancedRecoveries` (type: `integer`):

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.

## `maxConcurrency` (type: `integer`):

Pages read at the same time (capped by memory).

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxVideosPerChannel": 20,
  "maxResultsPerQuery": 10,
  "maxItems": 0,
  "videoType": "all",
  "order": "relevance",
  "searchUploadDate": "any",
  "includeCaptions": false,
  "includeCaptionText": false,
  "allowAutoCaptions": true,
  "aiSummary": false,
  "summaryFormats": [
    "short",
    "detailed",
    "keyPoints"
  ],
  "aiDescription": false,
  "maxSections": 12,
  "aiProvider": "gemini",
  "failRunOnError": false,
  "channelAnalysis": true,
  "analysisSampleSize": 50,
  "aiChannelInsights": false,
  "outputFormat": "nested",
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "maxEnhancedRecoveries": 0,
  "maxConcurrency": 6
}
```

# Actor output Schema

## `visualReport` (type: `string`):

Interactive page of the run: videos with their AI summary, channels, charts, filters and CSV/JSON export.

## `overview` (type: `string`):

Main YouTube and computed fields of every row.

## `aiSummaries` (type: `string`):

Short / detailed summaries, key points and timestamped sections per video.

## `channelAnalytics` (type: `string`):

Channel rows with computed analytics and AI insights.

## `allFields` (type: `string`):

Every row with all fields.

## `runSummary` (type: `string`):

Status, stop reason, rows saved, units counted and charged per event, failures.

## `failedInputs` (type: `string`):

Inputs that could not be read, with the reason and a stable error code.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("badr_xba/youtube-ai-channel-analytics").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("badr_xba/youtube-ai-channel-analytics").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call badr_xba/youtube-ai-channel-analytics --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,badr_xba/youtube-ai-channel-analytics"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/WNJU0awd3pDumUq72/builds/0XdWZPW18uAvft5I5/openapi.json
