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

Extract YouTube videos from keywords, channels and video URLs. Get views, subscribers, dates, duration and thumbnails, with optional comments and related links. Export JSON, CSV or Excel. No YouTube API key required. See README for pricing by Apify plan.

- **URL**: https://apify.com/stefanie-rink/youtube-scraper.md
- **Developed by:** [Steafanie Braid](https://apify.com/stefanie-rink) (community)
- **Categories:** Videos, Social media
- **Features:** Limited permissions
- **Stats:** 994 total users, 25 monthly users, 99.0% runs succeeded, 16 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.40 / 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

### Bulk YouTube video data for search and channel research

Collect public YouTube video metadata from keywords, channel URLs, handles, and individual video links. Compare views and channel subscribers, then export JSON, CSV, or Excel. No YouTube Data API key is required.

Use this Actor to research a topic, compare channel catalogs, or collect video datasets for your own analysis. Optional comments and related video links stay inside each video record.

[Try the Actor](https://console.apify.com/actors/jheyO5l4o9iwJNnsj/input) · [See example Tasks](https://apify.com/stefanie-rink/youtube-scraper/examples)

> **Free-plan pricing change — November 13, 2026:** The price for Apify Free-plan users increases to **$2.00 per 1,000 saved videos**. Until the change takes effect, the price remains $0.50 per 1,000 videos. Paid-plan prices remain **$0.50 for Bronze, $0.45 for Silver, and $0.40 for Gold, Platinum, and Diamond**. The startup charge is unchanged. See [Pricing](#pricing) for the effective time and details.

### Quick start

1. Open the Actor input page.
2. Enter a keyword, a channel handle, or a video URL in **Queries or URLs**.
3. Set **Max results** to the maximum number of videos for each search or channel.
4. Select **Start**.
5. Open the **Output** tab to inspect the results.
6. Select **Export** to download JSON, CSV, or Excel.

The result limit is a ceiling. YouTube can return fewer videos. The default input collects metadata for the public video “Me at the zoo”.

#### Watch the sample workflow

This short recording shows the public sample Task, its saved video, and the CSV export controls.

![Run the sample Task and export its video metadata to CSV](https://api.apify.com/v2/key-value-stores/FJvOKjxHbelhaz5oe/records/youtube-demo.gif)

[Open the recording](https://api.apify.com/v2/key-value-stores/FJvOKjxHbelhaz5oe/records/youtube-demo.gif) · [Open the sample Task](https://apify.com/stefanie-rink/youtube-scraper/examples/extract-youtube-video-metadata)

### Examples and saved Tasks

#### Export YouTube search results to CSV

[Open this example Task](https://apify.com/stefanie-rink/youtube-scraper/examples/export-youtube-search-results-to-csv)

Compare videos about electric cars with relevance sorting:

```json
{
  "queries": ["electric cars"],
  "sort_by": "relevance",
  "max_results": 100,
  "num_comments": 0,
  "related_videos": false
}
```

Each result includes the video title, views, channel, and available subscriber count. The same input accepts several keywords.

Example record observed on October 21, 2026:

```json
{
  "video_id": "c0Qn_14NU2U",
  "duration_seconds": 1351,
  "thumbnail_url": "https://i.ytimg.com/vi/c0Qn_14NU2U/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDwdEWtqvVr2Y2xqbblqT0EAL1UYw",
  "title": "The Electric Range Rover Is Here… But There's a Catch",
  "views": 43681,
  "url": "https://www.youtube.com/watch?v=c0Qn_14NU2U",
  "publication_date": "13h ago",
  "subscribers": 259000,
  "channel_link": "https://www.youtube.com/@Electrifyingcom",
  "channel_name": "Electrifying",
  "comments": [],
  "related_videos": [],
  "data_date": "2026-10-21T12:23:04+00:00"
}
```

#### Find the most viewed videos for a keyword

[Open this example Task](https://apify.com/stefanie-rink/youtube-scraper/examples/find-most-viewed-youtube-videos)

```json
{
  "queries": ["electric cars"],
  "sort_by": "view",
  "max_results": 100,
  "num_comments": 0,
  "related_videos": false
}
```

YouTube supplies the search order. These are the returned search results, not an exhaustive ranking of every matching video.

Example record observed on October 21, 2026:

```json
{
  "video_id": "H39c28VvROk",
  "duration_seconds": 139,
  "thumbnail_url": "https://i.ytimg.com/vi/H39c28VvROk/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAHmdXDfxIcS4D8162VMRMWdOqnCg",
  "title": "I'm Driving in My Car Song | Tim & Dad Ride on BMWi3 Electric Car with TimKo Kid",
  "views": 97772138,
  "url": "https://www.youtube.com/watch?v=H39c28VvROk",
  "publication_date": "8y ago",
  "subscribers": 4410000,
  "channel_link": "https://www.youtube.com/@TimKoKid",
  "channel_name": "TimKo Kid",
  "comments": [],
  "related_videos": [],
  "data_date": "2026-10-21T12:23:12+00:00"
}
```

#### Export videos from a YouTube channel

[Open this example Task](https://apify.com/stefanie-rink/youtube-scraper/examples/export-youtube-channel-videos)

```json
{
  "queries": ["@Google"],
  "sort_by": "relevance",
  "max_results": 100,
  "num_comments": 0,
  "related_videos": false
}
```

Channel handles and channel URLs open the Videos tab. `sort_by` applies to keyword searches only. A channel can expose fewer videos than the requested limit.

Example record observed on October 21, 2026:

```json
{
  "video_id": "WMjVP7QQyDI",
  "duration_seconds": 73,
  "thumbnail_url": "https://i.ytimg.com/vi/WMjVP7QQyDI/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLA4wahhMZt1KqccQOigsLRguXLi1A",
  "title": "Giannis x Google Search: Miami Pickup Hoops",
  "views": 0,
  "url": "https://www.youtube.com/watch?v=WMjVP7QQyDI",
  "publication_date": "21h ago",
  "subscribers": 14600000,
  "channel_link": "https://www.youtube.com/@Google",
  "channel_name": "Google",
  "comments": [],
  "related_videos": [],
  "data_date": "2026-10-21T12:23:17+00:00"
}
```

#### Extract metadata from a video URL

[Open this example Task](https://apify.com/stefanie-rink/youtube-scraper/examples/extract-youtube-video-metadata)

```json
{
  "queries": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
  "sort_by": "relevance",
  "max_results": 1,
  "num_comments": 0,
  "related_videos": false
}
```

Direct watch URLs, `youtu.be` links, and direct `/shorts/VIDEO_ID` URLs are accepted. Direct Shorts support does not include browsing channel Shorts tabs or discovering Shorts separately.

#### Output example

This record was observed on October 21, 2026. Public counts change over time.

```json
{
  "video_id": "jNQXAC9IVRw",
  "duration_seconds": 19,
  "thumbnail_url": "https://i.ytimg.com/vi/jNQXAC9IVRw/hqdefault.jpg?sqp=-oaymwE2CNACELwBSFXyq4qpAygIARUAAIhCGAFwAcABBvABAfgBvgKAAvABigIMCAAQARhVIFkoZTAP&rs=AOn4CLB7NY0fx4yZYDj27223V3b7Sowf5w",
  "title": "Me at the zoo",
  "views": 445602267,
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "publication_date": "2005-04-23",
  "subscribers": 6710000,
  "channel_link": "https://www.youtube.com/@jawed",
  "channel_name": "jawed",
  "comments": [],
  "related_videos": [],
  "data_date": "2026-10-21T12:23:25+00:00"
}
```

### Output fields

The Actor saves one dataset record per collected video. Every record has these fields:

| Field | Type | Meaning |
| --- | --- | --- |
| `title` | string | Video title. |
| `views` | integer or null | Public view count. |
| `url` | string | Canonical watch URL. |
| `publication_date` | string or null | Available calendar date or relative text, such as `3 months ago`. |
| `subscribers` | integer or null | Public channel subscriber count. |
| `channel_link` | string or null | Public channel URL. |
| `channel_name` | string or null | Channel name. |
| `comments` | array of strings | Requested top-level comment text. |
| `related_videos` | array of strings | Requested related video URLs. |
| `data_date` | string | UTC extraction timestamp in ISO format. |
| `video_id` | string | YouTube video identifier. |
| `duration_seconds` | integer or null | Video duration in seconds. Live videos can have no duration. |
| `thumbnail_url` | string or null | Public thumbnail URL. |

`null` means that the value was unavailable. Empty comment and related-video arrays can mean not requested, unavailable, disabled, or blocked.

A result can also contain `enrichment_errors`, an array of reasons why optional video-page data was unavailable. JSON preserves the nested arrays for further processing.

### Pricing

The Free-plan increase takes effect on **November 13, 2026, at 01:15:39 UTC** (04:15:39 in Istanbul). It supports continued operation and maintenance of the Actor. Apify covers Free-plan platform usage, so this increase is not a separate platform-usage fee.

| Apify plan | Before the change, per 1,000 saved videos | From the effective time, per 1,000 saved videos |
| --- | ---: | ---: |
| Free | $0.50 | **$2.00** |
| Bronze | $0.50 | $0.50 |
| Silver | $0.45 | $0.45 |
| Gold, Platinum, and Diamond | $0.40 | $0.40 |

For example, 10,000 saved videos cost Free-plan users $5.00 before the change and $20.00 after it, plus the startup charge. Paid-plan totals remain $5.00 for Bronze, $4.50 for Silver, and $4.00 for Gold, Platinum, and Diamond, plus the startup charge.

The startup event costs $0.00005 per started GB of allocated memory, with a minimum of one event. A run with no results can still incur this charge.

Comments and related links inside a video record have no separate event charge. Fetching those related URLs in another run creates separately charged video records.

The Actor stops when the remaining run budget cannot cover another video. The Console pricing page shows the applicable price before a run.

### Input reference

| Input | Default | Behavior |
| --- | --- | --- |
| `queries` | The sample video URL | Required list of keywords, channel URLs, handles, or video URLs. |
| `sort_by` | `relevance` | Keyword search order: `relevance`, `view`, `date`, or `rating`. |
| `max_results` | `10` | Maximum videos per keyword or channel. Minimum `1`. |
| `num_comments` | `0` | Requested top-level comments per video. Minimum `0`. Best effort. |
| `related_videos` | `false` | Collect related video links. Best effort. |

The legacy `clean` input remains accepted but has no effect. Comments and related links require extra video-page requests and can increase run time.

### Limits and run behavior

- Playlists and transcripts are unsupported.
- Subscriber counts can be `null` when YouTube does not expose them.
- Relative publication dates retain their original precision. The Actor does not invent exact dates.
- Comments contain text only. Comment replies, authors, and dates are not part of the output.
- Comments and related links can be empty when YouTube blocks access or does not expose them.
- Basic search and channel runs use listing data and cached subscriber lookups. They do not open every video page.
- Duplicate input entries are removed. Different keywords can return the same video and produce separate records.
- After a server migration, the Actor resumes saved progress and reconciles pending output before it writes more rows.
- If a source input fails, the run fails and keeps its saved output. `RUN_SUMMARY` lists completed, empty, and failed inputs.
- A valid search with no results succeeds with an empty dataset.
- The Actor does not expose a customer proxy input. Contact support for recurring access errors.

### Related-video research in two runs

This workflow links seed videos to the metadata of their recommendations. It uses the existing related-URL output.

1. Run a few seed video URLs with `related_videos: true`.
2. Collect their `related_videos` URLs.
3. Remove duplicate URLs before the second run.
4. Run those URLs with `related_videos: false`.
5. Join the metadata to each seed using the related video URL.

Related links inside the first run have no separate charge. Each saved video in the second run has the normal video charge.

The recommendations come from signed-out public pages with the current US/English request settings. Time and network location can affect them. They do not reveal personalized recommendations or prove how YouTube ranks videos.

This Python example uses `apify-client` 3.x and an `APIFY_TOKEN` environment variable. It limits the second run to 50 unique related URLs.

```python
import json
import os
from datetime import timedelta
from decimal import Decimal
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
actor = client.actor("stefanie-rink/youtube-scraper")


def collect(queries, related, charge_limit):
    run = actor.call(
        run_input={
            "queries": queries,
            "sort_by": "relevance",
            "max_results": 1,
            "num_comments": 0,
            "related_videos": related,
        },
        max_total_charge_usd=Decimal(charge_limit),
        run_timeout=timedelta(seconds=180),
        memory_mbytes=1024,
    )
    if run is None:
        raise RuntimeError("The run did not return a result.")
    if run.status != "SUCCEEDED":
        raise RuntimeError(f"Run {run.id} ended with {run.status}")
    return list(client.dataset(run.default_dataset_id).iterate_items())


seeds = collect(["https://www.youtube.com/watch?v=jNQXAC9IVRw"], True, "0.01")
urls = list(dict.fromkeys(url for seed in seeds for url in seed["related_videos"]))[:50]
metadata = collect(urls, False, "0.05") if urls else []
by_url = {row["url"]: row for row in metadata}
edges = [
    {"seed_video_id": seed["video_id"], "related_video": by_url[url]}
    for seed in seeds
    for url in seed["related_videos"]
    if url in by_url
]
print(json.dumps(edges, indent=2))
```

`edges` is the output of this example script, not a new Actor output format. An empty related list produces no second run.

### Frequently asked questions

#### How do I scrape YouTube without a YouTube API key?

Use a keyword, channel handle, or public video URL as input. The Actor reads public YouTube pages. Apify API calls still require your Apify token.

#### How do I export YouTube videos to CSV or Excel?

Open the completed run and select **Export** in the Output tab. Select CSV or Excel. JSON is available for nested data.

#### Can I get every video from a channel?

The Actor paginates the public Videos tab up to `max_results`. YouTube can limit the available results. Complete channel coverage is not guaranteed.

#### How do I collect comments?

Set `num_comments` to a positive number. The Actor attempts to collect top-level comment text. The requested count is a ceiling.

#### How do I get subscriber counts?

Subscriber counts are included when available. They can come from video pages, channel headers, or cached channel lookups. Missing counts remain `null`.

#### How much do 10,000 videos cost?

The video charge for 10,000 saved videos is $4.00–$5.00 on paid plans, plus the startup charge. Free-plan users pay $5.00 before the [pricing change](#pricing) and $20.00 after it, plus the startup charge. Optional embedded comments and related links have no separate charge.

#### Can I use the Actor through an API or an AI agent?

Yes. The Console **API** button provides API examples. The [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) also exposes Actors to compatible clients.

Example request: “Use stefanie-rink/youtube-scraper to collect up to 20 videos about electric cars with views and subscriber counts.”

#### What happens when a run fails or moves to another server?

Saved rows remain in the dataset. Migration recovery resumes stored progress. `RUN_SUMMARY` contains cumulative counts and input outcomes.

If recovery detects inconsistent stored rows, it stops before another write. Contact support with the run ID.

### Support

[Open an issue](https://apify.com/stefanie-rink/youtube-scraper/issues) with the run ID and a short description of the problem. Shared run access helps us investigate.

For other inquiries, contact `tnot2652@gmail.com`.

# Changelog

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

# Actor input Schema

## `queries` (type: `array`):

Mix search queries, direct watch URLs, youtu.be URLs, or channel URLs. Bare handles like @Google and scheme-less channel URLs like youtube.com/@Google are accepted. Channel roots are normalized to the Videos tab automatically.

## `sort_by` (type: `string`):

Sorting for text search queries only.

## `max_results` (type: `integer`):

Maximum number of videos to collect per search query or channel URL.

## `num_comments` (type: `integer`):

Best effort. Requesting comments triggers watch-page enrichment for search and channel results and attempts to collect top-level comments from each watch page. Some videos may still return an empty comments array when comments are disabled or YouTube blocks the continuation requests.

## `related_videos` (type: `boolean`):

Best effort. Enabling this triggers watch-page enrichment and attempts to collect related video links from each watch page. Some videos may still return an empty array when YouTube blocks continuation requests.

## Actor input object example

```json
{
  "queries": [
    "music",
    "https://www.youtube.com/@Google",
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "sort_by": "relevance",
  "max_results": 10,
  "num_comments": 0,
  "related_videos": false
}
```

# Actor output Schema

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

URL of the default dataset items endpoint containing one output object per scraped YouTube 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 = {
    "queries": [
        "music",
        "https://www.youtube.com/@Google",
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("stefanie-rink/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 = { "queries": [
        "music",
        "https://www.youtube.com/@Google",
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("stefanie-rink/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 '{
  "queries": [
    "music",
    "https://www.youtube.com/@Google",
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ]
}' |
apify call stefanie-rink/youtube-scraper --silent --output-dataset

```

## MCP server setup

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