# YouTube Scraper - Search & Channel Videos (`yegnata/youtube-scraper`) Actor

Scrape YouTube search results and channel videos and Shorts without an API key: title, channel, views, publish date, duration, thumbnail and more. Pay only per video.

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

## Pricing

from $2.00 / 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 - Videos, Channels, Search & Likes

Scrape **YouTube search results, channel videos and Shorts, or any list of video links** with no API key, quota or login. For every video: title, channel, view count, publish date, duration, thumbnail and link. Turn on **Full video details** for **likes, comment count, exact publish date, full description, hashtags and channel subscribers**. Use **Only new videos** to monitor channels and searches on a schedule without paying twice for the same video.

### What you get

| title | channelName | viewCount | publishedText | duration |
|---|---|---|---|---|
| Macbook PROLED XDR Impressions: They Said They Wouldn't! | Marques Brownlee | 10,000,000 | 3d ago | 10:54 |
| iPhone Duo Review: First Generation Fun! | Marques Brownlee | 13,000,000 | 11d ago | 29:05 |
| Python for Beginners - Learn Coding with Python in 1 Hour | Programming with Mosh | 25,799,716 | 6 years ago | 1:00:06 |

With **Full video details** (always on for video links) you also get `likes`, `commentCount`, an exact `publishedDate` (`publishedDateExact: true`), the full `description`, `hashtags` and `channelSubscribers`.

Every video also has `videoId`, `url`, `type` (video or short), `channelId`, `channelUrl`, `channelSubscribers` (channels), `publishedDate` (approximate, from "3 days ago"), `durationSeconds`, `isLive`, `descriptionSnippet` (search), `thumbnail`, `source` (which search or channel it came from), `position` and `scrapedAt`.

### Use cases

- **Trend and topic research:** see what ranks for a keyword this week and how many views it gets.
- **Competitor and creator tracking:** follow channels' uploads, views and posting rhythm.
- **Influencer discovery:** search a niche and collect the channels behind the top videos.
- **Data for AI and analytics:** feed fresh video lists into dashboards, RAG or recommendation tools.
- **Video performance tracking:** paste your own or competitors' video links and record views, likes and comments over time.
- **Monitoring on a schedule:** with **Only new videos**, an hourly or daily run returns just the uploads you haven't seen yet.

### How much does it cost?

You pay **$2.00 per 1,000 videos**, nothing else. No YouTube API key, so no quota limits. Set *Maximum results* to cap your spend.

### How to use it

1. Add **Search queries** (like the YouTube search box), **Channels** (`@mkbhd`, a channel URL or a `UC…` ID) and/or **Video URLs**.
2. Optionally turn on **Full video details** and **Only new videos**, and pick **Sort** (relevance or popularity), **Search: upload date** (hour, today, week, month, year), **Posted within (days)** and **Include channel Shorts**.
3. Click **Start** and download as JSON, CSV or Excel, or pull results by API.

### Input example

```json
{
  "searchQueries": ["iphone 17 review", "best budget laptop"],
  "uploadDate": "week",
  "channels": ["@mkbhd", "https://www.youtube.com/@veritasium"],
  "includeShorts": true,
  "includeVideoDetails": true,
  "onlyNewVideos": true,
  "maxResultsPerSource": 100,
  "maxItems": 1000
}
```

### Speed

About 1,200 channel videos a minute; search is a little slower (20 results per page). **Full video details** opens each video (8 at a time), so expect about 150–300 videos a minute.

### FAQ

**Do I need a YouTube API key?** No.

**How exact is `publishedDate`?** In search and channel lists YouTube only shows relative times ("3 days ago"), so the date is approximate (`publishedDateExact: false`). With **Full video details** or video links it's the exact date from the video page (`publishedDateExact: true`).

**Why do some Shorts have no date?** Channel pages don't show a date for Shorts. When *Posted within (days)* is set, Shorts are skipped because their age can't be checked.

**How does "Only new videos" work?** The Actor remembers which videos it already returned for each search, channel and video list in your account (in a key-value store named `youtube-scraper-seen`) and skips them next time. For a channel that means new uploads. For a search it means results you haven't received yet, so combine it with **Search: upload date** to focus on fresh videos.

**Can I sort search by upload date?** YouTube removed that sort option in 2025. Use **Search: upload date** (e.g. *This week*) or **Posted within (days)** to get recent videos.

**A channel returned nothing.** It's listed under `FAILED_SOURCES` in the run's key-value store. Check the handle opens in your browser.

**Something broke.** Open an issue on the Issues tab; fixes usually ship within 24 hours.

# Actor input Schema

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

Search YouTube like the search box, e.g. "python tutorial". Returns videos.

## `channels` (type: `array`):

Channel @handles, URLs or IDs: "@mkbhd", "https://www.youtube.com/@mkbhd", "UCBJycsmduvYEL83R_U4JriQ". Returns the channel's videos, newest first.

## `videos` (type: `array`):

Individual videos or Shorts (watch, youtu.be or Shorts links, or IDs). Returns full details for each: exact date, views, likes, comment count, description, hashtags, channel subscribers.

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

For search and channel results too: open each video for its exact publish date, likes, comment count, full description, hashtags and channel subscribers. Slower, same price.

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

Also get each channel's Shorts.

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

Skip videos this Actor already returned for the same search, channel or video list in earlier runs on your account. Ideal for daily or hourly schedules.

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

Order of search results. Channels are always newest first.

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

Only search videos uploaded in this window.

## `postedWithinDays` (type: `integer`):

Keep only videos published in the last N days (from YouTube's "3 days ago" labels). Channel Shorts have no date, so they are skipped when this is set.

## `maxResultsPerSource` (type: `integer`):

Limit for each search query and each channel.

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

Stop after this many videos in total. You are charged per video, so this caps your cost.

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

Not needed for normal use.

## Actor input object example

```json
{
  "searchQueries": [
    "python tutorial"
  ],
  "includeVideoDetails": false,
  "includeShorts": false,
  "onlyNewVideos": false,
  "sortBy": "relevance",
  "uploadDate": "any",
  "maxResultsPerSource": 50,
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Every video saved in this run.

# 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": [
        "python tutorial"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("yegnata/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": ["python tutorial"] }

# Run the Actor and wait for it to finish
run = client.actor("yegnata/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": [
    "python tutorial"
  ]
}' |
apify call yegnata/youtube-scraper --silent --output-dataset

```

## MCP server setup

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