# YouTube Scraper (`jimmy-o/youtube-scraper`) Actor

Search YouTube and pull public video details (title, channel, views, date, length, description, tags) - no API key or setup needed. Optional free YouTube Data API key adds official stats and comments. Optional Apify residential proxy for higher volume. Free while in launch promo.

- **URL**: https://apify.com/jimmy-o/youtube-scraper.md
- **Developed by:** [Omar Gamal](https://apify.com/jimmy-o) (community)
- **Categories:** Videos, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 75.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

This YouTube Scraper searches YouTube and collects public video data - **no API
key and no setup needed**. Paste a search query or video URLs and run.

**Free while in launch promo.** The most-used YouTube actors charge ~$4 per
1,000 videos; this one charges $0 - you only spend a little Apify compute.

### Two modes

1. **No key (default):** reads the same public pages your browser loads and
   parses the data YouTube embeds in them. Perfect for small and medium jobs.
   Honest limit: YouTube can throttle datacenter traffic at very high volume.
2. **Optional free YouTube Data API key:** official Google API (10,000 free
   units/day - thousands of videos). Adds official view/like/comment counts and
   top comments. Get a key at
   [console.cloud.google.com](https://console.cloud.google.com): create a
   project, enable **YouTube Data API v3**, create credentials > API key.

### Example

Search query `apify`, max results 5: five videos with title, channel, views,
publish date, length and thumbnail. Or pass video URLs (watch, youtu.be,
shorts, or bare IDs) for full details per video: description, tags, category.

### Optional: Apify residential proxy

For high-volume no-key runs you can set **Proxy = Residential**. Requests then
go through **Apify's own residential proxy service** (no third-party proxies,
no stealth or fingerprint tricks - just a different egress IP). Apify bills
residential proxy traffic per GB on your account.

Measured on this actor: one video page transfers ~0.1 MB, so **the proxy adds
roughly $0.80-$1.30 per 1,000 videos** (at Apify's $8/GB residential rate),
plus about $0.40/1K of compute. Without the proxy, compute alone is a few
cents per 1,000 videos.

### Input

| Field | Notes |
| --- | --- |
| Search query | Like the YouTube search box; top N results (up to 50) |
| Video URLs | watch/youtu.be/shorts links or bare IDs, full details per video |
| API key | Optional; unlocks stats + comments |
| Proxy | Off by default; "Residential" uses Apify's own proxy, billed per GB by Apify |
| Include comments | Top comments per video (API key only) |

### Output per video

Title, channel (name + ID), views, publish date, length, category, tags,
description, thumbnail, URL. With an API key also like/comment counts and a
`comments` array (text, likes, time, reply count).

**Privacy by design:** comment author names are never collected.

### FAQ

**No key needed?** Correct - the default mode reads public pages. The optional
key adds official stats and comments.
**Will it work at scale?** At very high volume YouTube throttles datacenter
IPs; the optional Apify residential proxy covers that case honestly.

### Cost

The actor is free. A typical no-proxy run uses well under $0.01 of Apify
compute. With the residential proxy option, budget roughly $1-$2 of Apify
platform usage per 1,000 videos (measured, see above).

### More free scrapers from jimmy-o

- [UAE Real Estate Scraper](https://apify.com/jimmy-o/uae-real-estate-listings)
- [Saudi Real Estate Scraper](https://apify.com/jimmy-o/saudi-real-estate-listings)
- [Facebook Ads Library Scraper](https://apify.com/jimmy-o/facebook-ads-library)
- [Reddit Scraper](https://apify.com/jimmy-o/reddit-scraper)

# Actor input Schema

## `searchQuery` (type: `string`):

Optional. Search YouTube (like the search box on youtube.com) and collect the top video results.

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

Optional. Full details for specific videos (title, channel, views, publish date, length, description, tags). Accepts watch URLs, youtu.be links, shorts URLs or bare video IDs.

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

How many videos to collect from the search (1-50).

## `apiKey` (type: `string`):

Optional free key from console.cloud.google.com (YouTube Data API v3, 10,000 free units/day). Adds official like/comment counts, channel IDs and top comments. Without it the actor reads public pages, which is fine at low volume.

## `proxy` (type: `string`):

Only for the no-key public-page mode. "Residential" routes page requests through Apify's own residential proxy service (uses your Apify account's proxy usage, billed per GB by Apify). "None" (default) connects directly - fine at low volume. No stealth or fingerprint tricks either way.

## `includeComments` (type: `boolean`):

Collect top comments per video. Requires the YouTube Data API key. Comment author names are not collected.

## `maxCommentsPerVideo` (type: `integer`):

How many comments per video when comments are enabled (0-100).

## Actor input object example

```json
{
  "searchQuery": "",
  "videoUrls": [],
  "maxResults": 10,
  "proxy": "none",
  "includeComments": false,
  "maxCommentsPerVideo": 10
}
```

# Actor output Schema

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

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("jimmy-o/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 = {}

# Run the Actor and wait for it to finish
run = client.actor("jimmy-o/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 '{}' |
apify call jimmy-o/youtube-scraper --silent --output-dataset

```

## MCP server setup

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