# YouTube Scraper –Videos, Shorts, Channels & Playlists (`aiconsulting/youtube-scraper`) Actor

Fast HTTP-only YouTube Scraper for videos, channels, Shorts, playlists, and keyword search. Extract titles, URLs, thumbnails, durations, and available view counts. Monitor new uploads, scrape multiple channels, and export clean JSON. No browser, login, or YouTube API key required.

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

## Pricing

from $0.85 / 1,000 youtube 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 API — Videos, Channels, Shorts, Playlists & Search

### 1. What Is YouTube Scraper?

**Fast HTTP-only YouTube data extraction API for developers, researchers, marketers, businesses, and AI agents.**

Extract public YouTube video metadata from channels, Shorts, keyword searches, and playlists. Discover new uploads, export structured JSON, and integrate with your applications using Apify.

**No YouTube Data API key. No browser automation. No coding required to start.**

**Transparent Pay-Per-Event pricing from $0.85 per 1,000 videos for eligible Apify subscription tiers.**

[Run YouTube Scraper](https://apify.com/aiconsulting/youtube-scraper) · [API Documentation](https://apify.com/aiconsulting/youtube-scraper/api) · [AIConsulting Profile](https://apify.com/aiconsulting)

#### At a Glance

| Feature | Description |
|---|---|
| Architecture | HTTP-only |
| Primary output | Structured YouTube video records |
| Supported sources | Channels, Shorts, search, public playlists |
| Monitoring | Persistent new-video discovery |
| Pagination | Supported where available |
| Deduplication | Video ID |
| Maximum results | 1,000 per run |
| Default example | 10 videos |
| Output | JSON, CSV, Excel |
| Integration | REST API, Python, JavaScript, automation, AI agents |
| Pricing | Pay Per Event |
| Billing unit | One video saved to the default Dataset |
| Platform usage | Included in event pricing |

#### Verified Performance

| Test | Videos | Duration |
|---|---:|---:|
| Default example | 10 | Approximately 2 seconds |
| Historical extraction | 100 | Approximately 6 seconds |
| Historical extraction | 500 | Approximately 14–18 seconds |

These are observed results, not guaranteed execution times.

#### Scope

This Actor extracts publicly available video-listing metadata. It does not download videos or audio, extract transcripts, scrape comments, or guarantee complete video-page metadata.

## Optional fields such as view counts, channel names, descriptions, and exact publication timestamps depend on the extraction mode and source availability.

### 2. Why Choose This YouTube Scraper?

| Feature | Benefit |
|---|---|
| HTTP-only extraction | Avoids the overhead of launching headless browsers |
| No YouTube API key | No Google Cloud project or YouTube Data API credentials required |
| Channel scraping | Discover public videos across multiple listing pages |
| Shorts scraping | Extract videos from a channel's Shorts tab |
| Keyword search | Discover relevant videos using search phrases |
| Playlist extraction | Collect available video listings from public playlists |
| Multiple sources | Process several channels, searches, or playlists in one run |
| Global result limit | Control the maximum number of exported records |
| Round-robin output | Distribute results across sources rather than exhausting the limit on the first source |
| Deduplication | Avoid duplicate video IDs within a run |
| New-video monitoring | Track previously encountered videos across repeated runs |
| Clean JSON | Omit unavailable properties rather than exporting unnecessary null values |
| Apify integration | Use datasets, REST API, SDKs, schedules, and webhooks |
| AI-ready data | Supply video metadata to research systems, databases, and AI agents |

The primary advantage is **efficient, structured YouTube data collection with minimal infrastructure overhead**.

Actual performance depends on target availability, network conditions, pagination requirements, and runtime configuration.

***

### 3. Quick Start — Run Your First YouTube Scrape

1. Open [YouTube Scraper on Apify](https://apify.com/aiconsulting/youtube-scraper).
2. Click **Run Actor**.
3. Open the Input tab.
4. Select **Restore example input**.
5. Click **Start**.
6. Inspect the dataset in the Output tab.
7. Export results as JSON, CSV, or Excel if required.

#### Verified Restored Example Input

```json
{
  "mode": "channelHttp",
  "channelIds": [
    "UCnJjcn5FrgrOEp5_N45ZLEQ"
  ],
  "searchQueries": [],
  "playlistUrls": [],
  "channelTab": "videos",
  "onlyNewVideos": false,
  "maxResults": 10,
  "maxPagesPerSource": 2,
  "maxConcurrency": 3,
  "requestTimeoutSecs": 15,
  "metadataEnrichment": "none"
}
```

This configuration was tested on **November 13, 2026**.

| Metric | Observed result |
|---|---|
| Execution status | SUCCEEDED |
| Video records | 10 |
| Successful sources | 1 |
| Failed sources | 0 |
| Listing pages fetched | 1 |
| Actor-reported processing time | 824 ms |
| Monitoring state writes | 0 |

These figures describe a specific successful run, not a guaranteed execution time.

The prefilled example uses a previously tested public channel and a small output limit to make first-time execution straightforward.

**Important:** Apify may use restored example inputs for automated Store quality tests. Keep the production prefill valid and monitoring disabled, because a successful repeated monitoring run can legitimately produce zero new records.

***

### 4. Supported Extraction Modes

| Mode | Input | Primary purpose | Status |
|---|---|---|---|
| `channelHttp` | Channel IDs, handles, or URLs | Public channel video extraction | Tested |
| `channelHttp` + `shorts` | Channel IDs, handles, or URLs | Public channel Shorts | Tested |
| `search` | Keyword phrases | YouTube search results | Tested |
| `playlist` | Public playlist IDs or URLs | Public playlist discovery | Basic extraction tested |
| `channelFeed` | Canonical UC channel IDs | Recent uploads via YouTube RSS | Available; coverage depends on feed |

#### 4.1 Channel Videos

Use the public Videos tab to discover content published by a specific channel.

```json
{
  "mode": "channelHttp",
  "channelIds": [
    "UCnJjcn5FrgrOEp5_N45ZLEQ"
  ],
  "channelTab": "videos",
  "maxResults": 100,
  "maxPagesPerSource": 10,
  "metadataEnrichment": "none"
}
```

The Actor follows available continuation pages up to the configured limit.

Typical data includes video IDs, titles, URLs, durations, relative publication times, and thumbnails.

Channel-level metadata such as view counts or exact publishing dates may not be present in listing responses.

#### 4.2 YouTube Shorts

Extract available Shorts from a public channel.

```json
{
  "mode": "channelHttp",
  "channelIds": [
    "UCnJjcn5FrgrOEp5_N45ZLEQ"
  ],
  "channelTab": "shorts",
  "maxResults": 30,
  "maxPagesPerSource": 3
}
```

Shorts can expose a different metadata structure from standard videos. Output fields are included only when the source supplies them.

#### 4.3 YouTube Keyword Search

Discover videos using one or more search queries.

```json
{
  "mode": "search",
  "searchQueries": [
    "artificial intelligence tutorial",
    "machine learning for beginners"
  ],
  "maxResults": 60,
  "maxPagesPerSource": 3,
  "metadataEnrichment": "none"
}
```

Search results may include channel names, channel IDs, view counts, video durations, relative publication text, and thumbnails.

Search ranking and available fields are determined by YouTube.

#### 4.4 YouTube Playlist Scraper

Extract video listings from public playlists.

```json
{
  "mode": "playlist",
  "playlistUrls": [
    "YOUR_PUBLIC_PLAYLIST_URL"
  ],
  "maxResults": 30,
  "maxPagesPerSource": 3
}
```

Replace `YOUR_PUBLIC_PLAYLIST_URL` with a real public YouTube playlist URL or supported playlist ID.

Basic playlist extraction has been validated. Comprehensive continuation pagination for very large playlists is **not yet verified**.

Private, inaccessible, deleted, or restricted playlists are not guaranteed to work.

#### 4.5 Multiple Channels in One Run

```json
{
  "mode": "channelHttp",
  "channelIds": [
    "UCnJjcn5FrgrOEp5_N45ZLEQ",
    "UC8butISFwT-Wl7EV0hUK0BQ"
  ],
  "channelTab": "videos",
  "maxResults": 60,
  "maxPagesPerSource": 3,
  "maxConcurrency": 2
}
```

The Actor collects candidate records from each source, deduplicates by video ID, and interleaves results across sources.

**`maxResults` is a global output limit, not a per-channel limit.**

The distribution depends on how many accessible video records each source provides.

#### 4.6 Multiple Search Queries

```json
{
  "mode": "search",
  "searchQueries": [
    "AI agents tutorial",
    "LangGraph tutorial",
    "retrieval augmented generation"
  ],
  "maxResults": 90,
  "maxPagesPerSource": 3,
  "maxConcurrency": 3
}
```

Useful for content research, topic discovery, competitive analysis, and building research datasets.

***

### 5. New-Video Monitoring — Discover Only Unseen Uploads

The Actor supports persistent video monitoring for channel extraction and RSS-feed modes.

This allows recurring workflows to focus on videos that have not appeared in earlier monitoring runs.

#### Example: Monitor a YouTube Channel

```json
{
  "mode": "channelHttp",
  "channelIds": [
    "UC8butISFwT-Wl7EV0hUK0BQ"
  ],
  "channelTab": "videos",
  "maxResults": 30,
  "maxPagesPerSource": 3,
  "onlyNewVideos": true,
  "metadataEnrichment": "none"
}
```

#### How Monitoring Works

**First run:**

- Extract video listings.
- Emit unseen video records.
- Store their video IDs in persistent Apify storage.

**Subsequent runs:**

- Compare discovered video IDs against saved monitoring state.
- Skip previously seen videos.
- Emit newly encountered videos.
- Update the saved state.

If there are no unseen videos, a successful run may return an empty dataset.

This is expected behavior, not necessarily a scraping failure.

#### Persistent State

Monitoring uses a named Apify key-value store:

```text
youtube-scraper-monitor-v1
```

State is tracked by canonical YouTube UC channel ID.

The implementation retains a rolling history of up to **5,000 video IDs per channel**.

For reliable tracking, use canonical `UC...` channel IDs and execute monitoring runs for the same channel sequentially.

**Important limitations:**

- Monitoring tracks newly discovered video IDs, not exact publishing timestamps.
- Videos can be discovered after their original upload time.
- The state window is finite.
- Running the same monitored source concurrently can cause competing state updates.
- Monitoring is supported in `channelHttp` and `channelFeed`, not in search or playlist mode.

#### Alternative: Channel RSS Feed

```json
{
  "mode": "channelFeed",
  "channelIds": [
    "UC8butISFwT-Wl7EV0hUK0BQ"
  ],
  "maxResults": 15,
  "onlyNewVideos": true
}
```

RSS feeds generally expose recent channel uploads rather than a complete historical video archive.

***

### 6. Input Schema — Complete Developer Reference

The Actor accepts a JSON object.

#### Input Fields

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `channelHttp` | Extraction mode |
| `channelIds` | string\[] | Prefilled example channel | Channel IDs, handles, or URLs |
| `searchQueries` | string\[] | `[]` | Search keywords |
| `playlistUrls` | string\[] | `[]` | Public playlist IDs or URLs |
| `channelTab` | string | `videos` | `videos` or `shorts` |
| `onlyNewVideos` | boolean | `false` | Persist monitoring state and emit unseen videos |
| `maxResults` | integer | `30` | Global result cap; valid range 1–1,000 |
| `maxPagesPerSource` | integer | `10` | Page limit; valid range 1–100 |
| `maxConcurrency` | integer | `3` | Concurrent source processing; valid range 1–10 |
| `requestTimeoutSecs` | integer | `15` | HTTP timeout; valid range 5–60 seconds |
| `metadataEnrichment` | string | `none` | `none` or best-effort `feed` |

**Prefill distinction:** The restored example uses `maxResults: 10` and `maxPagesPerSource: 2`, even though their general schema defaults are 30 and 10.

#### Mode-Dependent Input Requirements

| Mode | Required source field |
|---|---|
| `channelHttp` | Non-empty `channelIds` |
| `search` | Non-empty `searchQueries` |
| `playlist` | Non-empty `playlistUrls` |
| `channelFeed` | Non-empty `channelIds` containing canonical UC IDs |

Although the top-level input schema does not mark these arrays universally required, the runtime requires a non-empty source list for the selected mode.

#### Input JSON Schema Reference

The following condensed JSON Schema describes the principal public input contract. The actual Apify input schema also includes UI editors, descriptions, and example prefill values.

```json
{
  "type": "object",
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "channelHttp",
        "search",
        "playlist",
        "channelFeed"
      ]
    },
    "channelIds": {
      "type": "array",
      "items": {"type": "string"}
    },
    "searchQueries": {
      "type": "array",
      "items": {"type": "string"}
    },
    "playlistUrls": {
      "type": "array",
      "items": {"type": "string"}
    },
    "channelTab": {
      "type": "string",
      "enum": ["videos", "shorts"]
    },
    "onlyNewVideos": {
      "type": "boolean"
    },
    "maxResults": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000
    },
    "maxPagesPerSource": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "maxConcurrency": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10
    },
    "requestTimeoutSecs": {
      "type": "integer",
      "minimum": 5,
      "maximum": 60
    },
    "metadataEnrichment": {
      "type": "string",
      "enum": ["none", "feed"]
    }
  }
}
```

For executable validation and the current user-interface configuration, refer to the Actor's **Input** tab.

***

### 7. Output Data Schema — Structured YouTube Metadata

Each exported dataset item represents a discovered YouTube video.

The Actor removes properties whose values are `null` or `undefined`.

Consequently, not every record contains every optional field.

#### Example: Channel Video Record

Actual example structure from the validated channel test:

```json
{
  "title": "8k Video: PUSHPA PUSHPA | Pushpa 2 The Rule | Allu Arjun | Sukumar | Devi Sri Prasad",
  "url": "https://www.youtube.com/watch?v=uG-HSYxwEG4",
  "channelId": "UCnJjcn5FrgrOEp5_N45ZLEQ",
  "videoId": "uG-HSYxwEG4",
  "durationSeconds": 253,
  "publishedText": "4d ago",
  "thumbnailUrl": "https://i.ytimg.com/vi/uG-HSYxwEG4/hq720.jpg",
  "scrapedAt": "2026-11-13T13:09:54.884Z"
}
```

The thumbnail URL above is shortened for readability. Actual thumbnail URLs may include additional query parameters.

#### Example: YouTube Search Result

Based on the validated search output:

```json
{
  "title": "AI, Machine Learning, Deep Learning and Generative AI Explained",
  "url": "https://www.youtube.com/watch?v=qYNweeDHiyU",
  "channelName": "IBM Technology",
  "channelId": "UCKWaEZ-_VweaEx1j62do_vQ",
  "videoId": "qYNweeDHiyU",
  "viewCount": 3855517,
  "durationSeconds": 601,
  "publishedText": "2y ago",
  "thumbnailUrl": "https://i.ytimg.com/vi/qYNweeDHiyU/hq720.jpg",
  "scrapedAt": "2026-11-12T10:32:30.993Z"
}
```

#### Complete Output Field Reference

| Field | Type | Meaning |
|---|---|---|
| `videoId` | string | YouTube video identifier |
| `url` | string | Video or Shorts URL |
| `title` | string | Video title |
| `description` | string | Description, if available |
| `channelId` | string | Channel identifier |
| `channelName` | string | Channel display name |
| `channelUrl` | string | Channel URL |
| `thumbnailUrl` | string | Video thumbnail URL |
| `thumbnailWidth` | integer | Thumbnail width, if available |
| `thumbnailHeight` | integer | Thumbnail height, if available |
| `publishedText` | string | Relative publishing information |
| `publishedDate` | string | Publication date, if resolved |
| `publishedAt` | string | Exact publication timestamp, if resolved |
| `viewCount` | integer | Available view count |
| `likeCount` | integer | Like count, if available |
| `durationSeconds` | integer | Video duration in seconds |
| `isShort` | boolean | Shorts classification when known |
| `scrapedAt` | string | UTC timestamp of extraction |

The values in this table represent the schema's supported fields, **not guaranteed fields for every record**.

`videoId`, `url`, and `scrapedAt` are part of the required output contract.

#### Metadata Availability by Mode

| Metadata | Channel videos | Keyword search | Shorts | Playlists |
|---|---|---|---|---|
| Video ID and URL | Yes | Yes | Yes | When extracted |
| Title | Usually | Usually | Usually | When available |
| Channel ID | Typically | Often | Source-dependent | Source-dependent |
| Channel name | Often unavailable | Often available | Source-dependent | Source-dependent |
| Duration | Often available | Often available | Sometimes missing | Source-dependent |
| Views | Often unavailable | Frequently available | Sometimes available | Source-dependent |
| Relative publishing time | Often available | Often available | Source-dependent | Source-dependent |
| Exact publication timestamp | Not guaranteed | Not guaranteed | Not guaranteed | Not guaranteed |
| Thumbnail | Often available | Often available | Source-dependent | Source-dependent |
| Description | Limited | Limited | Limited | Limited |

Availability is determined by the public YouTube response and the selected mode.

#### Dataset Views

The Actor provides two dataset views:

**Overview:** compact fields optimized for easy browsing.

**All available video metadata:** expanded presentation including optional channel names, view counts, publication fields, and other supported attributes.

The overview is a display projection; it does not necessarily show every field stored in a raw record.

**Developer recommendation:** Retrieve raw dataset items without the `view` parameter when your application needs every available field.

***

### 8. YouTube Scraper REST API

The Actor is accessible through Apify API v2.

**Actor identifier:**

```text
aiconsulting~youtube-scraper
```

**Base API URL:**

```text
https://api.apify.com/v2
```

Create an Apify API token in your Apify account settings and pass it securely through environment variables or an authorization header.

Never expose your API token in public frontend code.

#### 8.1 Run the Actor Synchronously — cURL

Use this when the expected execution is short and you want the dataset returned in the same HTTP response.

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/aiconsulting~youtube-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "search",
    "searchQueries": ["AI agents tutorial"],
    "maxResults": 20,
    "maxPagesPerSource": 2
  }'
```

The endpoint returns dataset items as JSON when the Actor finishes successfully within the synchronous request limit.

Apify's synchronous API has a 300-second execution limit. For longer jobs, prefer asynchronous execution.

#### 8.2 Start an Asynchronous Run

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/aiconsulting~youtube-scraper/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "channelHttp",
    "channelIds": [
      "UCnJjcn5FrgrOEp5_N45ZLEQ"
    ],
    "maxResults": 100
  }'
```

The API returns a run object containing identifiers and status information.

Use the returned run ID or default dataset ID to retrieve results after completion.

#### 8.3 Retrieve Run Status

```bash
curl \
  "https://api.apify.com/v2/actor-runs/RUN_ID" \
  -H "Authorization: Bearer $APIFY_TOKEN"
```

Replace `RUN_ID` with the actual identifier returned by the API.

#### 8.4 Retrieve Dataset Records

```bash
curl \
  "https://api.apify.com/v2/datasets/DATASET_ID/items?format=json" \
  -H "Authorization: Bearer $APIFY_TOKEN"
```

To retrieve CSV:

```bash
curl \
  "https://api.apify.com/v2/datasets/DATASET_ID/items?format=csv" \
  -H "Authorization: Bearer $APIFY_TOKEN"
```

#### 8.5 Select Specific Fields

Apify's dataset API supports field projection.

```bash
curl \
  "https://api.apify.com/v2/datasets/DATASET_ID/items?format=json&fields=videoId,title,url,viewCount" \
  -H "Authorization: Bearer $APIFY_TOKEN"
```

This is useful for downstream services that require a stable subset of fields.

***

### 9. Python Integration — Official Apify Client

[![Python Client](https://img.shields.io/badge/Official%20SDK-Python-3776AB?style=for-the-badge)](https://docs.apify.com/api/client/python)

#### Installation

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

Configure your token securely:

```bash
export APIFY_TOKEN="YOUR_APIFY_API_TOKEN"
```

#### Python Example: Search YouTube and Process Results

```python
import os
import json
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])

actor_input = {
    "mode": "search",
    "searchQueries": [
        "artificial intelligence tutorial"
    ],
    "maxResults": 30,
    "maxPagesPerSource": 3,
    "metadataEnrichment": "none"
}

run = client.actor(
    "aiconsulting/youtube-scraper"
).call(run_input=actor_input)

if run["status"] != "SUCCEEDED":
    raise RuntimeError(
        f"Actor ended with status: {run['status']}"
    )

dataset_id = run["defaultDatasetId"]

videos = list(
    client.dataset(dataset_id).iterate_items()
)

print(f"Extracted {len(videos)} videos")

for video in videos:
    print(json.dumps({
        "videoId": video.get("videoId"),
        "title": video.get("title"),
        "url": video.get("url"),
        "views": video.get("viewCount")
    }, ensure_ascii=False))
```

**Production note:** The Python client handles Apify API communication. Your application should still inspect the Actor's `RUN_SUMMARY` to detect source-level partial failures.

#### Python Example: Filter Results by View Count

```python
popular_videos = [
    video for video in videos
    if isinstance(video.get("viewCount"), int)
    and video["viewCount"] >= 100000
]

popular_videos.sort(
    key=lambda video: video["viewCount"],
    reverse=True
)

for video in popular_videos:
    print(video["viewCount"], video["title"])
```

Only videos with a populated numeric `viewCount` participate in this filter.

***

### 10. JavaScript / Node.js Integration

[![JavaScript Client](https://img.shields.io/badge/Official%20SDK-JavaScript-F7DF1E?style=for-the-badge)](https://docs.apify.com/api/client/js)

#### Installation

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

#### JavaScript Example: Extract Channel Videos

```javascript
import { ApifyClient } from "apify-client";

const client = new ApifyClient({
  token: process.env.APIFY_TOKEN,
});

const input = {
  mode: "channelHttp",
  channelIds: [
    "UCnJjcn5FrgrOEp5_N45ZLEQ"
  ],
  channelTab: "videos",
  maxResults: 30,
  maxPagesPerSource: 3,
  onlyNewVideos: false,
};

const run = await client
  .actor("aiconsulting/youtube-scraper")
  .call(input);

if (run.status !== "SUCCEEDED") {
  throw new Error(
    `Actor ended with status: ${run.status}`
  );
}

const { items } = await client
  .dataset(run.defaultDatasetId)
  .listItems();

console.log(`Videos: ${items.length}`);

for (const video of items) {
  console.log({
    title: video.title,
    videoId: video.videoId,
    url: video.url,
    viewCount: video.viewCount,
  });
}
```

#### JavaScript Example: Convert Records Into Application Data

```javascript
const normalizedVideos = items.map((video) => ({
  id: video.videoId,
  title: video.title ?? "",
  url: video.url,
  channelId: video.channelId ?? null,
  channelName: video.channelName ?? null,
  views: video.viewCount ?? null,
  duration: video.durationSeconds ?? null,
  discoveredAt: video.scrapedAt,
}));

console.log(normalizedVideos);
```

The Actor omits unavailable properties; downstream applications can choose their own normalized schema.

***

### 11. Run Summary — Operational Metadata

In addition to the video dataset, every successful execution writes a `RUN_SUMMARY` record to the run's default key-value store.

This record is important for monitoring, automated workflows, operational reporting, and distinguishing success from partial failure.

#### Example Summary Structure

```json
{
  "status": "SUCCEEDED",
  "mode": "channelHttp",
  "inputCount": 1,
  "uniqueTargets": 1,
  "successfulRequests": 1,
  "failedRequests": 0,
  "extractedRecords": 10,
  "previouslySeen": 0,
  "filteredOut": 0,
  "unknownPublishedAt": 30,
  "monitoringEnabled": false,
  "stateWrites": 0,
  "elapsedMs": 824
}
```

This is a shortened representation of the actual successful November 13 test. The complete summary additionally contains metadata coverage, enrichment details, source statistics, and failures.

#### Retrieve RUN_SUMMARY via REST API

```bash
curl \
  "https://api.apify.com/v2/key-value-stores/KEY_VALUE_STORE_ID/records/RUN_SUMMARY" \
  -H "Authorization: Bearer $APIFY_TOKEN"
```

Use the run object's `defaultKeyValueStoreId`.

#### Recommended Production Validation

A robust integration should evaluate:

1. Apify run status.
2. `RUN_SUMMARY.status`.
3. `RUN_SUMMARY.failedRequests`.
4. Dataset record count.
5. Required fields in returned records.

**Important:** A run may finish at the platform level while its internal summary indicates partial source failures. Do not use dataset record count alone to determine operational quality.

`metadataCoverage` describes fetched candidate records, which can exceed the number actually exported.

***

### 12. Integrations — n8n, Make, Zapier, Webhooks & AI Agents

The Actor can be used through Apify's platform integration capabilities and REST API.

#### 12.1 n8n Integration

**Example: YouTube Channel Monitoring Pipeline**

```text
Schedule Trigger
       |
       v
Apify Actor Run
       |
       v
Wait for Completion
       |
       v
Retrieve Dataset
       |
       v
Filter New Videos
       |
       v
Google Sheets / Database / Slack
```

Suggested process:

1. Configure a scheduled trigger in n8n.
2. Start `aiconsulting/youtube-scraper` through an Apify-compatible node or HTTP request.
3. Use `onlyNewVideos: true`.
4. Wait for the run to finish.
5. Retrieve its dataset and inspect its summary.
6. Store or forward newly discovered video records.

**Example application:** Monitor competing YouTube channels and update a marketing research database.

#### 12.2 Make Integration

A typical Make scenario:

```text
Scheduler
   |
   v
Apify: Run Actor
   |
   v
Retrieve Dataset Items
   |
   v
Google Sheets / Airtable / Notion
```

The exact modules depend on the available Make integration and account configuration.

#### 12.3 Zapier Integration

Use Apify's supported Zapier integration or webhooks to trigger downstream actions after completed runs.

Potential destinations include:

- Google Sheets
- Airtable
- Slack
- Email
- CRM systems
- Custom HTTP endpoints

#### 12.4 Webhook Automation

Apify supports Actor-run webhooks.

Example workflow:

```text
YouTube Scraper Run
        |
        v
Run Completed Event
        |
        v
Webhook Receiver
        |
        v
Read Run Summary + Dataset
        |
        v
Application / Database
```

For production systems, verify the completed run status before treating results as successful.

#### 12.5 Scheduled Monitoring

Use [Apify Schedules](https://docs.apify.com/platform/schedules) to run the Actor periodically.

Potential schedules include:

- Every hour
- Every six hours
- Daily
- Weekly

The best interval depends on monitoring needs, source activity, API usage, and operating costs.

Avoid overlapping runs monitoring the same channel ID.

***

### 13. MCP and AI-Agent Integration

[![MCP](https://img.shields.io/badge/AI%20Agents-Apify%20MCP-7C3AED?style=for-the-badge)](https://mcp.apify.com/)

Apify supports connecting Actors to AI-agent environments through its MCP infrastructure.

When this Actor is made available through an appropriately configured Apify MCP server, compatible clients can use it to obtain public YouTube metadata for AI workflows.

#### Example AI-Agent Workflow

```text
User Research Request
         |
         v
AI Agent / MCP Client
         |
         v
YouTube Scraper Actor
         |
         v
Structured Video Metadata
         |
         v
Filtering / Ranking / Analysis
         |
         v
Research Report
```

#### Example Research Request

> Find public YouTube videos about reinforcement learning and AI agents, then organize the available titles, channels, URLs, and view counts into a research dataset.

The agent can call the configured Actor, process returned metadata, and produce structured recommendations or reports.

**Important:** The Actor does not extract video transcripts or understand the content of the video itself. Downstream AI analysis based only on listing data must not be presented as transcript-level analysis.

#### Suitable AI Applications

- AI content discovery
- Video research assistants
- Competitive intelligence agents
- Knowledge-base source discovery
- Marketing research automation
- RAG source collection using video metadata
- Recommendation and ranking pipelines

AI-agent compatibility depends on the MCP client and server configuration. The Actor's data-extraction capabilities remain the same.

***

### 14. Developer Use Cases

#### YouTube SEO & Content Research

Discover competing videos for specific search phrases.

Analyze:

- Video titles
- Search-result presence
- Available view counts
- Channel names
- Video durations
- Relative publishing information

Use extracted metadata to inform topic selection and content research.

The Actor does not provide official YouTube Analytics account metrics.

#### Creator & Influencer Research

Collect public video listings from selected channels and build a structured discovery database.

Useful for agencies, content strategists, and creator research teams.

#### Competitor Video Monitoring

Monitor newly discovered uploads from selected public channels.

Connect the results to messaging tools, dashboards, or databases.

#### Market Intelligence

Discover videos about industries, technologies, products, competitors, and emerging topics.

#### Research & Academic Workflows

Collect public video metadata for research projects involving communication, education, technology, and content trends.

#### AI & LLM Applications

Use structured metadata in agent workflows, content indexing, recommendation systems, or research interfaces.

***

### 15. Performance Benchmarks

The following measurements come from actual development and acceptance runs.

| Test | Records | Pages | Actor-reported time |
|---|---:|---:|---:|
| Channel extraction | 500 | 17 | 12.47 seconds |
| Channel extraction | 30 | 1 | 1.99 seconds |
| Keyword search | 30 | 2 | 2.53 seconds |
| Restored example input | 10 | 1 | 824 ms |

#### What These Numbers Mean

They illustrate the performance of the Actor under specific tested conditions.

They do **not** guarantee that every channel or query will produce identical results or execution times.

Execution time varies with:

- YouTube response times
- Network availability
- Number of sources
- Pagination depth
- Requested result count
- Metadata enrichment
- Runtime resources

The lightweight HTTP-only design avoids browser startup overhead, but external failures and throttling remain possible.

***

### 16. Pagination, Limits & Deduplication

#### Global Output Limit

`maxResults` controls the maximum number of emitted records across all input sources.

Example:

```json
{
  "mode": "search",
  "searchQueries": [
    "AI research",
    "deep learning",
    "machine learning"
  ],
  "maxResults": 90
}
```

The Actor may emit **up to 90 total records**, not 90 per query.

#### Pagination

`maxPagesPerSource` bounds listing-page traversal where available.

Results can stop earlier when no further continuation data is available.

#### Deduplication

The Actor deduplicates discovered records by `videoId` within a run.

Identical videos appearing in multiple sources are not intentionally exported twice.

#### Round-Robin Selection

For multiple successful sources, the Actor interleaves results when applying the global output limit.

This helps prevent one source from consuming the entire output allowance before the others contribute records.

Equal distribution is not guaranteed.

***

### 17. Error Handling & Operational Reliability

#### Source Failure

A source may fail due to:

- Temporary network problems
- YouTube response changes
- Request timeouts
- Restricted or unavailable content
- Invalid source identifiers
- HTTP access limitations

The Actor reports source failures in its execution summary.

#### Partial Success

If several sources are supplied and some succeed while others fail, the Actor can produce partial results.

Inspect:

```text
RUN_SUMMARY.status
RUN_SUMMARY.failedRequests
RUN_SUMMARY.failures
RUN_SUMMARY.sourceStats
```

#### Zero Output Records

Zero records may indicate:

- No available results
- Monitoring found no unseen videos
- The selected source has no accessible matching videos
- A source returned an unexpected response
- Pagination or result limits prevented discovery

Inspect the run logs and summary before classifying an empty dataset as a failure.

#### Metadata Availability

An omitted field does not necessarily indicate a parser error.

It may simply be absent from YouTube's source response.

***

### 18. Production Deployment & Apify Automated Quality Checks

Apify can periodically test public Actors using their restored example input.

To reduce avoidable failures, this Actor's default example uses a small, previously tested public channel request.

#### Recommended Release Checklist

- Confirm the intended build is tagged `latest`.
- Open Input → Restore example input.
- Verify that the channel ID is populated.
- Keep `onlyNewVideos` disabled in the example.
- Run without modifying the restored values.
- Verify successful execution.
- Confirm the expected dataset records.
- Inspect `RUN_SUMMARY`.
- Ensure execution completes within five minutes.
- Repeat the smoke test after input-schema or runtime changes.

The restored example successfully returned **10 records in the November 13, 2026 acceptance test**.

A successful historical test does not eliminate the possibility of future upstream connectivity failures.

For Apify maintenance guidance, see:

[Apify — Troubleshooting an Actor marked Under maintenance](https://help.apify.com/en/articles/10057123-troubleshooting-an-actor-marked-under-maintenance)

***

### 19. Pricing & Billing

YouTube Scraper uses **Apify Pay-Per-Event (PPE) pricing**.

Customers pay for video records written to the Actor's default Dataset, plus the applicable Actor Start event.

Standard platform usage costs are included in the configured event prices.

#### 19.1 Current Pricing

| Apify plan | Price per video | Price per 1,000 videos |
|---|---:|---:|
| Free | $0.00140 | $1.40 |
| Starter (Bronze) | $0.00120 | $1.20 |
| Scale (Silver) | $0.00100 | $1.00 |
| Business (Gold) | $0.00085 | $0.85 |

These prices were configured on November 18, 2026.

For authoritative current rates, consult the Actor's [Pricing tab](https://apify.com/aiconsulting/youtube-scraper).

**Important:** The Apify Free plan has a configured per-video event price. Eligible customers may have platform-provided free usage credits, subject to Apify's applicable terms.

#### 19.2 What Is a Billable Video?

The primary event is:

`apify-default-dataset-item`

Displayed as:

**YouTube Video**

One event is triggered whenever one video record is written to the default Dataset.

Under this configuration:

- A saved video record generates one video event.
- A saved Shorts record generates one video event.
- A saved video discovered through keyword search generates one video event.
- A saved video discovered through a public playlist generates one video event.
- Records missing optional metadata remain billable.
- Duplicate candidates excluded before Dataset storage do not generate video events.
- Records filtered out before storage do not generate video events.
- Previously seen videos excluded by monitoring do not generate video events.
- Failed requests that produce no Dataset records do not generate video events.

The billing mechanism counts Dataset writes. It does not independently assess the completeness of each record's optional metadata.

#### 19.3 Actor Start Event

The second configured billing event is:

`apify-actor-start`

Price:

**$0.00005 per start event**

Apify determines the applicable number of start events according to its billing rules and memory allocation.

At the current 2 GB allocation, our validated run triggered two Actor Start events.

Therefore:

```text
2 × $0.00005 = $0.00010
```

The Actor Start mechanism includes eligible initial compute coverage under Apify's documented PPE rules.

Customers should inspect the actual event counts for their completed runs.

#### 19.4 Example Customer Costs

The following examples assume all videos are delivered in one run and exactly two Actor Start events apply.

| Videos delivered | Free | Starter | Scale | Business |
|---|---:|---:|---:|---:|
| 10 | $0.01410 | $0.01210 | $0.01010 | $0.00860 |
| 30 | $0.04210 | $0.03610 | $0.03010 | $0.02560 |
| 100 | $0.14010 | $0.12010 | $0.10010 | $0.08510 |
| 500 | $0.70010 | $0.60010 | $0.50010 | $0.42510 |
| 1,000 | $1.40010 | $1.20010 | $1.00010 | $0.85010 |

These are illustrative calculations, not guaranteed invoices.

Actual billing depends on triggered event counts, the applicable subscription tier, spending-limit behavior, and Apify's current pricing rules.

#### 19.5 Example: 500 Videos on Starter

```text
500 YouTube Video events
× $0.00120
= $0.60000

2 Actor Start events
× $0.00005
= $0.00010

Estimated total = $0.60010
```

#### 19.6 What If Fewer Videos Are Found?

Suppose you request 500 videos but the Actor saves only 120.

The expected primary billing count is 120 video events.

For a Starter customer:

```text
120 × $0.00120 = $0.14400
```

The applicable Actor Start charge is additional.

Customers are not charged for videos merely because they were requested.

#### 19.7 Monitoring and Billing

The Actor supports persistent monitoring using `onlyNewVideos: true`.

When monitoring is enabled, previously seen video IDs are excluded from the output.

The primary per-video charge therefore applies only to newly saved Dataset records.

For example:

```text
Videos examined: 100
Previously seen: 90
New videos saved: 10

Billable video events: 10
```

Applicable Actor Start charges are additional.

A monitoring run that finds no new videos may produce zero video events while still triggering Actor Start charges.

#### 19.8 Empty and Partial Runs

For a run with no video Dataset records:

- No default Dataset video-item events should be generated.
- Applicable Actor Start events may still be charged.

For partial runs:

- Successfully saved video records remain billable.
- Failed source requests do not independently generate video-item events.
- Optional metadata missing from otherwise valid video records does not remove their billable status.

Always inspect the actual run's Triggered events.

#### 19.9 Verified Billing Test

On November 18, 2026, the monetized Actor completed a successful ten-video extraction.

| Metric | Verified result |
|---|---:|
| Platform status | SUCCEEDED |
| Videos saved | 10 |
| YouTube Video events | 10 |
| Actor Start events | 2 |
| Memory allocated | 2 GB |
| Failed source requests | 0 |
| Execution duration | Approximately 2 seconds |

The video Dataset contained ten identifiable video records.

The primary billing event count matched the number of delivered records.

At the Starter rate:

```text
10 × $0.00120 = $0.01200

2 × $0.00005 = $0.00010

Expected total = $0.01210
```

This test verifies successful-run billing event counts.

It does not independently reconcile the monetary charge against Apify's billing ledger or establish billing behavior for every failure scenario.

#### 19.10 Metadata Availability

The verified ten-video run used:

`metadataEnrichment: "none"`

Its results included:

- Video titles
- Video IDs
- Video URLs
- Channel IDs
- Video durations
- Relative publication text
- Thumbnail URLs
- Extraction timestamps

The run did not provide populated channel names, view counts, descriptions, or exact publication dates.

Those fields remain optional and depend on extraction mode, enrichment, and source availability.

Customers are billed for the delivered video record, not for a guaranteed number of populated metadata fields.

#### 19.11 Spending Limits

Apify supports maximum-cost-per-run controls.

Customers should:

1. Set an appropriate maximum cost.
2. Begin with a small `maxResults`.
3. Keep `maxPagesPerSource` conservative.
4. Use `metadataEnrichment: "none"` when enrichment is unnecessary.
5. Review the completed Dataset and `RUN_SUMMARY`.
6. Verify triggered billing events.

Reaching a spending limit may prevent all requested records from being delivered.

#### 19.12 Platform Usage Costs

The configured pricing includes standard platform usage within the event charges.

Customers are not separately billed standard underlying Actor platform usage under this PPE configuration.

This does not mean the execution infrastructure has zero cost.

#### 19.13 How to Verify Billing

After completing an Actor run:

1. Open the run details in Apify Console.
2. Expand **Triggered events**.
3. Check the **YouTube Video** event count.
4. Check the **Actor Start** event count.
5. Compare the video event count with the saved Dataset records.
6. Apply the pricing for the relevant Apify subscription tier.

The platform usage cost displayed in a run's header should not be treated as the complete customer-facing PPE charge.

#### 19.14 Official Documentation

- [Apify Pay-Per-Event](https://docs.apify.com/actors/monetize/pay-per-event)
- [Apify Monetization](https://docs.apify.com/actors/monetize)
- [Apify API Documentation](https://docs.apify.com/api/v2)

For current prices, always consult the [public Actor listing](https://apify.com/aiconsulting/youtube-scraper).

***

### 20. Frequently Asked Questions

#### Is this an official YouTube API?

No. This is an independent public-data extraction tool and is not affiliated with or endorsed by YouTube or Google.

#### Do I need a YouTube Data API key?

No. The Actor uses HTTP-based extraction and does not require the official YouTube Data API.

#### Do I need to log in to YouTube?

No. The Actor is designed for publicly accessible information.

#### Can I scrape videos from a YouTube channel?

Yes. Use `mode: "channelHttp"` with a channel ID, handle, or supported channel URL.

#### Can I scrape YouTube Shorts?

Yes. Select `channelTab: "shorts"` in channel mode. Search results may also include Shorts.

#### Can I search YouTube using keywords?

Yes. Use `mode: "search"` and provide one or more phrases in `searchQueries`.

#### Can I extract YouTube playlist videos?

Yes, for accessible public playlist listings. Large-playlist continuation coverage has not yet been comprehensively validated.

#### Can I scrape multiple channels at once?

Yes. Provide multiple channel identifiers in `channelIds`.

#### Does the Actor support pagination?

Yes, where available in the supported listing response. Use `maxPagesPerSource` to control traversal.

#### Can it scrape an entire channel archive?

It can retrieve multiple pages, but full archival completeness is not guaranteed. Results depend on source availability and configured limits.

#### Does it return video view counts?

Where available. Search results frequently expose view counts, while channel video listings may not.

#### Does it return channel names?

Where available. Channel names may be absent from channel-listing responses.

#### Does it return exact video upload dates?

Not reliably in every mode. Relative publication text is more commonly available. RSS enrichment may provide additional date information for recent uploads.

#### Does it download YouTube videos or audio?

No. This is a metadata extraction Actor, not a media downloader.

#### Does it extract transcripts or subtitles?

No.

#### Does it extract comments and likes?

It does not provide comprehensive comment or engagement-detail scraping. The output schema supports optional metadata such as like counts only where actually available.

#### Can it monitor newly uploaded videos?

It can identify previously unseen video IDs across repeated channel-monitoring runs. This is discovery-based monitoring, not a guaranteed real-time YouTube notification system.

#### Can I run it automatically every day?

Yes. Use Apify Schedules or an external automation system.

#### Can I integrate it with Python or JavaScript?

Yes. Use the official Apify clients or the REST API.

#### Can I connect it to n8n or Make?

Yes, through supported Apify integrations or REST API workflows.

#### Can I use it with AI agents?

Yes, where the Actor is exposed to compatible agent infrastructure through Apify APIs or MCP configuration.

#### Why are some output fields missing?

The scraper intentionally omits unavailable properties. Different YouTube sources expose different metadata.

#### Why does the Output table show fewer fields than the raw JSON?

The dataset's default overview is a selected-field view. Switch to the expanded metadata view or retrieve raw dataset items through the API.

#### Why did a monitoring run produce no items?

The source may contain no video IDs that are new relative to saved monitoring state. Inspect `RUN_SUMMARY.previouslySeen`.

#### Is there a maximum output limit?

The public input schema supports `maxResults` from 1 to 1,000 per run, subject to available source content and pagination limits.

#### Does the Actor work on private or members-only videos?

Private, authenticated, or restricted content is not a supported guarantee.

#### Is performance guaranteed?

No. Network conditions, external website changes, and runtime configuration affect execution.

***

### 21. Troubleshooting

| Problem | Likely cause | Recommended action |
|---|---|---|
| No input provided | Selected mode has no source entries | Populate the appropriate input array |
| Channel request failed | Temporary network or source-access issue | Retry with a known public channel |
| Search returned fewer results | Available listings or page limits | Increase `maxPagesPerSource` cautiously |
| Playlist returned limited records | Restricted source or unverified deep continuation | Test another public playlist |
| Monitoring returned zero records | All discovered IDs were previously seen | Inspect persistent monitoring summary |
| Missing view counts | Source does not expose them | Try keyword search mode |
| Missing exact dates | Listing response lacks date information | Treat date fields as optional |
| Actor is slower than expected | Larger workload, latency, or enrichment | Reduce limits or disable enrichment |
| API returns unauthorized | Invalid or missing token | Check the Apify token and authorization header |
| Overview hides metadata | Dataset view projection | Use expanded metadata view or raw dataset API |

If a production run fails, retain its run ID, input, logs, and `RUN_SUMMARY` for diagnosis.

***

### 22. Recommended Production Integration Pattern

For applications requiring dependable data collection, use the following workflow:

```text
Application / Scheduler
          |
          v
Validate Input
          |
          v
Start YouTube Scraper
          |
          v
Wait for Run Completion
          |
          v
Check Platform Run Status
          |
          v
Retrieve RUN_SUMMARY
          |
          v
Retrieve Raw Dataset Items
          |
          v
Validate Required Fields
          |
          v
Deduplicate / Normalize
          |
          v
Database / Analytics / AI Agent
```

#### Best Practices

- Store the input used for each run.
- Preserve the Apify run ID.
- Check source-level failures.
- Treat optional metadata as optional.
- Use canonical channel IDs for monitoring.
- Avoid overlapping monitoring runs for identical channels.
- Validate video URLs and IDs before downstream use.
- Use database uniqueness constraints for cross-run deduplication.
- Monitor extraction success over time.
- Test restored example input before promoting changes to production.

***

### 23. Integration Resources

| Resource | Link |
|---|---|
| YouTube Scraper Actor | [Open Actor](https://apify.com/aiconsulting/youtube-scraper) |
| AIConsulting Profile | [Developer Profile](https://apify.com/aiconsulting) |
| Apify REST API | [API Documentation](https://docs.apify.com/api/v2) |
| Python SDK | [Apify Python Client](https://docs.apify.com/api/client/python) |
| JavaScript SDK | [Apify JavaScript Client](https://docs.apify.com/api/client/js) |
| Apify Datasets | [Dataset Documentation](https://docs.apify.com/platform/storage/dataset) |
| Apify Schedules | [Scheduling Documentation](https://docs.apify.com/platform/schedules) |
| Apify MCP | [MCP Server](https://mcp.apify.com/) |
| Apify Platform | [Apify](https://apify.com/) |

***

### 24. Support & Feature Requests

For issues, feature requests, or unexpected results, use the **Issues** tab on the Actor's Apify Marketplace listing.

Include:

- Selected extraction mode
- Input JSON with secrets removed
- Apify run ID
- Relevant execution logs
- Expected behavior
- Actual behavior

Helpful reports make it easier to reproduce source-specific problems and improve reliability.

***

### 25. Responsible Use & Limitations

This Actor is designed to extract publicly accessible video-listing information.

Users are responsible for complying with applicable laws, privacy requirements, YouTube's terms, and any relevant platform usage restrictions.

The Actor:

- Does not require an authenticated YouTube account.
- Does not use the official YouTube Data API.
- Does not bypass private-content access requirements.
- Does not guarantee complete historical coverage.
- Does not guarantee every metadata property.
- Does not download video or audio media.
- Does not provide transcript or comment extraction.
- Does not guarantee uninterrupted third-party website access.

YouTube may change its site, responses, or access restrictions at any time.

***

### 26. About AIConsulting

[AIConsulting](https://apify.com/aiconsulting) develops HTTP-first web scrapers, structured-data APIs, and automation tools for developers, businesses, researchers, and AI applications.

#### Our Published Apify Actors

| Actor | Primary purpose |
|---|---|
| [Google Maps Reviews Scraper](https://apify.com/aiconsulting/google-maps-reviews-scraper) | Individual Google reviews, ratings, dates, reviewer information, photos, and owner responses |
| [Google Maps Scraper](https://apify.com/aiconsulting/google-maps-scraper) | Business discovery, phone numbers, websites, addresses, and location intelligence |
| [Google Flights Scraper](https://apify.com/aiconsulting/google-flights-scraper-v2) | Flight prices, routes, schedules, and itinerary data |
| [YouTube Scraper](https://apify.com/aiconsulting/youtube-scraper) | Videos, Shorts, channels, playlists, search, and new-video monitoring |

#### Our Engineering Philosophy

**Fast extraction. Clean JSON. Practical automation.**

We focus on efficient execution, transparent pricing, developer-friendly documentation, and practical data products.

***

### Start Extracting YouTube Data

Turn publicly accessible YouTube listings into structured data for research, content discovery, analytics, automation, and AI applications.

**HTTP-only extraction. Structured video metadata. Transparent pay-per-video pricing.**

[Start YouTube Scraper](https://apify.com/aiconsulting/youtube-scraper) · [View Pricing](https://apify.com/aiconsulting/youtube-scraper) · [Explore AIConsulting](https://apify.com/aiconsulting)

***

**Related search topics:** YouTube scraper, YouTube API alternative, YouTube videos scraper, YouTube Shorts scraper, YouTube channel scraper, YouTube playlist scraper, YouTube search scraper, YouTube metadata extraction, YouTube video monitoring, Apify YouTube scraper, YouTube Python API, YouTube JavaScript API, YouTube scraping automation, YouTube video discovery, n8n YouTube integration, AI agents, MCP, structured video data.

*Search terms describe documented capabilities and do not imply unsupported functionality.*

# Actor input Schema

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

Choose the source type. Channel videos, search, Shorts and basic playlist extraction have been tested. Channel feed provides recent RSS uploads only.

## `channelIds` (type: `array`):

Channel IDs (UC...), @handles or YouTube channel URLs. Used by Channel videos/Shorts. RSS mode requires UC channel IDs. For persistent monitoring, UC IDs are recommended. A tested channel ID is prefilled so first-run examples and automated Store quality checks return results.

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

One or more YouTube search phrases. Used only in Search mode.

## `playlistUrls` (type: `array`):

Public YouTube playlist IDs or URLs. Used only in Playlist mode. Extraction of playlists spanning several pages is not yet verified.

## `channelTab` (type: `string`):

Select Videos or Shorts on the channel. Applies only to Channel videos/Shorts mode.

## `onlyNewVideos` (type: `boolean`):

Emit only videos not seen in earlier runs. Available for Channel videos/Shorts and RSS modes; uses persistent Actor storage. Run sequentially when monitoring the same channels.

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

Global maximum number of records emitted across all sources (not per source). Source fetching may retrieve more items than this limit.

## `maxPagesPerSource` (type: `integer`):

Maximum listing pages fetched per source, where pagination is available.

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

Concurrent source requests (web continuation requests within each source remain sequential).

## `requestTimeoutSecs` (type: `integer`):

Timeout per HTTP request.

## `metadataEnrichment` (type: `string`):

None uses the fastest listing-only path. RSS enrichment may fill in metadata for recently uploaded channel videos; not guaranteed and does not require login or an API key.

## Actor input object example

```json
{
  "mode": "channelHttp",
  "channelIds": [
    "UCnJjcn5FrgrOEp5_N45ZLEQ"
  ],
  "searchQueries": [],
  "playlistUrls": [],
  "channelTab": "videos",
  "onlyNewVideos": false,
  "maxResults": 10,
  "maxPagesPerSource": 2,
  "maxConcurrency": 3,
  "requestTimeoutSecs": 15,
  "metadataEnrichment": "none"
}
```

# Actor output Schema

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

Successfully extracted video metadata in the default dataset.

## `runSummary` (type: `string`):

Request counts, failures, elapsed time and processing statistics.

# 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 = {
    "channelIds": [
        "UCnJjcn5FrgrOEp5_N45ZLEQ"
    ],
    "maxResults": 10,
    "maxPagesPerSource": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("aiconsulting/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 = {
    "channelIds": ["UCnJjcn5FrgrOEp5_N45ZLEQ"],
    "maxResults": 10,
    "maxPagesPerSource": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("aiconsulting/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 '{
  "channelIds": [
    "UCnJjcn5FrgrOEp5_N45ZLEQ"
  ],
  "maxResults": 10,
  "maxPagesPerSource": 2
}' |
apify call aiconsulting/youtube-scraper --silent --output-dataset

```

## MCP server setup

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