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

Scrape public YouTube videos, Shorts, channels, playlists, and search results.

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

## Pricing

$1.20 / 1,000 scraped 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

Scrape public YouTube videos, Shorts, channels, playlists, and search results
without managing a YouTube API key. Export normalized metadata to JSON, CSV,
Excel, the Apify API, webhooks, or MCP.

### What YouTube Scraper collects

- Video and Short titles, IDs, URLs, thumbnails, duration, and publish time
- View counts, live status, channel IDs, names, and URLs
- Channel records returned by search
- Paginated channel, playlist, and search results

### Quick start

```json
{
  "searchQueries": ["web scraping tutorials"],
  "startUrls": ["https://www.youtube.com/@ApifyTech/videos"],
  "contentTypes": ["videos"],
  "maxItems": 50
}
```

Supported inputs include watch URLs, `youtu.be` links, Shorts, channel handles,
channel IDs, playlists, search URLs, and plain search queries.

### Example result

```json
{
  "platform": "youtube",
  "id": "dQw4w9WgXcQ",
  "type": "video",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Example video",
  "channelId": "UC123",
  "channelName": "Example channel",
  "viewCount": 1000000,
  "duration": "3:32",
  "thumbnailUrl": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
  "scrapedAt": "2026-09-14T02:30:00.000Z"
}
```

### Pricing

**$1.20 per 1,000 results** ($0.0012 per `youtube-result` event).

One successfully stored row equals one `youtube-result` event, and Apify proxy
and platform usage are included in that price. Failed URLs or queries are
reported separately and are not charged as results.

### Current MVP limits

Subtitles, comments, media downloads, AI summaries, and authenticated content
are not included yet. Publish times on list pages can be relative strings, so
the oldest-date filter is exact only when YouTube supplies an absolute date.

YouTube directs developers toward its official APIs and restricts scraping in
its policies. Use this Actor only where your collection and use are permitted.
This Actor is not affiliated with Google or YouTube.

### Support

Open an issue with the run ID and source URL/query. Structured failures are in
the run's `ERRORS` key-value record.

Built by [ThriftAPI](https://apify.com/thriftapi). Pay per result. HTTP-first.

# Actor input Schema

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

Video, Short, channel, handle, or playlist URLs.

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

One YouTube search phrase per line.

## `contentTypes` (type: `array`):

Tabs to scrape for channel URLs.

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

Hard cap for all dataset rows in this run.

## `maxItemsPerSource` (type: `integer`):

Maximum number of rows returned for each URL or query.

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

Optional ISO date. Relative dates from list pages cannot always be filtered exactly.

## `includeRaw` (type: `boolean`):

Add the original response object to each dataset row.

## `maxConcurrency` (type: `integer`):

Number of sources processed in parallel.

## `useApifyProxy` (type: `boolean`):

Rotate requests through Apify Proxy when running on the platform.

## `proxyUrls` (type: `array`):

Optional custom proxy URLs used instead of Apify Proxy.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/@ApifyTech/videos"
  ],
  "searchQueries": [
    "web scraping"
  ],
  "contentTypes": [
    "videos"
  ],
  "maxItems": 100,
  "maxItemsPerSource": 100,
  "includeRaw": false,
  "maxConcurrency": 3,
  "useApifyProxy": true
}
```

# Actor output Schema

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

No description

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

No description

## `errors` (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 = {
    "startUrls": [
        "https://www.youtube.com/@ApifyTech/videos"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thriftapi/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 = { "startUrls": ["https://www.youtube.com/@ApifyTech/videos"] }

# Run the Actor and wait for it to finish
run = client.actor("thriftapi/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 '{
  "startUrls": [
    "https://www.youtube.com/@ApifyTech/videos"
  ]
}' |
apify call thriftapi/youtube-scraper --silent --output-dataset

```

## MCP server setup

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