# YouTube Scraper: Videos, Shorts, Channels & Search (`api_creators/youtube-scraper`) Actor

Scrape YouTube videos, Shorts, channels, playlists and search results. Get views, exact likes, comment counts, upload dates, hashtags and subscriber stats. A YouTube Data API alternative: no API key, no quota, no login.

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

## Pricing

from $1.90 / 1,000 videos

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 Scraper: Videos, Shorts, Channels & Search

**YouTube Scraper** extracts public data from YouTube videos, Shorts and live streams. Start from search terms, channel URLs, playlists or individual video links, and get views, likes, comment counts, upload dates, durations, descriptions, hashtags and full channel statistics in one dataset.

You don't need a YouTube account, Google API key or quota. It's a fast **YouTube Data API alternative** that you can run on demand, on a schedule, or through the API. You can export the results to **JSON, CSV, Excel, HTML or XML**.

### What does YouTube Scraper do?

- 🔎 **Scrape YouTube search results** for any keyword, with every YouTube search filter: upload date, duration, type, sort order, and HD, 4K, live, subtitles, Creative Commons, 360°, VR180, HDR, location, 3D and purchased.
- 📺 **Scrape YouTube channels** from `@handle`, `/channel/`, `/c/` or `/user/` URLs, including the Videos, Shorts and Live tabs. You can sort by Newest, Popular or Oldest, and filter by date (for example "videos from the last 7 days").
- 🎞️ **Scrape YouTube Shorts and live streams**, with separate limits for regular videos, Shorts and streams.
- 📃 **Scrape YouTube playlists** in full, however long they are.
- ▶️ **Scrape individual videos** from `watch?v=`, `youtu.be/`, `/shorts/` or `/live/` links.
- 🔗 **Paste YouTube search URLs** directly. Their filters are kept.
- 💬 **Add comments to each video** (optional): top or newest comments, with replies if you want them.

### What YouTube data can you extract?

| Video data | Channel data | Extra fields |
|---|---|---|
| Title, URL, video ID | Channel name, URL, ID, @handle | Hashtags and keywords |
| View count | Subscriber count | Description text |
| Exact like count | Total videos | Links in the description (real targets) |
| Comment count | Total channel views | Category |
| Upload date (ISO) | Channel description and links | Location |
| Duration | Country | Collaborators |
| Type (video / Short / stream) | Join date | Members-only and paid-content flags |
| Thumbnail URL | Verified badge, avatar, banner | Monetization and comments-off flags |

With **Comments per video** set above 0, each video also gets a `comments` array: comment text, author, likes, reply count, publish time, and pinned and creator-heart flags. Replies are included if you turn them on. For comment-only jobs, use [YouTube Comments Scraper](https://apify.com/api_creators/youtube-comments-scraper).

Each result also records which search term or URL it came from (`input`, `fromYTUrl`) and its position on that page (`order`).

### How to scrape YouTube videos, channels and search results

1. Click **Try for free** and open the input form.
2. Enter **search terms** or paste **YouTube URLs** (videos, channels, playlists or search pages).
3. Set how many **videos**, **Shorts** and **streams** you want for each search term or channel.
4. Optionally add **search filters**, a **channel date range** or a **channel sort order**.
5. Click **Start**, then download your data in your preferred format or connect it to your tools.

#### How to scrape a YouTube channel

Paste a channel URL such as `https://www.youtube.com/@veritasium` into **YouTube URLs**. **Max videos**, **Max Shorts** and **Max streams** control how many items come from the channel's Videos, Shorts and Live tabs. Set **Channel sort** to Newest, Popular or Oldest, or use **Only videos published on or after** to get just the recent uploads. Every video includes the channel's subscribers, total videos, total views, country and join date, so this works as a YouTube channel scraper too.

#### Input example

```json
{
  "searchQueries": ["home workout", "budget travel tips"],
  "maxResults": 50,
  "maxResultsShorts": 10,
  "startUrls": [
    { "url": "https://www.youtube.com/@veritasium/videos" },
    { "url": "https://www.youtube.com/playlist?list=PL6i60qoDQhQGaGbbg-4aSwXJvxOqO6o5e" }
  ],
  "dateFilter": "month",
  "sortingOrder": "views"
}
```

#### Output example

A real result for the search term "home workout":

```json
{
  "title": "20 min Fat Burning Workout for TOTAL BEGINNERS (Achievable, No Equipment)",
  "id": "IT94xC35u6k",
  "url": "https://www.youtube.com/watch?v=IT94xC35u6k",
  "viewCount": 41492989,
  "likes": 715599,
  "commentsCount": 20000,
  "date": "2022-02-07T18:25:28.000Z",
  "duration": "00:22:17",
  "type": "video",
  "hashtags": ["#BeginnerWorkout", "#HomeWorkout", "#Fitness"],
  "category": "People & Blogs",
  "channelName": "MadFit",
  "channelUsername": "MadFit",
  "channelUrl": "https://www.youtube.com/channel/UCpQ34afVgk8cRQBjSJ1xuJQ",
  "numberOfSubscribers": 11800000,
  "channelTotalVideos": 1449,
  "channelTotalViews": 1722670149,
  "channelLocation": "Canada",
  "channelJoinedDate": "Mar 1, 2018",
  "isChannelVerified": true,
  "input": "home workout",
  "order": 13
}
```

If an input can't be scraped, you get an error item instead of a silent gap. For example: `{ "input": "...", "error": "CHANNEL_DOES_NOT_EXIST", "note": "..." }`. The error codes are `INVALID_INPUT`, `CHANNEL_DOES_NOT_EXIST`, `CHANNEL_HAS_NO_VIDEOS`, `CHANNEL_HAS_NO_SHORTS`, `CHANNEL_HAS_NO_LIVE_VIDEOS`, `DATE_FILTER_TOO_STRICT`, `VIDEO_UNAVAILABLE`, `NOT_FOUND`, `NO_VIDEOS`, `NO_RESULTS`, `AGE_RESTRICTED` and `BLOCKED`. **Error items are never charged.**

### How much does it cost to scrape YouTube?

You pay per video saved. Proxies and platform usage are included in the price.

| Apify plan | Full details (per 1,000 videos) | Fast mode (per 1,000 videos) |
|---|---|---|
| Free | $3.00 | $1.50 |
| Starter (Bronze) | $2.50 | $1.20 |
| Scale (Silver) | $2.10 | $1.00 |
| Business (Gold) | $1.90 | $0.90 |
| Platinum | $1.90 | $0.90 |
| Diamond | $1.90 | $0.90 |

**Comments** (optional) cost $1.50 per 1,000 on Free, $1.20 on Starter, $1.00 on Scale, and $0.70 on Business, Platinum and Diamond.

On the Free plan, Apify's monthly free credits cover about 1,600 videos with full details, or 3,300 in fast mode. The date filter and sorting cost nothing extra. Set a **maximum cost per run** and the scraper stops cleanly when it's reached.

#### What is fast mode?

**Fast mode** makes one request per video instead of two (when comments are off), so it's quicker and half the price. You still get the title, views, exact likes, upload date, duration, description, keywords, category and all channel data. You don't get `commentsCount`, collaborators, location, the members-only and monetization flags, or the real targets of links in the description.

### Why use this YouTube scraper?

- **Fast:** it doesn't run a browser. It requests YouTube's own lightweight data, so a typical run handles about 100 videos per minute.
- **Complete:** channel statistics come with every video, fetched once per channel.
- **Reliable:** blocked requests are retried automatically through rotating residential IPs, and failures are reported as error items rather than missing rows.
- **No YouTube API quota:** the official YouTube Data API limits you to about 10,000 units a day. This scraper has no daily cap.

### Use cases for YouTube data

- **Market and trend research:** find what's popular in a niche by views, likes and upload date.
- **Competitor and channel monitoring:** track a channel's new uploads, view growth and engagement on a schedule.
- **Influencer discovery:** build lists of creators with subscriber counts, countries and contact links from channel descriptions.
- **Content strategy and SEO:** analyze titles, hashtags, keywords and durations of top-ranking videos for a search term.
- **AI and data science:** feed structured YouTube metadata into dashboards, LLM pipelines or machine-learning datasets.

### YouTube Scraper API: Python and JavaScript examples

You can call YouTube Scraper from your own code with the [Apify API](https://docs.apify.com/api/v2) or the official clients.

**Python:**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("api_creators/youtube-scraper").call(run_input={
    "searchQueries": ["home workout"],
    "maxResults": 100,
})
for video in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(video["title"], video["viewCount"])
```

**JavaScript:**

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

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('api_creators/youtube-scraper').call({
    startUrls: [{ url: 'https://www.youtube.com/@veritasium' }],
    maxResults: 50,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

You can also connect results to **Google Sheets, Make, Zapier, n8n, Slack, Airbyte** and other tools through [Apify integrations](https://apify.com/integrations), or use the scraper from AI agents through the Apify MCP server.

### FAQ

#### Do I need a YouTube API key or a Google account?

No. YouTube Scraper reads the same public data any logged-out visitor sees. There's no API key, OAuth or quota to manage.

#### Is this an alternative to the YouTube Data API?

Yes, for public data. The official API needs a Google Cloud project and an API key, and its default quota is 10,000 units a day. This scraper needs neither, and you pay per video instead. It can't access private data such as your own channel's analytics.

#### Do I need proxies to scrape YouTube?

No. A residential proxy is built in and included in the price. If you prefer, you can set your own proxy in the **Performance** section.

#### Can I scrape YouTube Shorts?

Yes. Set **Max Shorts per search term / channel** for search terms, or use a channel's `/shorts` URL. Single `/shorts/` links work too.

#### How do I get only recent videos from a channel?

Use **Only videos published on or after**, with a date like `2026-01-01` or a relative value like `7 days`. The scraper sorts the channel newest-first and stops as soon as it reaches older videos, so you only pay for matching videos.

#### Can I scrape YouTube comments, subtitles or transcripts?

Yes for comments: set **Comments per video** to attach comments (and optionally replies) to each video, or use [YouTube Comments Scraper](https://apify.com/api_creators/youtube-comments-scraper) for comment-only jobs. Subtitles and transcripts aren't included yet, because YouTube now only serves caption files to signed-in or verified players.

#### Why is the comment count rounded?

YouTube shows logged-out visitors a rounded comment count (for example "2.4K"), so that's what the scraper can collect. Like counts are exact.

#### Can I scrape YouTube dislikes?

No. YouTube stopped showing public dislike counts in 2021, so they aren't on public pages.

#### Is it legal to scrape YouTube?

This scraper collects only publicly available data and doesn't log in. Results may still include personal data, such as channel names. Personal data is protected by the GDPR in the EU and by other laws around the world, so don't scrape it without a legitimate reason. If you're unsure, consult a lawyer. Apify's blog has more on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

#### Something didn't work as expected?

Open an issue in the **Issues** tab and include the run link. Feedback and feature requests are welcome.

# Actor input Schema

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

Terms to search on YouTube, exactly as you would type them in the search bar.

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

Regular videos to collect per search term. For channel URLs it limits the Videos tab; for playlists it limits the playlist. 0 skips regular videos in search.

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

Shorts to collect per search term, and from a channel's Shorts tab.

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

Live and past streams to collect per search term, and from a channel's Live tab.

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

Video (watch, youtu.be, /shorts/, /live/), channel (@handle, /channel/, /c/, /user/, optionally /videos, /shorts or /streams), playlist or search-results URLs.

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

Applies to search terms.

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

Applies to search terms.

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

Applies to search terms.

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

Applies to search terms.

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

Only search results with the HD feature.

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

Only search results with the Subtitles/CC feature.

## `hasCC` (type: `boolean`):

Only search results with the Creative Commons feature.

## `is3D` (type: `boolean`):

Only search results with the 3D feature.

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

Only search results with the Live feature.

## `isBought` (type: `boolean`):

Only search results with the Purchased feature.

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

Only search results with the 4K feature.

## `is360` (type: `boolean`):

Only search results with the 360° feature.

## `hasLocation` (type: `boolean`):

Only search results with the Location feature.

## `isHDR` (type: `boolean`):

Only search results with the HDR feature.

## `isVR180` (type: `boolean`):

Only search results with the VR180 feature.

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

Absolute date (YYYY-MM-DD) or relative like "7 days" ("1 day" = today only). Applies to channel URLs and switches channel sorting to newest first.

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

Same as the Latest / Popular / Oldest buttons on a channel's Videos, Shorts and Live tabs.

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

Add up to this many top-level comments (max 1,000) to each video as a comments array. 0 = no comments. Each comment is charged as a separate low-cost event. For bigger comment jobs use YouTube Comments Scraper.

## `commentsSortBy` (type: `string`):

Same as YouTube's comment sort menu.

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

Also add replies to each comment (they don't count toward the comments-per-video limit).

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

Limit replies collected for each comment.

## `fastMode` (type: `boolean`):

Skip the watch-page request. You still get title, views, exact likes, date, duration, description, keywords and full channel info, but not commentsCount, collaborators, location, members-only/monetization flags or exact description link targets.

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

Parallel requests. Higher is faster; lower is gentler.

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

Leave empty to use the built-in residential proxy (included in the price). Custom proxy URLs entered here replace it.

## `lightProxyConfiguration` (type: `object`):

Search, channel, playlist and engagement requests (and video details when not bot-checked) go through this cheaper proxy. Datacenter works for these.

## Actor input object example

```json
{
  "searchQueries": [
    "web scraping"
  ],
  "maxResults": 10,
  "maxResultsShorts": 0,
  "maxResultStreams": 0,
  "startUrls": [],
  "maxComments": 0,
  "commentsSortBy": "TOP_COMMENTS",
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "fastMode": false,
  "maxConcurrency": 20,
  "lightProxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `videos` (type: `string`):

One item per video, Short or stream, with video, channel and engagement fields. Inputs that could not be scraped appear as error items.

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

The main fields in a table view.

## `summary` (type: `string`):

Videos scraped, speed and traffic per video.

# 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"
    ],
    "maxResults": 10,
    "maxResultsShorts": 0,
    "maxResultStreams": 0,
    "lightProxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("api_creators/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"],
    "maxResults": 10,
    "maxResultsShorts": 0,
    "maxResultStreams": 0,
    "lightProxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("api_creators/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"
  ],
  "maxResults": 10,
  "maxResultsShorts": 0,
  "maxResultStreams": 0,
  "lightProxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call api_creators/youtube-scraper --silent --output-dataset

```

## MCP server setup

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