# YouTube Video Extractor (`aliraza94/yt-video-scraper`) Actor

Extract YouTube video metadata, transcripts, subtitles, hashtags, and thumbnails by URL. No API key needed — just paste video links and get structured data: title, description, views, likes, channel info, and timed captions.

- **URL**: https://apify.com/aliraza94/yt-video-scraper.md
- **Developed by:** [ali raza](https://apify.com/aliraza94) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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 Video Scraper

Extract comprehensive metadata from YouTube videos — simply provide video URLs and get structured, ready-to-use data. No YouTube API key required.

### Features

- **Full video metadata** — title, description, duration, upload date, view count, like count, comment count, and availability status
- **Transcripts & subtitles** — full transcript text with timed segments, plus a list of all available subtitle languages (manual and auto-generated)
- **Hashtags & tags** — hashtags extracted from the title and description, along with the video's own tags and categories
- **Thumbnails** — the default thumbnail plus all available thumbnail resolutions with dimensions
- **Channel information** — channel name, ID, URL, handle, subscriber count, and verification status
- **Multi-video support** — scrape several videos in one run with parallel processing
- **No API key needed** — works out of the box with zero configuration

### How it works

1. Provide one or more YouTube video URLs
2. The Actor visits each video and collects all available data
3. Results are pushed to the dataset as clean, structured JSON — one item per video

### Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `startUrls` | array | ✔️ | — | YouTube video URLs to scrape, e.g. `{"url": "https://www.youtube.com/watch?v=..."}` |
| `includeTranscript` | boolean | ❌ | `true` | Fetch the transcript text and timed segments |
| `subtitleLanguage` | string | ❌ | `"en"` | Preferred transcript/subtitle language code (e.g. `en`, `es`, `de`) |
| `proxyConfiguration` | object | ❌ | — | Proxy settings — recommended when running on the Apify platform |

#### Example input

```json
{
    "startUrls": [
        { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }
    ],
    "includeTranscript": true,
    "subtitleLanguage": "en"
}
```

### Output

Each scraped video produces one JSON item in the dataset.

<details>
<summary>Example output (one video)</summary>

```json
{
    "id": "dQw4w9WgXcQ",
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
    "description": "The official video for \"Never Gonna Give You Up\"...",
    "hashtags": ["#RickAstley", "#NeverGonnaGiveYouUp"],
    "tags": ["rick astley", "80s music"],
    "categories": ["Music"],
    "thumbnail": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/maxresdefault.webp",
    "thumbnails": [
        { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg", "width": 1280, "height": 720 }
    ],
    "viewCount": 1821249206,
    "likeCount": 19427922,
    "commentCount": 2400000,
    "duration": 213,
    "durationString": "3:33",
    "uploadDate": "2009-10-25",
    "channel": {
        "name": "Rick Astley",
        "id": "UCuAXFkgsw1L7xaCfnd5JJOw",
        "url": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw",
        "handle": "@RickAstleyYT",
        "subscribers": 4550000,
        "verified": true
    },
    "isLive": false,
    "ageLimit": 0,
    "availability": "public",
    "subtitleLanguages": {
        "manual": ["en", "de-DE", "ja"],
        "auto": ["de-DE", "en", "es-419", "ja", "pt-BR"]
    },
    "transcript": {
        "language": "en",
        "type": "manual",
        "text": "We're no strangers to love...",
        "segments": [
            { "start": 18.64, "duration": 3.24, "text": "We're no strangers to love" }
        ]
    }
}
```

</details>

#### Output fields

| Field | Description |
|---|---|
| `id` | YouTube video ID |
| `url` | Canonical video URL |
| `title` | Video title |
| `description` | Full video description |
| `hashtags` | Hashtags found in title/description |
| `tags` | Tags set by the channel |
| `categories` | YouTube content categories |
| `thumbnail` / `thumbnails` | Thumbnail URLs with dimensions |
| `viewCount` / `likeCount` / `commentCount` | Engagement statistics |
| `duration` / `durationString` | Duration in seconds and `m:ss` format |
| `uploadDate` / `releaseDate` / `releaseTimestamp` | Publication dates |
| `channel` | Channel name, ID, URL, handle, subscribers, verified status |
| `isLive` / `ageLimit` / `availability` | Stream, restriction, and visibility status |
| `subtitleLanguages` | Available manual and auto-generated caption languages |
| `transcript` | Full transcript text, language, source type, and timed segments |

### Notes & limitations

- If a requested subtitle language isn't available, the Actor falls back to the best available alternative
- Videos that fail to process (e.g. removed or region-locked) are logged and recorded in the dataset with an `error` field, so one bad URL won't stop the whole run
- Using a proxy is recommended when running on Apify's platform, as YouTube may block datacenter IPs
- Output prices, view counts, and availability are only as current as the moment of scraping

### Use cases

- Content analysis and trend research
- SEO & hashtag research
- Media monitoring
- Building video datasets for machine learning
- Archiving video metadata

# Actor input Schema

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

YouTube video URLs to scrape

## `includeTranscript` (type: `boolean`):

Switch of transcription

## `subtitleLanguage` (type: `string`):

Switch of subtitle

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

Proxy Definer

## Actor input object example

```json
{
  "includeTranscript": true,
  "subtitleLanguage": "en"
}
```

# 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("aliraza94/yt-video-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("aliraza94/yt-video-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 aliraza94/yt-video-scraper --silent --output-dataset

```

## MCP server setup

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