# YouTube Scraper + AI Transcript & Summary (`apigeek/youtube-scraper`) Actor

Fast, low-cost YouTube scraper for videos, search results, channels, Shorts, live streams, playlists, comments, replies, subtitles, and transcripts. Extract structured data, engagement metrics, and filtered search results at scale.

- **URL**: https://apify.com/apigeek/youtube-scraper.md
- **Developed by:** [Api Geek](https://apify.com/apigeek) (community)
- **Categories:** Social media, Videos, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.50 / 1,000 video results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Scraper + AI Transcript & Summary

A fast, low-cost YouTube data extraction API for Apify. Scrape YouTube Videos, Shorts, Live Streams, Channels, Playlists, Comments, Replies, and Filtered Search with optional AI Speech-to-Text Transcripts and AI Video Summaries.

***

### ⚡ Key Features

- ⚡ **Fast & Efficient**: Designed for reliable, lightweight YouTube data collection.
- 🔍 **Full YouTube Search**: Search by keywords with YouTube search filters (sorting, date posted, video duration, HD, 4K, live, captions).
- 📹 **Video Metadata & Metadata Enrichment**: Extract detailed video records including views, likes, comments count, subscriber count, duration, hashtags, keywords, and live stream status.
- 📱 **Shorts & Live Streams**: Native support for YouTube Shorts and Live Streams across channels and search modes.
- 📺 **Channels & Playlists**: Channel extraction and playlist scraping with positional tracking.
- 💬 **Comments & Replies**: Scrape top-level comments and nested replies sorted by Top or Newest.
- 🎙️ **AI Transcript**: Optional speech-to-text transcription generated directly from video audio.
- 📝 **AI Summary**: Concise factual summary and key topics generated from the video transcript.
- 🏷️ **Hashtag Discovery**: Discover videos for any `#hashtag`.

> *Note: AI Transcript and AI Summary are temporarily unavailable and will be enabled soon.*

***

### 💳 Simple & Transparent Pricing (Pay-Per-Event)

This Actor uses predictable Pay-Per-Event (PPE) pricing. Platform usage costs are included in the event pricing so you never get surprise compute bills.

| Event Type | Event Code | Unit Price | Price / 1,000 Units |
| :--- | :--- | :--- | :--- |
| **Actor Start** | `apify-actor-start` | $0.00005 / run | $0.05 / 1,000 runs |
| **Video Result** | `video-result` | $0.0025 / item | **$2.50 / 1,000 videos** |
| **Comment / Reply** | `comment-result` | $0.0015 / item | **$1.50 / 1,000 comments** |
| **AI Transcript** | `ai-transcript` | $0.007 / started audio-min | **$7.00 / 1,000 audio-mins** |
| **AI Summary** | `ai-summary` | $0.001 / summary | **$1.00 / 1,000 summaries** |

#### Pricing Examples

- **100 Video Results**: `$0.00005 (start) + 100 × $0.0025 = $0.25005`
- **1 Video with AI Transcript (3 min video)**: `$0.00005 (start) + $0.0025 (video) + 3 × $0.007 (transcript) = $0.02355`
- **1 Video with AI Transcript & Summary (3 min video)**: `$0.00005 (start) + $0.0025 (video) + 3 × $0.007 (transcript) + $0.001 (summary) = $0.02455`

***

### 🛠️ Input Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `searchQueries` | Array of Strings | `[]` | Search keywords or phrases to scrape. |
| `startUrls` | Array of Objects | `[]` | YouTube URLs to scrape (Video, Short, Channel, Playlist, Search, Hashtag). |
| `maxResults` | Integer | `20` | Maximum number of videos/results to return per query or channel. |
| `sortingOrder` | String Enum | `"relevance"` | Sort search results: `relevance`, `date`, `viewCount`, `rating`. |
| `dateFilter` | String Enum | `null` | Filter search by upload date: `hour`, `today`, `week`, `month`, `year`. |
| `videoType` | String Enum | `"video"` | Filter search by type: `video`, `channel`, `playlist`, `movie`. |
| `lengthFilter` | String Enum | `null` | Filter search by duration: `short`, `medium`, `long`. |
| `isHD` | Boolean | `false` | Filter search results for HD videos. |
| `hasSubtitles` | Boolean | `false` | Filter search results for videos with subtitles/CC. |
| `isLive` | Boolean | `false` | Filter search results for live streams. |
| `maxComments` | Integer | `0` | Maximum top-level comments per video (0 = disabled). |
| `maxRepliesPerComment`| Integer | `0` | Maximum nested replies per top-level comment. |
| `commentSort` | String Enum | `"TOP"` | Sort comments by `TOP` or `NEWEST`. |
| `enrichVideoMetadata` | Boolean | `false` | Enable enhanced metadata (likes, comments count, subscriber count). |
| `aiTranscript` | Boolean | `false` | Generate an AI transcript for supported YouTube videos. Optional and charged per started audio minute. |
| `aiSummary` | Boolean | `false` | Generate a concise AI summary of the video's transcript. |
| `aiLanguage` | String | `null` | Target language code for AI processing (e.g. `"en"`, `"es"`). |
| `maxAiVideos` | Integer | `10` | Maximum number of videos to process with AI per run. |

***

### 📋 Sample Input

```json
{
  "startUrls": [
    { "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw" }
  ],
  "maxResults": 1,
  "aiTranscript": true,
  "aiSummary": true
}
```

***

### 📄 Sample Output (Public Dataset Item)

```json
{
  "type": "VIDEO",
  "id": "jNQXAC9IVRw",
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "title": "Me at the zoo",
  "description": null,
  "thumbnailUrl": "https://i.ytimg.com/vi/jNQXAC9IVRw/hqdefault.jpg",
  "channelId": "UC4QobU6STFB0P71PMvOGN5A",
  "channelName": "jawed",
  "channelUrl": "https://www.youtube.com/channel/UC4QobU6STFB0P71PMvOGN5A",
  "subscriberCount": 6380000,
  "viewCount": 403515717,
  "likesCount": 19000000,
  "publishedAt": "2005-04-23T00:00:00.000Z",
  "duration": "00:19",
  "durationSeconds": 19,
  "isShort": false,
  "isLive": false,
  "liveStatus": "NONE",
  "commentsCount": 10000000,
  "subtitlesAvailable": false,
  "scrapedAt": "2026-08-07T22:30:41.988Z",
  "aiTranscript": {
    "status": "SUCCESS",
    "language": "en",
    "characters": 193
  },
  "aiSummary": {
    "status": "SUCCESS",
    "summary": "The video highlights an elephant, noting its exceptionally long front.",
    "keyTopics": ["Elephant", "Long front", "Animal observation"]
  }
}
```

# Actor input Schema

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

List of YouTube search keywords or phrases to scrape.

## `startUrls` (type: `array`):

YouTube URLs to scrape (Video, Short, Channel, Playlist, Search, or Hashtag).

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

Maximum number of video/playlist results to collect per query or channel feed.

## `sortingOrder` (type: `string`):

Sorting order for YouTube search queries.

## `dateFilter` (type: `string`):

Filter search results by upload date window.

## `lengthFilter` (type: `string`):

Filter search results by video duration.

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

Filter search results by content category.

## `isHD` (type: `boolean`):

Filter search results to high-definition (HD) videos.

## `hasSubtitles` (type: `boolean`):

Filter search results to videos with subtitles/CC.

## `isLive` (type: `boolean`):

Filter search results to active live streams.

## `is4K` (type: `boolean`):

Filter search results to 4K resolution videos.

## `oldestPostDate` (type: `string`):

Stop crawling search results when videos become older than this ISO date (e.g. '2026-01-01').

## `maxResultsShorts` (type: `integer`):

Maximum number of Shorts items to collect when scraping a channel.

## `maxResultStreams` (type: `integer`):

Maximum number of Live / Stream items to collect when scraping a channel.

## `sortVideosBy` (type: `string`):

Sorting order for channel videos tab.

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

Maximum top-level comments to scrape per video (0 = disabled).

## `maxRepliesPerComment` (type: `integer`):

Maximum reply comments to scrape per top-level comment.

## `commentSort` (type: `string`):

Sort order for comments (Top comments vs Newest first).

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

Optional network settings for advanced users.

## `enrichVideoMetadata` (type: `boolean`):

Fetch additional video engagement metadata such as likes, comment count, views, and channel subscriber count when available.

## `maxEnrichedVideos` (type: `integer`):

Maximum number of videos to enrich with additional engagement metadata in this run (default: 20, max: 100).

## `aiTranscript` (type: `boolean`):

Generate an AI transcript for supported YouTube videos. Optional and charged per started audio minute.

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

Generate a concise AI summary of the video's transcript.

## `aiLanguage` (type: `string`):

Target language ISO code for AI transcription/summary (e.g. 'en', 'es', 'de').

## `maxAiVideos` (type: `integer`):

Maximum number of videos to process with AI in this run (default: 10, max: 100).

## `maxAiDurationMinutes` (type: `integer`):

Maximum duration of an individual video eligible for AI processing (default: 60, max: 120).

## `maxAiMinutesPerRun` (type: `integer`):

Maximum total combined duration of videos processed by AI during this run (default: 60, max: 600).

## Actor input object example

```json
{
  "searchQueries": [
    "bitcoin news",
    "apify tutorial"
  ],
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    },
    {
      "url": "https://www.youtube.com/@Google"
    },
    {
      "url": "https://www.youtube.com/playlist?list=PLBCF2DAC6FFB574DE"
    },
    {
      "url": "https://www.youtube.com/results?search_query=bitcoin"
    },
    {
      "url": "https://www.youtube.com/hashtag/bitcoin"
    }
  ],
  "maxResults": 20,
  "sortingOrder": "relevance",
  "videoType": "video",
  "isHD": false,
  "hasSubtitles": false,
  "isLive": false,
  "is4K": false,
  "oldestPostDate": "2026-01-01",
  "maxResultsShorts": 0,
  "maxResultStreams": 0,
  "sortVideosBy": "NEWEST",
  "maxComments": 0,
  "maxRepliesPerComment": 0,
  "commentSort": "TOP",
  "enrichVideoMetadata": false,
  "maxEnrichedVideos": 20,
  "aiTranscript": false,
  "aiSummary": false,
  "maxAiVideos": 10,
  "maxAiDurationMinutes": 60,
  "maxAiMinutesPerRun": 60
}
```

# Actor output Schema

## `results` (type: `string`):

Successful video and comment results produced by the Actor.

## `storage` (type: `string`):

Channel metadata, playlist metadata, subtitle files, and related output records.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("apigeek/youtube-scraper").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("apigeek/youtube-scraper").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 '{}' |
apify call apigeek/youtube-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/RysQceP3qe9qdop8L/builds/XJQFiXrR4gbB2vhWP/openapi.json
