# YouTube Scraper - Videos, Comments & Channels (`pipiagent/youtube-scraper`) Actor

Scrape YouTube without an API key: search videos by keyword, get all uploads of a channel, full video details, comments with replies and channel profiles. Numbers are parsed into numeric fields. No login needed.

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

## Pricing

$1.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.

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 Scraper

Extract public data from [YouTube](https://www.youtube.com) without an API key and without the quota limits of the official YouTube Data API. Use it for influencer research, competitor tracking, content research, comment analysis and training data.

- **Five kinds of data in one Actor.** Video search, all uploads of a channel, full video details, comments with replies, and channel profiles.
- **Numbers you can sort.** Text like "1.2M views" is parsed into a number. The original text is kept in a separate field.
- **No API key, no login and no proxy setup.** Press Start and get data.
- **Low price.** $1 per 1,000 results.

### What data can you get?

| Mode | One result is | Main fields |
|---|---|---|
| Search videos | One video | Title, views, duration, publish time, channel, thumbnail |
| Channel videos | One video | The same fields for every upload of a channel |
| Video details | One video | Full description, exact views, likes, comment count, exact publish date, keywords, category, channel subscribers |
| Comments | One comment or reply | Text, likes, reply count, author, pinned and hearted flags |
| Channel details | One channel | Subscribers, video count, total views, description, country, join date, links |

### How to use it

1. Click **Try for free**.
2. Choose a mode in **What to scrape**.
3. Fill in the matching input: keywords, video URLs or channels.
4. Click **Start**, then download the results as JSON, CSV or Excel.

Video URLs can be watch links, youtu.be links, Shorts links or plain video ids. Channels can be `/channel/` links, `/@handle` links or plain handles such as `@MrBeast`.

### Input examples

Search videos uploaded this month:

```json
{
    "mode": "search",
    "searchQueries": ["web scraping", "python tutorial"],
    "uploadDate": "month",
    "maxItems": 200
}
```

All uploads of two channels:

```json
{
    "mode": "channelVideos",
    "channelUrls": ["@GoogleDevelopers", "https://www.youtube.com/@MrBeast"],
    "maxItemsPerQuery": 500,
    "maxItems": 1000
}
```

Comments and replies of a video, newest first:

```json
{
    "mode": "comments",
    "videoUrls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
    "commentSort": "newest",
    "includeReplies": true,
    "maxItems": 5000
}
```

### Output examples

Video details:

```json
{
    "type": "video",
    "videoId": "jNQXAC9IVRw",
    "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "title": "Me at the zoo",
    "viewCount": 438341989,
    "viewCountText": "438,341,989 views",
    "likeCount": 19960247,
    "commentCount": 10631026,
    "publishedAt": "2005-04-24T03:31:52Z",
    "durationSeconds": 19,
    "keywords": ["me at the zoo", "jawed karim", "first youtube video"],
    "category": "Film & Animation",
    "isLive": false,
    "channelName": "jawed",
    "channelId": "UC4QobU6STFB0P71PMvOGN5A",
    "channelHandle": "@jawed",
    "channelUrl": "https://www.youtube.com/channel/UC4QobU6STFB0P71PMvOGN5A",
    "channelSubscriberCount": 6640000,
    "thumbnailUrl": "https://i.ytimg.com/vi/jNQXAC9IVRw/hqdefault.jpg",
    "commentsEnabled": true,
    "scrapedAt": "2026-09-29T21:48:01Z"
}
```

A comment:

```json
{
    "type": "comment",
    "commentId": "UgzuC3zzpRZkjc5Qzsd4AaABAg",
    "commentUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw&lc=UgzuC3zzpRZkjc5Qzsd4AaABAg",
    "videoId": "jNQXAC9IVRw",
    "videoTitle": "Me at the zoo",
    "isReply": false,
    "parentCommentId": null,
    "text": "We're so honored that the first ever YouTube video was filmed here!",
    "likeCount": 4800000,
    "likeCountText": "4.8M",
    "replyCount": 985,
    "publishedTimeText": "6 years ago",
    "publishedAtEstimated": "2020-09-30T21:48:05Z",
    "isPinned": true,
    "isHeartedByCreator": true,
    "authorName": "@SanDiegoZoo",
    "authorChannelUrl": "https://www.youtube.com/channel/UCC5NfQ6Mf0dq_eEwv4P_hWA",
    "authorIsVerified": true
}
```

A channel:

```json
{
    "type": "channel",
    "channelId": "UC_x5XG1OV2P6uZZ5FSM9Ttw",
    "url": "https://www.youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw",
    "handle": "@GoogleDevelopers",
    "name": "Google for Developers",
    "subscriberCount": 2680000,
    "videoCount": 6099,
    "totalViews": 360437715,
    "country": "United States",
    "joinedDate": "2007-08-23",
    "rssUrl": "https://www.youtube.com/feeds/videos.xml?channel_id=UC_x5XG1OV2P6uZZ5FSM9Ttw"
}
```

### How much does it cost?

You pay per saved result: **$1.00 per 1,000 results**. There is no start fee and no monthly rental. A video, a comment, a reply and a channel each count as one result.

| Run | Results | Cost |
|---|---|---|
| 100 search results | 100 | $0.10 |
| 2,000 uploads of a channel | 2,000 | $2.00 |
| 3,000 comments of a video | 3,000 | $3.00 |

Set a maximum charge per run in the run options and the Actor stops when it is reached.

### Limits you should know

- **Search returns about 500 videos per keyword.** This is YouTube's own limit. To get more, use several related keywords or different sort orders.
- **Dates in lists are estimates.** Search results, channel uploads and comments only show relative times such as "3 years ago". The Actor keeps that text and adds an estimated date in `publishedAtEstimated`. Video details mode returns the exact publish date.
- **Large numbers are rounded by YouTube.** Subscriber counts, and like counts on comments, come as "2.68M" or "4.8M", so the numeric value is rounded too. Video details mode returns exact views and likes.
- **Transcripts and video downloads are not included.**
- **Private, deleted and age-restricted videos are skipped** with a warning.
- **Shorts and live streams of a channel are off by default.** Turn them on with the two switches in the input.

### Tips

- **Get exact numbers for a list.** Run channel videos or search first, then feed the `url` values into video details mode.
- **Run it on a schedule.** Scrape the same channels every day to track growth over time.

### FAQ

**Is it legal?** The Actor collects only data that YouTube shows publicly to every visitor. Results can contain personal data such as usernames. Make sure you have a legitimate reason to process it, as required by the GDPR and similar laws.

**Do I need a proxy?** No. If YouTube refuses the address of the server a run started on, the Actor switches to an Apify proxy address by itself.

**Something is broken or missing?** Open a ticket in the Issues tab. Issues are usually answered within a day.

# Actor input Schema

## `mode` (type: `string`):

Choose the kind of data you need. Each mode uses the matching input below.

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

Used in search mode. One keyword or phrase per line, for example "web scraping" or "iphone 17 review".

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

Used in video details and comments modes. Accepts watch URLs, youtu.be links, Shorts URLs and 11-character video ids.

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

Used in channel videos and channel details modes. Accepts channel URLs (youtube.com/@handle, /channel/UC..., /c/name, /user/name), handles like @MrBeast and channel ids.

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

Maximum number of results to save in this run.

## `maxItemsPerQuery` (type: `integer`):

Optional. Limits results for each keyword, each channel or each video, so that one big source does not use up the whole run.

## `sortBy` (type: `string`):

Used in search mode. With "Recent videos first" YouTube returns new videos, but the order is not strictly by date.

## `uploadDate` (type: `string`):

Used in search mode. Keeps only videos uploaded in this period.

## `includeShorts` (type: `boolean`):

Used in channel videos mode. Also saves the Shorts of the channel. YouTube shows only the title and the view count of Shorts in this list.

## `includeLive` (type: `boolean`):

Used in channel videos mode. Also saves past and current live streams of the channel.

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

Used in comments mode.

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

Used in comments mode. Also saves the replies under each comment. Every reply counts as one result.

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

Optional. The Actor works without a proxy. Turn one on only if runs start failing with blocked requests.

## Actor input object example

```json
{
  "mode": "search",
  "searchQueries": [
    "web scraping"
  ],
  "maxItems": 100,
  "sortBy": "relevance",
  "uploadDate": "any",
  "includeShorts": false,
  "includeLive": false,
  "commentSort": "top",
  "includeReplies": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Videos, comments or channels saved by the run, one item per result.

# 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 = {
    "searchQueries": [
        "web scraping"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("pipiagent/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 = { "searchQueries": ["web scraping"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pipiagent/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/MikYojRRs8S89J7wh/builds/fQlCcGioCJFA9sJUw/openapi.json
