# YouTube Scraper - Search, Channels, Shorts & Video Details (`pink_comic/youtube-scraper`) Actor

Scrape YouTube search results, channel videos, shorts and streams: title, views, likes, comments, duration, date, tags, description, channel stats. No API key.

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

## Pricing

from $1.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 - Search, Channels, Shorts & Video Details

Scrape **YouTube search results, channel videos, Shorts and live streams**, plus full **video details**. Each row has the title, URL, channel (name, ID, handle, subscribers), views, duration and upload time; with details on you also get the **exact publish date, likes, comment count, full description, tags and category**. Uses YouTube's own public web data. **No API key, no quota, no login.**

### Why this YouTube scraper

- **One actor, every input.** Search terms, channel handles/URLs (videos, Shorts or streams tab) and individual video links in the same run.
- **No YouTube Data API quota.** No Google Cloud project, no 10,000-unit daily limit.
- **Fast.** Reads YouTube's internal JSON (the same data the website loads), 20-30 videos per request. Thousands of channel videos in a minute or two.
- **Real search filters.** Sort by relevance, upload date, view count or rating; upload date (hour/today/week/month/year); duration (short/medium/long).
- **Channel stats on every row.** Subscribers, video count, handle and description for channel inputs.
- **Fair pricing.** $0.0015 per video + $0.002 per run. Details are included at no extra cost.

### Use cases

- **Influencer and creator discovery**: search a niche, rank channels by views and subscribers.
- **Competitor and brand monitoring**: track every new upload from a list of channels with a daily schedule.
- **Content and SEO research**: find top videos, titles, tags and durations for any keyword.
- **Market research and trend tracking**: see what is being published this week on any topic.
- **AI agents and RAG**: feed structured video metadata and descriptions to an LLM. Pair with our YouTube Comments Scraper for audience sentiment.

### Input examples

Search (default):

```json
{ "searchQueries": ["web scraping tutorial"], "maxResults": 50 }
```

Newest uploads this week for two keywords, sorted by date, Shorts excluded:

```json
{ "searchQueries": ["iphone 17 review", "pixel 11 review"], "sortBy": "date", "uploadDate": "week", "includeShorts": false, "maxResultsPerInput": 100, "maxResults": 200 }
```

Latest 40 videos from two channels with full details (likes, exact dates, tags):

```json
{ "channelUrls": ["@mkbhd", "https://www.youtube.com/@LofiGirl"], "maxResultsPerInput": 40, "maxResults": 80, "includeVideoDetails": true }
```

A channel's Shorts:

```json
{ "channelUrls": ["@mkbhd"], "channelTab": "shorts", "maxResults": 100 }
```

Specific videos:

```json
{ "videoUrls": ["https://youtu.be/dQw4w9WgXcQ", "https://www.youtube.com/shorts/CVzeQbNqkCk"] }
```

### Sample output

```json
{
  "type": "video",
  "videoId": "hdMszZ2ah5Q",
  "url": "https://www.youtube.com/watch?v=hdMszZ2ah5Q",
  "title": "Macbook PROLED Review: It's Not About That",
  "channelName": "Marques Brownlee",
  "channelId": "UCBJycsmduvYEL83R_U4JriQ",
  "channelHandle": "@mkbhd",
  "channelSubscribers": 21400000,
  "channelVideoCount": 1800,
  "viewCount": 5422723,
  "likeCount": 71124,
  "commentCount": 3900,
  "duration": "15:14",
  "durationSeconds": 913,
  "publishedTimeText": "2 days ago",
  "publishedAt": "2026-11-11T10:43:56-08:00",
  "category": "Science & Technology",
  "description": "Incredible laptop. But don't get distracted...",
  "isShort": false,
  "thumbnail": "https://i.ytimg.com/vi/hdMszZ2ah5Q/hqdefault.jpg",
  "input": "@mkbhd",
  "inputType": "channel",
  "scrapedAt": "2026-11-14T17:29:44Z"
}
```

| Field | Description |
|---|---|
| type, videoId, url, title, thumbnail | Video basics (`video`, `short` or `live`) |
| channelName, channelId, channelUrl, channelHandle | Channel |
| channelSubscribers, channelVideoCount, channelDescription | Channel stats (channel inputs) |
| viewCount, viewCountText, duration, durationSeconds | Stats as listed |
| publishedTimeText, publishedDateApprox | Upload time as listed |
| likeCount, commentCount, publishedAt, dateText, description, tags, category | Full details (details on or video inputs; tags/category when YouTube provides them) |
| input, inputType | What produced the row |

### Pricing

Pay per event: **$0.002 per run start + $0.0015 per video**, details included. 50 videos ≈ $0.08, 1,000 videos ≈ $1.50. Set a max charge on the run to cap spend; the actor stops at your budget.

### FAQ

**Do I need a YouTube API key?** No. The actor uses YouTube's public web data, so there is no API quota.

**How many results per search?** YouTube typically serves a few hundred results per query. Use several queries or filters (upload date, duration) to go deeper. Channels can be scraped back to their first upload.

**Are view counts exact?** Search and channel lists show YouTube's display value (exact in search, rounded on channel pages, e.g. 5.4M). Turn on `includeVideoDetails` for exact view counts, likes and publish dates.

**Can I get comments or transcripts?** Use our YouTube Comments Scraper for comments and replies.

**Is it legal?** The actor reads publicly available data without logging in. Use the data in line with applicable laws and YouTube's terms.

# Actor input Schema

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

YouTube search queries, e.g. 'iphone 17 review'. Each query returns up to Max results per input.

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

Channel handles or URLs: '@mkbhd', 'https://www.youtube.com/@LofiGirl', 'https://www.youtube.com/channel/UC...'. Returns the channel's videos, shorts or streams.

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

Individual video or Shorts links (or 11-character IDs) to get full details for.

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

Which channel tab to scrape (newest first).

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

Search result order.

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

Only search results uploaded in this window.

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

Search video length filter.

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

Keep Shorts that appear in search results.

## `includeVideoDetails` (type: `boolean`):

Open each video to add exact publish date, likes, comment count, full description, tags and category (slower, same price). Always on for Video URLs.

## `maxResultsPerInput` (type: `integer`):

Cap per search term or channel. 0 = use Max results.

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

Maximum videos in total. Default 50 = about $0.08.

## Actor input object example

```json
{
  "searchQueries": [
    "web scraping tutorial"
  ],
  "channelTab": "videos",
  "sortBy": "relevance",
  "uploadDate": "any",
  "duration": "any",
  "includeShorts": true,
  "includeVideoDetails": false,
  "maxResultsPerInput": 0,
  "maxResults": 50
}
```

# Actor output Schema

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

All records from this run in the default dataset, shown with the Overview table view.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchQueries": [
        "web scraping tutorial"
    ],
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("pink_comic/youtube-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchQueries": ["web scraping tutorial"],
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("pink_comic/youtube-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQueries": [
    "web scraping tutorial"
  ],
  "maxResults": 50
}' |
apify call pink_comic/youtube-scraper --silent --output-dataset

```

## MCP server setup

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