# YouTube Scraper - Videos, Transcripts & Comments (`swerve/youtube-scraper`) Actor

The all-in-one YouTube scraper. One run takes a channel, playlist, handle or keyword search and returns every video with its details, its full transcript as clean text, and top comments. No API key needed. Pay only for the videos you get.

- **URL**: https://apify.com/swerve/youtube-scraper.md
- **Developed by:** [Swerve](https://apify.com/swerve) (community)
- **Categories:** Videos, Social media
- **Stats:** 5 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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 - Videos, Transcripts & Comments in One Run

Scrape **YouTube** completely, in one run: video details, full transcripts, and comments. Paste a video, channel, playlist or @handle URL, or search by keyword, and get back one clean row per video with everything attached. **No login and no API key.**

### Why this scraper

Most YouTube tools do one job each: one lists a channel's videos, another fetches the transcript of a single video at a time, a third collects comments. Getting a full picture of a channel means running three or four separate tools and joining their outputs yourself.

This actor replaces that stack. Point it at a channel once and every video comes back with its details, its transcript and its top comments already joined in the same row. Transcripts are returned as clean readable text, with no timestamps and no duplicated caption lines, so they are ready for search, summaries and AI pipelines as-is.

### What you can do with it

- Turn a whole channel or playlist into a transcript dataset for search, summaries or AI training
- Track a competitor's or creator's views, likes and upload cadence over time
- Pull comments at scale for sentiment and audience research
- Find videos by keyword and export their details and captions

### Input

| Field | What it does | Example |
|-------|--------------|---------|
| **YouTube URLs** | Videos, channels, playlists or @handles to scrape. A channel or playlist returns every video it contains. | `https://www.youtube.com/@mkbhd`, `https://youtu.be/dQw4w9WgXcQ` |
| **Search terms** | Or find videos by keyword instead of pasting URLs. | `iphone review`, `react tutorial` |
| **Include transcript** | Pull the full spoken transcript (captions) for each video. On by default. | on |
| **Include comments** | Also pull top comments per video (author, text, likes, date). Off by default. | off |
| **Preferred transcript language** | Prefer this caption language when several exist. | `English`, `Hebrew` |
| **Max videos per channel / playlist / search** | How many recent videos to take from each source. | `50` |

### Output

One row per video:

```json
{
  "videoId": "dQw4w9WgXcQ",
  "title": "Example video title",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "channelName": "Marques Brownlee",
  "channelId": "UCBJycsmduvYEL83R_U4JriQ",
  "channelUrl": "https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ",
  "viewCount": 4192837,
  "likeCount": 210934,
  "durationSeconds": 733,
  "publishedAt": "Jul 8, 2026",
  "category": "Science & Technology",
  "keywords": ["iphone", "review", "tech"],
  "description": "Full video description...",
  "thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
  "transcript": "In this video we take a look at...",
  "transcriptLanguage": "English",
  "commentsCount": 50,
  "comments": [
    { "text": "Great video!", "author": "@someviewer", "likes": 340, "publishedAt": "1 week ago" }
  ],
  "scrapedAt": "2026-07-10T13:00:00.000Z"
}
````

### How it works

Uses YouTube's own internal interface, the same one the site itself uses, so it reads video details, transcripts and comments reliably where the old public caption feeds now return empty. Transcripts are fetched through a residential connection because YouTube blocks caption downloads from datacenter addresses; this is on by default and can be switched off for a faster, metadata-only run. No API key required.

### Limits

- Transcripts come from a video's captions. Videos with captions disabled return an empty transcript, and the rest of the row is still filled.
- Comments are top-level comments, capped by your "max comments per video" setting.
- "Published" is the date label YouTube shows (for recent videos this can be relative, like "2 weeks ago").

### Export formats

Results download as JSON, CSV, Excel or XML, or pull them straight from the Apify API into your own app, spreadsheet or database.

### Frequently asked questions

**Do I need a YouTube API key or a Google account?** No. This YouTube scraper needs no API key and no login. It reads YouTube's public data directly, so there are no quota limits like the official YouTube Data API.

**Can it download a YouTube transcript or subtitles?** Yes. It returns the full transcript (captions) of each video as clean text, in the language you choose when several are available. It works for auto-generated and manual captions.

**Can I scrape all videos from a channel or playlist?** Yes. Paste a channel, @handle or playlist URL and it returns every video with details, transcript and comments in one run, so you do not need a separate channel scraper, transcript tool and comment scraper.

**Can it scrape YouTube comments?** Yes. Turn on comments to get top comments per video with author, text, likes and date.

**How many videos can I scrape?** As many as you want. There is no built-in cap; use the optional limit only if you want to control cost.

**Is scraping YouTube legal?** This tool collects only public data. You are responsible for how you use it. Review YouTube's terms and your local laws before large-scale use.

### Pricing

Pay per video. You only pay for the videos you actually get, whether you run one video or a whole channel.

# Actor input Schema

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

Paste YouTube video, channel, playlist or @handle URLs. A channel or playlist URL returns every video it contains; a video URL returns just that video. Examples: https://www.youtube.com/watch?v=dQw4w9WgXcQ , https://www.youtube.com/@mkbhd , https://www.youtube.com/playlist?list=PL5vtqDuUM1DmwLtG9CxJfOxL5A\_r6H5s6 , https://youtu.be/dQw4w9WgXcQ

## `searchTerms` (type: `array`):

Or find videos by keyword, e.g. iphone review, tomato soup recipe, react tutorial. Each term returns the top matching videos.

## `includeTranscript` (type: `boolean`):

Pull the full spoken transcript (captions) for every video, as one text field plus the video's caption language. On by default. Turn off for a faster, metadata-only run.

## `includeComments` (type: `boolean`):

Also pull top-level comments for every video (author, text, likes, date). Slower and adds nested comment data to each row, so it is off by default.

## `transcriptLanguage` (type: `string`):

Optional. If a video has captions in several languages, prefer this one, e.g. English, Spanish, Hebrew. Leave blank to use the video's default caption track.

## `maxVideosPerSource` (type: `integer`):

For each channel, playlist or search term, how many of its most recent videos to take. Default 50. Does not apply to single video URLs (those always return the one video).

## `maxCommentsPerVideo` (type: `integer`):

When comments are on, how many top comments to keep per video. Default 50.

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

Optional overall cap on how many videos the whole run returns. Leave blank for everything your inputs point to.

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

Transcripts are fetched through a residential proxy (YouTube blocks caption downloads from datacenter IPs), so residential is the default. You can switch it off for a faster, metadata-only run without transcripts.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk"
  ],
  "searchTerms": [],
  "includeTranscript": true,
  "includeComments": false,
  "maxVideosPerSource": 50,
  "maxCommentsPerVideo": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "startUrls": [
        "https://www.youtube.com/watch?v=aircAruvnKk"
    ],
    "searchTerms": [],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("swerve/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 = {
    "startUrls": ["https://www.youtube.com/watch?v=aircAruvnKk"],
    "searchTerms": [],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("swerve/youtube-scraper").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 '{
  "startUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk"
  ],
  "searchTerms": [],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call swerve/youtube-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Scraper - Videos, Transcripts & Comments",
        "description": "The all-in-one YouTube scraper. One run takes a channel, playlist, handle or keyword search and returns every video with its details, its full transcript as clean text, and top comments. No API key needed. Pay only for the videos you get.",
        "version": "0.1",
        "x-build-id": "sUym9r2doeCgZnfog"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/swerve~youtube-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-swerve-youtube-scraper",
                "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/swerve~youtube-scraper/runs": {
            "post": {
                "operationId": "runs-sync-swerve-youtube-scraper",
                "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/swerve~youtube-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-swerve-youtube-scraper",
                "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": {
                    "startUrls": {
                        "title": "YouTube URLs",
                        "type": "array",
                        "description": "Paste YouTube video, channel, playlist or @handle URLs. A channel or playlist URL returns every video it contains; a video URL returns just that video. Examples: https://www.youtube.com/watch?v=dQw4w9WgXcQ , https://www.youtube.com/@mkbhd , https://www.youtube.com/playlist?list=PL5vtqDuUM1DmwLtG9CxJfOxL5A_r6H5s6 , https://youtu.be/dQw4w9WgXcQ",
                        "items": {
                            "type": "string"
                        }
                    },
                    "searchTerms": {
                        "title": "Search terms",
                        "type": "array",
                        "description": "Or find videos by keyword, e.g. iphone review, tomato soup recipe, react tutorial. Each term returns the top matching videos.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "includeTranscript": {
                        "title": "Include transcript",
                        "type": "boolean",
                        "description": "Pull the full spoken transcript (captions) for every video, as one text field plus the video's caption language. On by default. Turn off for a faster, metadata-only run.",
                        "default": true
                    },
                    "includeComments": {
                        "title": "Include comments",
                        "type": "boolean",
                        "description": "Also pull top-level comments for every video (author, text, likes, date). Slower and adds nested comment data to each row, so it is off by default.",
                        "default": false
                    },
                    "transcriptLanguage": {
                        "title": "Preferred transcript language",
                        "type": "string",
                        "description": "Optional. If a video has captions in several languages, prefer this one, e.g. English, Spanish, Hebrew. Leave blank to use the video's default caption track."
                    },
                    "maxVideosPerSource": {
                        "title": "Max videos per channel / playlist / search",
                        "minimum": 1,
                        "type": "integer",
                        "description": "For each channel, playlist or search term, how many of its most recent videos to take. Default 50. Does not apply to single video URLs (those always return the one video).",
                        "default": 50
                    },
                    "maxCommentsPerVideo": {
                        "title": "Max comments per video",
                        "minimum": 1,
                        "type": "integer",
                        "description": "When comments are on, how many top comments to keep per video. Default 50.",
                        "default": 50
                    },
                    "maxItems": {
                        "title": "Max videos in total",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Optional overall cap on how many videos the whole run returns. Leave blank for everything your inputs point to."
                    },
                    "proxyConfiguration": {
                        "title": "Proxy",
                        "type": "object",
                        "description": "Transcripts are fetched through a residential proxy (YouTube blocks caption downloads from datacenter IPs), so residential is the default. You can switch it off for a faster, metadata-only run without transcripts.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
