# YouTube Scraper (`tacps126/youtube-scraper`) Actor

YouTube videos, Shorts and live streams from searches, channels and playlists: views, likes, comment counts, publish date, hashtags, plus channel subscribers, country, join date and links. YouTube's own search filters. From $2 per 1,000 videos.

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

## Pricing

from $1.60 / 1,000 videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Scraper - Videos, Shorts, Streams, Channels & Search

Scrape **YouTube videos, Shorts and live streams** from searches, channels and playlists with their **views, likes, comment count, publish date, length, hashtags and description**, plus each **channel's subscribers, country, join date, total views and videos, and links**. Use YouTube's own search filters and channel order (Latest, Popular, Oldest).

**Built for** influencer and creator research, competitor and brand monitoring, content and trend analysis, marketing and agency reporting, and datasets for AI and analytics.

**At a glance**

- **Price:** $2 per 1,000 videos. Videos left out by your date filter are free. Free plan: up to 100 videos per run.
- **First run:** the prefilled search and channel return 10 videos in a few seconds, each with views, likes, comment count and channel details.

| title | channelName | viewCount | likes | commentsCount | channelSubscribers |
|---|---|---|---|---|---|
| God-Tier Developer Roadmap | Fireship | 8486956 | 282917 | 10000 | 4330000 |

### What you get

| Field | Example |
|---|---|
| `id`, `url`, `type` | `pEfrdAtAmqk`, the watch link, `video` / `short` / `stream` |
| `title`, `description`, `keywords`, `hashtags` | the uploader's text, tags and `#hashtags` |
| `viewCount`, `likes`, `commentsCount` | `8486956`, `282917`, `10000` |
| `date`, `uploadDate` | `2022-08-24T10:05:46-07:00` |
| `durationSeconds`, `duration` | `684`, `11:24` |
| `category`, `thumbnailUrl` | `Science & Technology`, the largest thumbnail |
| `isLiveContent`, `isLiveNow`, `liveStart`, `liveEnd` | live stream details |
| `isFamilySafe`, `isUnlisted`, `isMembersOnly` | flags |
| `channelName`, `channelId`, `channelUrl`, `channelHandle`, `channelVerified` | `Fireship`, `UCsBjURrPoezykLs9EqgamOA`, `@Fireship` |
| `channelSubscribers`, `channelTotalVideos`, `channelTotalViews` | `4330000`, `861`, `801556367` |
| `channelCountry`, `channelJoined` | `United States`, `2017-04-07` |
| `channelDescription`, `channelKeywords`, `channelLinks` | the About text and the channel's links |
| `channelAvatar`, `channelBanner`, `channelFamilySafe` | images and flag |
| `input`, `scrapedAt` | the search or link the video came from, when it was read |

Counts YouTube shows rounded (for example `10K` comments or `4.33M` subscribers) are given as numbers (`10000`, `4330000`).

### How to use it

```json
{
  "searchQueries": ["air fryer review"],
  "startUrls": [
    "https://www.youtube.com/@Fireship",
    "https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf",
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxResults": 20,
  "maxResultsShorts": 10,
  "sortVideosBy": "POPULAR",
  "dateFilter": "month",
  "sortingOrder": "views"
}
```

- **Searches with YouTube's filters.** Sort by relevance, rating, upload date or views; upload date (last hour to this year); type; length; HD, 4K, subtitles, Creative Commons, live, 3D, 360, VR180, HDR, location, purchased. Search page links work too.
- **Channels.** Paste a `@handle` or channel link. Pick how many videos, Shorts and live streams to take, in Latest, Popular or Oldest order.
- **Playlists and single videos.** Paste the links or video ids.
- **Date filter.** `oldestPostDate` keeps only videos published after a date (`2025-01-31`) or within a period (`7 days`, `3 months`). Older videos are not charged.
- **Channel details.** On by default; each channel's About panel is read once and added to all its videos. Turn it off if you only need the videos.
- **Follow new uploads.** Turn on *Only new videos* and schedule the Actor: each run returns only videos earlier runs haven't delivered.

### Pricing

**$2 per 1,000 videos** plus a small start fee per run. Videos that are private, removed or left out by your date filter are listed in the run summary and are **not charged**.

Free-plan runs return up to 100 videos per run.

### Good to know

- Need transcripts? Use our **YouTube Transcript Scraper** (`tacps126/youtube-transcripts`). Need comments and replies? Use **YouTube Comments Scraper** (`tacps126/youtube-comments`).
- Results can also come straight back in the API response (Apify's `run-sync-get-dataset-items` endpoint), handy for apps and AI agents; agents can run it through Apify's MCP server (`https://mcp.apify.com?tools=tacps126/youtube-scraper`).
- Need another source or a custom feed? **Contact tacps126@gmail.com**.

### FAQ

**Does it need a YouTube API key or a login?** No.

**Why is a video missing?** It is private, removed or restricted, or older than your date filter. The run summary says which.

**Are like and comment counts exact?** Likes are exact. Comment and subscriber counts are as precise as YouTube shows them (YouTube rounds large numbers).

# Actor input Schema

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

What you would type into YouTube search. Each search returns up to `maxResults` videos.

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

Video, Shorts, channel (@handle or channel link), playlist or search page links. Video ids and @handles work too. One per line.

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

Regular videos taken from each search, each channel's Videos tab and each playlist. 0 skips them.

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

Shorts taken from each channel's Shorts tab.

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

Past and current live streams taken from each channel's Live tab.

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

Order of a channel's videos, as the channel page offers it. Tabs without this choice are read latest first.

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

Keep only videos published on or after this date (2025-01-31) or within this period (7 days, 2 weeks, 3 months, 1 year). Older videos are left out and not charged.

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

Search order (YouTube's own filter).

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

Only videos uploaded in this period.

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

Videos (default) or movies.

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

Video length.

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

Only HD videos.

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

Only 4K videos.

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

Only videos with subtitles.

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

Only Creative Commons videos.

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

Only live streams.

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

Only 3D videos.

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

Only 360 degree videos.

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

Only VR180 videos.

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

Only HDR videos.

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

Only videos with a location.

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

Only videos you can buy or rent.

## `includeChannelInfo` (type: `boolean`):

Add each channel's About details to its videos: country, join date, total views and videos, subscribers, description, links, avatar and banner. Read once per channel.

## `maxItems` (type: `integer`):

Stop after this many videos in total.

## `onlyNew` (type: `boolean`):

Skip videos delivered by earlier runs with the same input (or the same monitor name). Schedule the run to follow channels or searches.

## `monitorName` (type: `string`):

Optional name for the only-new history, so runs with different inputs can share it.

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

Optional. Leave empty for the default.

## Actor input object example

```json
{
  "searchQueries": [
    "air fryer review"
  ],
  "startUrls": [
    "https://www.youtube.com/@Fireship"
  ],
  "maxResults": 5,
  "maxResultsShorts": 0,
  "maxResultStreams": 0,
  "sortVideosBy": "NEWEST",
  "includeChannelInfo": true,
  "maxItems": 100,
  "onlyNew": false
}
```

# Actor output Schema

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

One record per video: details, engagement and channel details.

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

Counts, warnings, and whether the run stopped early.

# 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": [
        "air fryer review"
    ],
    "startUrls": [
        "https://www.youtube.com/@Fireship"
    ],
    "maxResults": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("tacps126/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": ["air fryer review"],
    "startUrls": ["https://www.youtube.com/@Fireship"],
    "maxResults": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("tacps126/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": [
    "air fryer review"
  ],
  "startUrls": [
    "https://www.youtube.com/@Fireship"
  ],
  "maxResults": 5
}' |
apify call tacps126/youtube-scraper --silent --output-dataset

```

## MCP server setup

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