# YouTube Scraper Fast | Videos, Channels & Comments, No API Key (`muzafferkadir/youtube-scraper`) Actor

Scrape YouTube videos, channel uploads, and comments by search query or URL. No API key, no login. Returns title, views, likes, duration, channel, and comment data.

- **URL**: https://apify.com/muzafferkadir/youtube-scraper.md
- **Developed by:** [Muzaffer Kadir YILMAZ](https://apify.com/muzafferkadir) (community)
- **Categories:** Videos, Social media, Marketing
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.25 / 1,000 results

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

Scrape **YouTube videos, channels, and comments** by search query or URL — **no API key, no login**. A fast, low-cost YouTube data API alternative for research, ASO/marketing, competitor tracking, and building datasets.

Give it a search term, a channel URL, or a video URL and get clean, structured JSON: title, view count, likes, duration, channel, publish date, description, and full comment threads.

### Features

- **No API key, no quota** — no Google Cloud project, no OAuth, and no 10,000-unit daily quota to manage.
- **Fast and low-cost** — runs finish in seconds.
- **Cheapest result price in its class** — pay-per-result from **$0.25 / 1,000 results**, a fraction of the common $2–4 / 1,000.
- **Four jobs, one Actor** — search, channel uploads, single-video details, and comments.

### What you can scrape

| Give it | You get |
| --- | --- |
| **Search queries** | Videos matching each query (with sort order) |
| **Channel URL / @handle** | That channel's uploaded videos |
| **Video URL** (`resultsType: videos`) | Full details for that video (title, views, likes, description) |
| **Video URL** (`resultsType: comments`) | The video's comments (text, author, likes, replies) |

### Use cases

- **Market & content research** — pull the top videos for any topic and analyze titles, views, and recency.
- **Channel tracking** — export a competitor's or your own channel's uploads and monitor performance over time.
- **Comment mining** — collect comments for sentiment analysis, feedback, or LLM pipelines.
- **Datasets for AI** — build structured YouTube datasets to feed models without touching the official API.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `searchQueries` | string\[] | Free-text searches. Each returns videos. |
| `startUrls` | list | Video URLs (details or comments) or channel URLs / `@handles` (uploads). |
| `resultsType` | enum | For video URLs: `videos` (details) or `comments`. Default `videos`. |
| `maxItems` | integer | Max videos per query/channel. Default 20. |
| `maxComments` | integer | Max comments per video (comments mode). Default 50. |
| `sortBy` | enum | `relevance`, `date`, `views`, or `rating` (search). |
| `language` | string | Interface language (`hl`), e.g. `en`, `tr`, `de`. |
| `country` | string | Content country (`gl`), e.g. `US`, `TR`, `GB`. |

#### Examples

**Search — top 20 videos for a topic**

```json
{
  "searchQueries": ["python pandas tutorial"],
  "maxItems": 20,
  "sortBy": "relevance"
}
```

**Channel uploads**

```json
{
  "startUrls": [{ "url": "https://www.youtube.com/@mkbhd" }],
  "maxItems": 50
}
```

**Comments for a video**

```json
{
  "startUrls": [{ "url": "https://www.youtube.com/watch?v=n61ULEU7CO0" }],
  "resultsType": "comments",
  "maxComments": 200
}
```

### Output

**Video item**

```json
{
  "type": "video",
  "id": "Z6z_feacXW8",
  "url": "https://www.youtube.com/watch?v=Z6z_feacXW8",
  "title": "Galaxy Z Fold 8 Review: Honeymoon's Over",
  "channelName": "Marques Brownlee",
  "channelUrl": "https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ",
  "channelId": "UCBJycsmduvYEL83R_U4JriQ",
  "viewCount": 3900000,
  "viewCountText": "3.9M views",
  "publishedTimeText": "10 days ago",
  "durationSeconds": 696,
  "durationText": "11:36",
  "thumbnailUrl": "https://i.ytimg.com/vi/Z6z_feacXW8/hqdefault.jpg",
  "description": "…",
  "scrapedAt": "2026-08-11T15:00:00.000Z"
}
```

**Comment item**

```json
{
  "type": "comment",
  "commentId": "UgxPS3MhGkaKAUkcBbp4AaABAg",
  "videoId": "n61ULEU7CO0",
  "text": "This is an absolute banger.",
  "author": "@hikaru_hi",
  "authorChannelUrl": "https://www.youtube.com/channel/UC0JPxVytLaypTyvZeJCRdtQ",
  "likeCount": 3700,
  "publishedTimeText": "6 months ago",
  "replyCount": 105,
  "isPinned": false,
  "isHearted": false,
  "scrapedAt": "2026-08-11T15:00:00.000Z"
}
```

Download the dataset as **JSON, CSV, Excel, or XML**, or pull it via the Apify API.

### FAQ

**Do I need a YouTube / Google API key?**
No. This Actor reads YouTube's public pages and returns the same data in a clean, structured form — no API key, no OAuth, no quota.

**Can I export to CSV or Excel?**
Yes. Every run's dataset can be downloaded as CSV, Excel, JSON, or XML, or fetched from the Apify API.

**Does it download videos or transcripts?**
No. It returns metadata, channel data, and comments — not video files or captions.

**What happens if YouTube blocks a request?**
The Actor retries briefly, then returns whatever it collected (or an empty dataset) — it does not fail the run.

### Pricing

Pay-per-event: **$0.01 per run start** (per GB of run memory) plus **$0.25 per 1,000 results**. You only pay for results actually returned. See the **Pricing** tab for current rates.

### Disclaimer

This is an **unofficial** Actor. It is not affiliated with, endorsed by, or sponsored by YouTube or Google LLC. All product names, logos, and trademarks are the property of their respective owners and are used here for identification only.

The Actor collects only publicly available information. It does not log in, create accounts, or bypass access restrictions. Output may include information relating to identifiable people (e.g. comment authors). You are the data controller for anything you collect and are responsible for having a lawful basis to process it under applicable law (such as GDPR or KVKK) and for complying with YouTube's Terms of Service.

# Actor input Schema

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

Free-text YouTube searches. Each query returns videos. Provide searchQueries and/or startUrls.

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

YouTube video URLs (returns details or comments) or channel URLs / @handles (returns the channel's uploads).

## `resultsType` (type: `string`):

When a video URL is given: return the video's own details ("videos") or its comments ("comments"). Ignored for searches and channels, which always return videos.

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

Stop after this many videos for each search query or channel.

## `maxComments` (type: `integer`):

Only used when resultsType is "comments". Stop after this many comments per video.

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

Ordering for search queries.

## `language` (type: `string`):

Interface language code, e.g. en, tr, de.

## `country` (type: `string`):

Content country code, e.g. US, TR, GB.

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

Optional. Leave empty for most runs.

## Actor input object example

```json
{
  "searchQueries": [
    "lofi hip hop"
  ],
  "startUrls": [
    {
      "url": "https://www.youtube.com/@mkbhd"
    }
  ],
  "resultsType": "videos",
  "maxItems": 20,
  "maxComments": 50,
  "sortBy": "relevance",
  "language": "en",
  "country": "US"
}
```

# 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 = {
    "searchQueries": [
        "lofi hip hop"
    ],
    "startUrls": [
        {
            "url": "https://www.youtube.com/@mkbhd"
        }
    ],
    "resultsType": "videos",
    "maxItems": 20,
    "maxComments": 50,
    "sortBy": "relevance",
    "language": "en",
    "country": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("muzafferkadir/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": ["lofi hip hop"],
    "startUrls": [{ "url": "https://www.youtube.com/@mkbhd" }],
    "resultsType": "videos",
    "maxItems": 20,
    "maxComments": 50,
    "sortBy": "relevance",
    "language": "en",
    "country": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("muzafferkadir/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": [
    "lofi hip hop"
  ],
  "startUrls": [
    {
      "url": "https://www.youtube.com/@mkbhd"
    }
  ],
  "resultsType": "videos",
  "maxItems": 20,
  "maxComments": 50,
  "sortBy": "relevance",
  "language": "en",
  "country": "US"
}' |
apify call muzafferkadir/youtube-scraper --silent --output-dataset

```

## MCP server setup

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