# YouTube Scraper & Monitor ($0.50/1K) (`hydedata/youtube-scraper`) Actor

No login or API key. Scrape YouTube search, channels, Shorts, live streams, playlists and videos: exact views, likes, comments, publish date, tags, full description and subscribers. Add transcripts and comments, and monitor channels or searches for new videos with Slack or Discord alerts.

- **URL**: https://apify.com/hydedata/youtube-scraper.md
- **Developed by:** [Jacob Hyde](https://apify.com/hydedata) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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.

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 & Monitor

Scrape YouTube search results, channels, Shorts, live streams, playlists and single videos: exact
views, likes, comment count, publish date, length, tags, hashtags, full description and the
channel's subscribers. Add **transcripts** and **comments** to the same rows. No YouTube account, API
key or quota. $0.50 per 1,000 videos.

Turn on **monitor mode** and schedule it to get only the videos that are new since the last run, from
any channel, search or playlist. It can post them straight to Slack or Discord.

### What you get

For every video:

| Field | Example |
| --- | --- |
| Title, URL and video ID | Rick Astley - Never Gonna Give You Up, dQw4w9WgXcQ |
| Type | video, short, live or upcoming |
| Exact views | 1,835,400,991 |
| Exact likes | 19,497,348 |
| Comment count | 2,461,569 |
| Publish date, and whether it premiered or streamed | 2009-10-24, uploaded |
| Length | 213 seconds, 3:33 |
| Full description | the whole text, links included |
| Tags and hashtags | rick astley, never gonna give you up; #OfficialMusicVideo |
| Channel name, ID, @handle, link and verified check | Rick Astley, @RickAstleyYT |
| Channel subscribers | 4,560,000 |
| Thumbnail and badges | image URL; CC, 4K |
| Where it came from | the search term, channel tab or playlist, and its rank there |

**Transcripts** (add-on): the captions as plain text, in the language you pick. The creator's own
captions are used when there are some, otherwise YouTube's auto-generated ones. Choose plain text,
timestamped lines, or a ready SRT or WebVTT file. Each row says which language you got, whether it
was auto-generated, and which other languages the video has.

**Comments** (add-on): top or newest comments with text, likes, reply count, when they were posted,
whether they're pinned or edited, and whether the channel owner wrote them. Commenters' names and
channels aren't collected.

### Ready-made examples

Open one, change the input to yours, and run it:

- [YouTube transcript scraper](https://apify.com/hydedata/youtube-scraper/examples/youtube-transcript-scraper)
- [YouTube channel video scraper](https://apify.com/hydedata/youtube-scraper/examples/youtube-channel-video-scraper)
- [YouTube search scraper with filters](https://apify.com/hydedata/youtube-scraper/examples/youtube-search-scraper-with-filters)
- [YouTube comments scraper](https://apify.com/hydedata/youtube-scraper/examples/youtube-comments-scraper)
- [YouTube new video alerts](https://apify.com/hydedata/youtube-scraper/examples/youtube-new-video-alerts)

### How to use it

#### Search YouTube

```json
{
  "searchQueries": ["home espresso machine review", "budget espresso machine"],
  "maxResults": 50,
  "uploadDate": "month",
  "duration": "between4and20",
  "features": ["subtitles"]
}
```

YouTube's own filters are there: sort by relevance or view count, upload date (last hour to this
year), length, Shorts only, and features like subtitles, 4K, HDR, live and Creative Commons. A search
results link you copied from YouTube keeps the filters in it.

#### Channels

Paste channel links in any format: `youtube.com/@mkbhd`, `/channel/UC...`, `/c/...`, `/user/...`, or
just `@mkbhd`. Videos come newest first. Pick the **Videos**, **Shorts** and **Live streams** tabs, or
link one tab directly (`youtube.com/@mkbhd/shorts`).

```json
{
  "startUrls": [{ "url": "https://www.youtube.com/@mkbhd" }, { "url": "@LinusTechTips" }],
  "channelTabs": ["videos", "shorts"],
  "maxResults": 100,
  "postedAfter": "30 days"
}
```

#### Playlists and single videos

Playlist links and video, Shorts and live links (watch, youtu.be, /shorts/, /live/, /embed/) work
in the same list. A video you link that's removed or private comes back as a row with `status`
`not-found` and the reason, free.

#### Transcripts for a list of videos

```json
{
  "startUrls": [
    { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
    { "url": "https://youtu.be/PmsWH7xlTCw" }
  ],
  "includeTranscript": true,
  "transcriptLanguages": ["en", "es"],
  "transcriptFormat": "timestamped"
}
```

Works on channels, playlists and searches too: get every new video's transcript from a channel, or
transcripts for the top 100 results of a search. Ready for LLMs, RAG pipelines, summaries and
content repurposing.

#### Filters

Checked before you're charged, on every search, channel and playlist. Videos that don't match are
dropped for free.

- Posted after a date, or within a number of days. Channel tabs stop reading once they're past it.
- At least this many views.

#### Monitor mode: new videos only

Turn on **Monitor mode** and add a Schedule (e.g. every hour). The first run saves what each channel,
search and playlist currently shows as the baseline and returns it. After that, each run returns only
videos that are new, marked `monitorStatus: "new"`.

- **Channels**: every new upload, Short or stream on the tabs you watch.
- **Searches**: new uploads that make the search's top results, not old videos that moved up the
  ranking. Set "Max videos per search" to how deep to watch.
- **Playlists**: videos added to the playlist.

Runs that find nothing new are free apart from the Actor start, so you can check often.

#### Alerts in Slack or Discord

Paste a Discord or Slack incoming webhook URL in **Send new videos to a webhook**. Each run posts its
videos there with thumbnails, views, length and date. Any other URL gets the rows as JSON. In monitor
mode the first run's baseline isn't sent, and quiet runs send nothing.

#### Coming from another YouTube scraper

Input from other YouTube scrapers works as is: `searchQueries`, `startUrls`, `maxResults`,
`maxResultsShorts`, `maxResultStreams`, `sortingOrder`, `dateFilter`, `lengthFilter`, the `is4K` style
feature switches, `oldestPostDate`, `subtitlesLanguage` and `subtitlesFormat`, and transcript inputs
like `youtube_url`, `channel` and `languages`.

### Pricing

Pay per result. Platform usage is included.

| Event | Price |
| --- | --- |
| Video | $0.0005 ($0.50 per 1,000) |
| Transcript add-on, per video that gets one | $0.001 ($1 per 1,000) |
| Comment add-on, per comment | $0.0003 ($0.30 per 1,000) |
| Search, channel tab or playlist, once per run when it returns videos | $0.002 |

Video details (exact views, likes, date, description, tags, subscribers) are included in the video
price.

You're never charged for:

- Videos, channels or playlists that weren't found or couldn't be read. They come back as rows with
  `status` and `error`.
- Videos your filters drop.
- Videos without captions, or whose transcript couldn't be read.
- The same video twice in one run.
- Monitor runs that find nothing new.

With a spending limit, the run stops at the limit and never goes over it.

### Output

Results are in the run's dataset. Download them as JSON, CSV, Excel or HTML, or get them through the
Apify API, Make, Zapier or n8n. The dataset has views for videos, transcripts and comments.

### Tips

- Leave **Video details** on unless you only need titles and links. Without it, views from channel
  and playlist pages are rounded (5.3M) and dates come from "2 weeks ago".
- For a search monitor that only alerts on fresh uploads, add **Upload date: Today** or **This week**.
- Very long videos have long transcripts. Timestamped lines make rows bigger; plain text is enough
  for most AI uses.
- Translated transcripts aren't supported. Pick the languages the video already has captions in
  (each row lists them in `transcriptLanguagesAvailable`).

### FAQ

**Do I need a YouTube account, API key or cookies?** No. Everything comes from what YouTube shows to
anyone without signing in, so there's no API quota either.

**Is it legal to scrape YouTube?** This Actor only reads public video, channel and caption data that
YouTube shows to logged-out visitors. It doesn't collect commenters' names or any account data. Check
the rules that apply to your use of the data.

**Why does a video have no transcript?** Some videos have no captions at all, often music videos
and very new uploads. Those rows say `transcriptStatus: "none"` and aren't charged for a transcript.

**Can I get every video of a channel?** Yes. Set "Max videos per search, channel or playlist" to the
channel's video count.

# Changelog

This Actor's version history is a separate document: https://apify.com/hydedata/youtube-scraper/changelog.md

# Actor input Schema

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

Search YouTube like you would in its search bar. Each term returns up to "Max videos per search, channel or playlist" videos, with the filters below.

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

Videos, Shorts, channels (@handle, /channel/, /c/ or /user/ links, or a channel's /videos, /shorts or /streams tab), playlists and search result pages. Bare video IDs and @handles work too.

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

Upper limit per search term, per channel tab and per playlist. Channels go newest first. Videos you link directly are always included.

## `maxVideos` (type: `integer`):

Upper limit of videos delivered by the whole run. Leave empty for no limit.

## `channelTabs` (type: `array`):

Which of a channel's tabs to scrape when you link the channel itself. Each tab gets its own limit. A link to one tab (youtube.com/@mkbhd/shorts) scrapes just that tab.

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

Relevance is YouTube's default order. View count puts the most watched first. For the newest videos, use Upload date below.

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

Only videos uploaded in this window.

## `duration` (type: `string`):

Only videos of this length.

## `searchType` (type: `string`):

Regular videos, or Shorts only.

## `features` (type: `array`):

Only videos with all of these.

## `postedAfter` (type: `string`):

Only videos published on or after this date, or within this many days (e.g. 7 days). Channel tabs stop reading once they're past it.

## `minViews` (type: `integer`):

Drop videos with fewer views. Live streams have no view count yet and are kept.

## `includeDetails` (type: `boolean`):

Exact views, likes, comment count, publish date, full description, tags, hashtags and the channel's subscriber count. Included at no extra cost. Turn off for faster listings with just what search and channel pages show.

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

The video's captions as text: uploaded by the creator when there are some, else YouTube's auto-generated ones. Charged per video that gets one. Videos without captions are free.

## `transcriptLanguages` (type: `array`):

Language codes in order of preference (e.g. en, es, de). en matches every English track (en-US, en-GB).

## `transcriptAnyLanguage` (type: `boolean`):

When a video has none of your languages, get its captions in the language spoken in it instead of none.

## `transcriptAutoGenerated` (type: `boolean`):

Use YouTube's automatic captions when the creator didn't upload any. Most videos only have those.

## `transcriptFormat` (type: `string`):

Plain text is always included. Timestamped adds every line with its start time and duration. SRT and VTT add a ready subtitle file as text.

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

Top-level comments to include per video: text, likes, reply count, when posted, pinned, and whether the channel owner wrote it. Commenters' names aren't collected. Charged per comment. 0 turns comments off.

## `commentsSort` (type: `string`):

Top comments as YouTube ranks them, or the newest first.

## `monitorMode` (type: `boolean`):

Remembers what each search, channel and playlist returned and only outputs videos that are new since the last run. Use with a Schedule. The first run returns the current videos as the baseline. Runs that find nothing new cost nothing but the start.

## `notifyWebhookUrl` (type: `string`):

Paste a Discord or Slack incoming webhook URL to get each run's videos as a message with thumbnails. Any other URL gets the rows as JSON. Only sent when the run delivers something; in monitor mode the first run's baseline isn't sent.

## `stateStoreName` (type: `string`):

Named key-value store that keeps monitor memory between runs. Use different names to run independent monitors.

## `stateRetentionDays` (type: `integer`):

Searches, channels and playlists not checked for this many days are dropped from monitor memory.

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

Videos fetched at the same time, each request on its own proxy IP.

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

Apify datacenter proxies work for YouTube. When YouTube asks a datacenter IP to sign in before listing a video's captions, the Actor retries that one request on a residential IP by itself.

## Actor input object example

```json
{
  "searchQueries": [
    "home espresso machine review"
  ],
  "startUrls": [
    {
      "url": "https://www.youtube.com/@mkbhd"
    }
  ],
  "maxResults": 20,
  "channelTabs": [
    "videos"
  ],
  "sortBy": "relevance",
  "uploadDate": "any",
  "duration": "any",
  "searchType": "video",
  "includeDetails": true,
  "includeTranscript": false,
  "transcriptLanguages": [
    "en"
  ],
  "transcriptAnyLanguage": true,
  "transcriptAutoGenerated": true,
  "transcriptFormat": "text",
  "maxComments": 0,
  "commentsSort": "top",
  "monitorMode": false,
  "stateStoreName": "youtube-monitor-state",
  "stateRetentionDays": 90,
  "maxConcurrency": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Dataset items, one per video or unmatched input. Field meanings are in the dataset schema.

# 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": [
        "home espresso machine review"
    ],
    "startUrls": [
        {
            "url": "https://www.youtube.com/@mkbhd"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("hydedata/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": ["home espresso machine review"],
    "startUrls": [{ "url": "https://www.youtube.com/@mkbhd" }],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("hydedata/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": [
    "home espresso machine review"
  ],
  "startUrls": [
    {
      "url": "https://www.youtube.com/@mkbhd"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call hydedata/youtube-scraper --silent --output-dataset

```

## MCP server setup

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