# YouTube Data Scraper & AI Analyzer - Complete Solution 🎥🤖 (`mikolabs/youtube-data-scraper-ai-analyzer---complete-solution`) Actor

Extract comprehensive YouTube data and get AI-powered insights with this professional-grade Apify Actor. Scrape videos, channels, comments, live streams, and more - then analyze with advanced AI for sentiment, topics, and engagement metrics.

- **URL**: https://apify.com/mikolabs/youtube-data-scraper-ai-analyzer---complete-solution.md
- **Developed by:** [Mikolabs](https://apify.com/mikolabs) (community)
- **Categories:** AI, Social media, Lead generation
- **Stats:** 17 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## YouTube Data Scraper & AI Analyzer - Complete API Solution 🎥🤖

Extract comprehensive YouTube data and get AI-powered insights with this professional-grade Apify Actor. Scrape videos, channels, comments, live streams, and more - then analyze with advanced AI for sentiment, topics, and engagement metrics.

**Perfect for:** Content creators, marketers, researchers, data analysts, and businesses monitoring YouTube presence.

***

### 🌟 Why Choose This YouTube Scraper?

✅ **16 Data Types** - Most comprehensive YouTube scraper available\
✅ **AI-Powered Analysis** - Sentiment, summarization, topic extraction with OpenAI GPT\
✅ **Official API Only** - 100% compliant with YouTube Terms of Service\
✅ **Pay-Per-Use** - Only pay for what you scrape\
✅ **No Coding Required** - Simple configuration, instant results\
✅ **Export Ready** - JSON, CSV, Excel, Google Sheets integration

***

### 📊 What Can You Extract?

#### **Core YouTube Data**

##### 1. **Video Details** 📹

Extract complete video metadata:

- Title, description, tags
- View count, like count, comment count
- Duration, publish date, category
- Thumbnails (all resolutions)
- Channel information

##### 2. **Channel Information** 📺

Get comprehensive channel stats:

- Subscriber count, total videos
- Total views, country
- Channel description, custom URL
- Upload playlist ID
- Creation date

##### 3. **Comments & Replies** 💬

Scrape full comment threads:

- Comment text and author
- Like counts, reply counts
- All nested replies
- Publish timestamps
- Author channel IDs

##### 4. **Search Results** 🔍

Find videos by keywords:

- Matching videos for any search query
- Video metadata and stats
- Channel information
- Ranked by relevance

##### 5. **Trending Videos** 🔥

Track what's trending:

- Regional trending (US, IN, GB, etc.)
- Category-specific (Music, Gaming, News)
- Real-time trending data
- Engagement metrics

##### 6. **Playlist Contents** 📋

Extract entire playlists:

- All videos in any playlist
- Video positions and metadata
- Playlist creator info

#### **Advanced Features**

##### 7. **Captions/Subtitles** 📝

Get available caption tracks:

- All languages available
- Auto-generated vs manual
- Closed captions (CC)
- Perfect for transcript generation

##### 8. **Live Chat Messages** 💰

Scrape live stream chats:

- Real-time chat messages
- **SuperChat donations** with amounts
- Author information
- Moderator/sponsor status
- Perfect for donation tracking

##### 9. **Live Broadcasts** 📡

Monitor live streams:

- Scheduled start times
- Live status tracking
- Stream metadata
- Recording status

##### 10. **Related Videos** 🔗

Find recommended content:

- YouTube's recommendation algorithm
- Related video suggestions
- Build content networks

##### 11. **Channel Activities** 📊

Track channel behavior:

- Recent uploads
- Liked videos
- Activity timeline
- Content patterns

##### 12. **Video Categories** 🏷️

Get all YouTube categories:

- Music, Gaming, Education
- News, Entertainment, Sports
- Region-specific categories

##### 13-16. **Plus More!**

- Channel subscriptions
- Channel sections (featured content)
- Supported languages
- Supported regions

***

### 🤖 AI-Powered Analysis (Optional)

Unlock deep insights with AI analysis powered by OpenAI GPT:

#### **1. Sentiment Analysis** 😊😐😢

Understand audience emotions:

- Positive/Negative/Neutral percentages
- Overall sentiment score
- AI-generated sentiment summary
- Trend analysis over time

**Example Output:**

```json
{
  "sentiment": {
    "positive": 68.5,
    "negative": 12.3,
    "neutral": 19.2,
    "overall": "positive",
    "summary": "Audience highly appreciates the content quality..."
  }
}
```

#### **2. Comment Summarization** 📝

Get the big picture instantly:

- AI-generated summaries of all comments
- Key themes and opinions
- Main concerns and praises
- 3-5 bullet point insights

#### **3. Topic Extraction** 🏷️

Discover what people discuss:

- Main topics and themes
- Trending keywords
- Common questions
- Popular discussion points

#### **4. Engagement Analysis** 📈

Understand interaction patterns:

- Like distribution (high/medium/low)
- Reply patterns
- Top commenters
- Engagement rate calculation

#### **5. Video Performance Scoring** 🎯

Rate your video success:

- Engagement rate: (likes + comments) / views
- Performance rating: Excellent/Good/Average/Low
- Virality score (0-100)
- Like-to-view and comment-to-view ratios

***

### 🚀 How to Use This Actor

#### **Step 1: Configure Your Scrape**

Choose your scrape type and provide the required inputs:

##### **Example: Scrape Video Details**

```json
{
  "scrapeType": "video",
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=VIDEO_ID_2"
  ]
}
```

##### **Example: Scrape Comments with AI Analysis**

```json
{
  "scrapeType": "comments",
  "videoUrls": ["https://www.youtube.com/watch?v=VIDEO_ID"],
  "maxComments": 500,
  "includeReplies": true,
  "enableAI": true,
  "aiAnalysisType": "all"
}
```

##### **Example: Track Trending Videos**

```json
{
  "scrapeType": "trending",
  "trendingRegion": "US",
  "trendingCategory": "music",
  "maxResults": 50
}
```

##### **Example: Scrape Live Chat**

```json
{
  "scrapeType": "live_chat",
  "liveChatId": "YOUR_LIVE_CHAT_ID",
  "maxMessages": 200
}
```

#### **Step 2: Set Up API Keys**

##### **YouTube Data API Key** (Required)

1. Go to [Google Cloud Console](https://console.cloud.google.com/)
2. Create a new project
3. Enable **YouTube Data API v3**
4. Create credentials → API Key
5. Copy your API key

**Add to Actor input:**

```json
{
  "apiKey": "YOUR_YOUTUBE_API_KEY"
}
```

**Or set as environment variable:** `YOUTUBE_API_KEY`

##### **OpenAI API Key** (Optional - for AI features)

1. Go to [OpenAI Platform](https://platform.openai.com/)
2. Create account or sign in
3. Navigate to API Keys
4. Create new secret key
5. Copy your API key

**Add to Actor input:**

```json
{
  "openaiApiKey": "YOUR_OPENAI_API_KEY",
  "enableAI": true
}
```

**Or set as environment variable:** `OPENAI_API_KEY`

#### **Step 3: Run the Actor**

Click **Start** and the Actor will:

1. ✅ Connect to YouTube Data API
2. ✅ Extract your requested data
3. ✅ Perform AI analysis (if enabled)
4. ✅ Save results to Dataset

#### **Step 4: Export Your Data**

Download results in your preferred format:

- **JSON** - For developers and APIs
- **CSV** - For Excel and spreadsheets
- **Excel** - Ready-to-analyze spreadsheets
- **Google Sheets** - Direct integration
- **HTML** - Web-ready tables

***

### 📋 Complete Input Reference

#### **Required Parameters**

| Parameter | Type | Description |
|-----------|------|-------------|
| `scrapeType` | String | Type of data to scrape (see table below) |

#### **Scrape Types**

| Scrape Type | Description | Required Input |
|-------------|-------------|----------------|
| `video` | Video details and metadata | `videoUrls` |
| `channel` | Channel information and stats | `channelUrls` |
| `comments` | Comments and reply threads | `videoUrls` |
| `search` | Search YouTube videos | `searchQueries` |
| `trending` | Trending videos by region | `trendingRegion` |
| `playlist` | Playlist contents | `playlistUrls` |
| `captions` | Available caption tracks | `videoUrls` |
| `categories` | Video categories | `trendingRegion` |
| `live_broadcasts` | Live stream information | `channelUrls` |
| `live_chat` | Live chat messages | `liveChatId` |
| `activities` | Channel recent activities | `channelUrls` |
| `subscriptions` | Channel subscriptions | `channelUrls` |
| `related_videos` | Related/recommended videos | `videoUrls` |
| `channel_sections` | Channel featured sections | `channelUrls` |
| `languages` | Supported languages | None |
| `regions` | Supported regions | None |

#### **Optional Parameters**

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `videoUrls` | Array | `[]` | YouTube video URLs |
| `channelUrls` | Array | `[]` | YouTube channel URLs |
| `playlistUrls` | Array | `[]` | YouTube playlist URLs |
| `searchQueries` | Array | `[]` | Search keywords |
| `liveChatId` | String | - | Live chat ID |
| `maxResults` | Integer | `50` | Max results per query (1-500) |
| `maxComments` | Integer | `100` | Max comments per video (1-1000) |
| `maxMessages` | Integer | `200` | Max live chat messages (1-1000) |
| `includeReplies` | Boolean | `true` | Include comment replies |
| `trendingRegion` | String | `"US"` | Region code (US, IN, GB, etc.) |
| `trendingCategory` | String | `"all"` | Category (all, music, gaming, movies, news) |
| `apiKey` | String | - | Your YouTube API key (optional if set in env) |

#### **AI Analysis Parameters**

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `enableAI` | Boolean | `false` | Enable AI-powered analysis |
| `aiAnalysisType` | String | `"all"` | Type of AI analysis |
| `openaiApiKey` | String | - | Your OpenAI API key (optional if set in env) |

**AI Analysis Types:**

- `all` - Complete analysis (sentiment + summary + topics + engagement)
- `sentiment` - Sentiment analysis only
- `summary` - AI summarization only
- `topics` - Topic extraction only
- `engagement` - Engagement metrics only
- `basic` - Basic stats without AI (free)

***

### 💰 Pricing & Pay-Per-Event

#### **Actor Usage Pricing**

This Actor uses Apify's **pay-per-event** model. You only pay for what you use:

**Pricing Events:**

- **Actor Start** - Charged once per run
- **Task Completed** - Charged per scrape type execution

**Typical Costs:**

- Scraping 10 videos: ~$0.01-$0.02
- Scraping 100 comments: ~$0.02-$0.05
- Scraping trending videos: ~$0.03-$0.06
- AI analysis (100 comments): ~$0.10-$0.20 (OpenAI cost)

**Free Tier:** Apify offers free credits for testing!

#### **API Quota Costs**

##### **YouTube Data API v3**

- **Free quota:** 10,000 units/day
- **Video details:** 1 unit per video
- **Comments:** 1 unit per request (~100 comments)
- **Search:** 100 units per request
- **Live chat:** 5 units per request

**Most users stay within the free quota!**

##### **OpenAI API** (Optional - for AI features)

- **GPT-3.5-turbo:** ~$0.002 per 1,000 tokens
- **Average analysis:** 500-1000 tokens
- **Cost per analysis:** ~$0.001-$0.002

**Example Costs:**

- 100 comments analyzed: ~$0.10-$0.20
- 500 comments analyzed: ~$0.50-$1.00
- 1000 comments analyzed: ~$1.00-$2.00

**💡 Tip:** Use `aiAnalysisType: "basic"` for free analysis without OpenAI!

***

### 🎯 Use Cases & Applications

#### **For Content Creators** 🎬

- **Audience Sentiment** - Understand how viewers feel about your content
- **Engagement Tracking** - Monitor likes, comments, and shares
- **Competitor Analysis** - See what works for similar channels
- **Trend Identification** - Discover trending topics in your niche
- **Comment Management** - Export and analyze all comments

#### **For Digital Marketers** 📈

- **Brand Monitoring** - Track brand mentions and sentiment
- **Influencer Research** - Find and analyze influencers
- **Campaign Performance** - Measure video marketing ROI
- **Market Research** - Understand audience preferences
- **Competitor Intelligence** - Monitor competitor content

#### **For Researchers & Analysts** 📊

- **Social Media Research** - Academic and market research
- **Sentiment Studies** - Large-scale sentiment analysis
- **Trend Analysis** - Identify and track trends
- **Dataset Creation** - Build ML/AI training datasets
- **Network Analysis** - Map content relationships

#### **For Businesses** 💼

- **Customer Feedback** - Analyze product reviews and feedback
- **Support Insights** - Identify common customer questions
- **Crisis Management** - Monitor negative sentiment
- **Product Research** - Understand market demand
- **Competitive Intelligence** - Track competitor activity

#### **For Developers** 💻

- **API Integration** - Build YouTube data into your apps
- **ML/AI Training** - Create training datasets
- **Recommendation Systems** - Build content recommenders
- **Analytics Dashboards** - Power real-time dashboards
- **Automation** - Automate YouTube monitoring

***

### 📤 Data Export & Integration

#### **Export Formats**

- ✅ **JSON** - Perfect for APIs and developers
- ✅ **CSV** - Import into Excel, Google Sheets
- ✅ **Excel** - Ready-to-analyze spreadsheets
- ✅ **XML** - Enterprise system integration
- ✅ **RSS** - Feed readers and aggregators
- ✅ **HTML** - Web-ready tables

#### **Integrations**

- ✅ **Google Sheets** - Direct export to spreadsheets
- ✅ **Slack** - Real-time notifications
- ✅ **Email** - Automated reports
- ✅ **Webhooks** - Custom integrations
- ✅ **Zapier** - Connect to 5,000+ apps
- ✅ **Make (Integromat)** - Advanced automation

#### **API Access**

Access your data programmatically:

```javascript
// Get dataset items via Apify API
const dataset = await client.dataset('DATASET_ID').listItems();
```

***

### ⚡ Performance & Limits

#### **Speed**

- **Video scraping:** ~100 videos in 2 minutes
- **Comment scraping:** ~500 comments in 1 minute
- **AI analysis:** ~100 comments in 30 seconds
- **Batch processing:** Process multiple URLs simultaneously

#### **Limits**

- **Max results per request:** 500
- **Max comments per video:** 1,000
- **Max live chat messages:** 1,000
- **YouTube API quota:** 10,000 units/day (free tier)

#### **Optimization Tips**

- Use specific scrape types instead of scraping everything
- Set appropriate `maxResults` to avoid unnecessary API calls
- Use `aiAnalysisType: "basic"` when AI isn't needed
- Schedule runs during off-peak hours for better performance

***

### 🔒 Security & Compliance

#### **100% Compliant**

- ✅ Uses **official YouTube Data API v3** only
- ✅ Fully compliant with **YouTube Terms of Service**
- ✅ No unofficial scraping or API abuse
- ✅ Respects video and channel privacy settings
- ✅ Automatic rate limiting and error handling

#### **Data Security**

- ✅ API keys stored securely as environment variables
- ✅ No data stored permanently (only in your dataset)
- ✅ GDPR compliant data handling
- ✅ Secure HTTPS connections only

#### **Privacy**

- ✅ Only public data is accessible
- ✅ Private videos and comments are not scraped
- ✅ Respects channel privacy settings
- ✅ No personal data collection

***

### 🛠️ Troubleshooting

#### **"No API key provided"**

**Solution:** Add your YouTube API key to the input or set `YOUTUBE_API_KEY` environment variable.

#### **"Quota exceeded"**

**Solution:** You've reached YouTube's daily API quota (10,000 units). Wait 24 hours or request a quota increase from Google Cloud Console.

#### **"Video not found"**

**Solution:** The video may be private, deleted, or age-restricted. Verify the URL is correct and the video is public.

#### **"Comments disabled"**

**Solution:** The video owner has disabled comments. This is expected behavior.

#### **"Live chat not found"**

**Solution:** The live chat ID must be from an active or recently ended live stream.

#### **"AI analysis failed"**

**Solution:** Check your OpenAI API key is valid and you have sufficient credits. The Actor will fall back to basic analysis automatically.

***

### 📞 Support & Resources

#### **Documentation**

- 📖 [YouTube Data API v3 Documentation](https://developers.google.com/youtube/v3/docs)
- 📖 [OpenAI API Documentation](https://platform.openai.com/docs)
- 📖 [Apify Platform Documentation](https://docs.apify.com)

#### **Get API Keys**

- 🔑 [Get YouTube API Key](https://console.cloud.google.com/apis/credentials)
- 🔑 [Get OpenAI API Key](https://platform.openai.com/api-keys)

#### **Need Help?**

- 💬 Contact Apify support
- 📧 Check the Actor's issue tracker
- 📚 Review example inputs in the Actor's repository

***

### 🌟 Key Features Summary

✅ **16 Scrape Types** - Most comprehensive YouTube data extraction\
✅ **AI Analysis** - 6 types of AI-powered insights\
✅ **Official API** - 100% YouTube TOS compliant\
✅ **Pay-Per-Use** - Only pay for what you scrape\
✅ **No Coding** - Simple JSON configuration\
✅ **Batch Processing** - Scrape multiple URLs at once\
✅ **Export Ready** - JSON, CSV, Excel, Google Sheets\
✅ **Integrations** - Slack, Email, Webhooks, Zapier\
✅ **Fast** - Process 100s of videos in minutes\
✅ **Secure** - GDPR compliant, secure API handling

***

### 🚀 Get Started Now

1. **Click "Try for Free"** to test the Actor
2. **Configure your scrape** using the examples above
3. **Add your API keys** (YouTube required, OpenAI optional)
4. **Click "Start"** and get your data in seconds!

***

### 📊 Example Output

#### Video Details

```json
{
  "type": "video",
  "id": "dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up",
  "viewCount": 1400000000,
  "likeCount": 15000000,
  "commentCount": 2500000,
  "duration": "PT3M33S",
  "tags": ["rick astley", "music", "80s"]
}
```

#### AI Analysis

```json
{
  "type": "ai_analysis",
  "sentiment": {
    "positive": 72.5,
    "negative": 8.3,
    "neutral": 19.2,
    "overall": "positive"
  },
  "summary": "• Viewers love the nostalgic value\n• Many appreciate the music quality\n• Positive reception overall",
  "topics": ["nostalgia", "music quality", "80s music", "meme culture"]
}
```

***

**Built with ❤️ for YouTube data enthusiasts**

**100% Official API | Fully Compliant | Production Ready**

*Start extracting YouTube insights today!*

# Actor input Schema

## `scrapeType` (type: `string`):

Type of data to scrape from YouTube

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

List of YouTube video URLs to scrape (for video/comments scrape type)

## `channelUrls` (type: `array`):

List of YouTube channel URLs to scrape (for channel scrape type)

## `playlistUrls` (type: `array`):

List of YouTube playlist URLs to scrape (for playlist scrape type)

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

Search queries to find videos (for search scrape type)

## `maxResults` (type: `integer`):

Maximum number of results to fetch per query/URL

## `trendingRegion` (type: `string`):

Region code for trending videos (e.g., US, IN, GB)

## `trendingCategory` (type: `string`):

Category for trending videos

## `maxComments` (type: `integer`):

Maximum number of comments to fetch per video (for comments scrape type)

## `includeReplies` (type: `boolean`):

Include comment replies (for comments scrape type)

## `liveChatId` (type: `string`):

Live chat ID for scraping live chat messages (for live\_chat scrape type)

## `maxMessages` (type: `integer`):

Maximum number of live chat messages to fetch (for live\_chat scrape type)

## `apiKey` (type: `string`):

Your YouTube Data API v3 key.

## `enableAI` (type: `boolean`):

Enable AI-powered analysis (sentiment, summarization, topics, engagement)

## `aiAnalysisType` (type: `string`):

Type of AI analysis to perform

## `openaiApiKey` (type: `string`):

Your OpenAI API key for advanced AI analysis.

## Actor input object example

```json
{
  "scrapeType": "video",
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "channelUrls": [
    "https://www.youtube.com/channel/UCVHFbqXqoYvEWM1Ddxl0QDg"
  ],
  "playlistUrls": [
    "https://www.youtube.com/playlist?list=PLbpi6ZahtOH6Blw3RGYpXtSDpyLQ0KiZg"
  ],
  "searchQueries": [
    "AI tutorial"
  ],
  "maxResults": 50,
  "trendingRegion": "US",
  "trendingCategory": "all",
  "maxComments": 100,
  "includeReplies": true,
  "maxMessages": 200,
  "enableAI": false,
  "aiAnalysisType": "all"
}
```

# Actor output Schema

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

No description

# 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"
    ],
    "channelUrls": [
        "https://www.youtube.com/channel/UCVHFbqXqoYvEWM1Ddxl0QDg"
    ],
    "playlistUrls": [
        "https://www.youtube.com/playlist?list=PLbpi6ZahtOH6Blw3RGYpXtSDpyLQ0KiZg"
    ],
    "searchQueries": [
        "AI tutorial"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mikolabs/youtube-data-scraper-ai-analyzer---complete-solution").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"],
    "channelUrls": ["https://www.youtube.com/channel/UCVHFbqXqoYvEWM1Ddxl0QDg"],
    "playlistUrls": ["https://www.youtube.com/playlist?list=PLbpi6ZahtOH6Blw3RGYpXtSDpyLQ0KiZg"],
    "searchQueries": ["AI tutorial"],
}

# Run the Actor and wait for it to finish
run = client.actor("mikolabs/youtube-data-scraper-ai-analyzer---complete-solution").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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"
  ],
  "channelUrls": [
    "https://www.youtube.com/channel/UCVHFbqXqoYvEWM1Ddxl0QDg"
  ],
  "playlistUrls": [
    "https://www.youtube.com/playlist?list=PLbpi6ZahtOH6Blw3RGYpXtSDpyLQ0KiZg"
  ],
  "searchQueries": [
    "AI tutorial"
  ]
}' |
apify call mikolabs/youtube-data-scraper-ai-analyzer---complete-solution --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=mikolabs/youtube-data-scraper-ai-analyzer---complete-solution",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/QrtNV3UOfrFSafRBR/builds/G7FWa7AzWwqL5vO5j/openapi.json
