# YouTube Video Scraper (`social-fetch/youtube-video-scraper`) Actor

Scrape YouTube videos from URLs: views, likes, title, description, channel info, and chapters. Export datasets, schedule runs, and integrate with your analytics stack.

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

## Pricing

from $1.98 / 1,000 video 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/platform/actors/running/actors-in-store#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

## YouTube Video Scraper

You shouldn't need a quota-capped Google API project — or a $10-per-1,000 browser scraper — to read public video stats. Paste up to 500 YouTube or Shorts links and get titles, views, likes, channel info, and chapters back as clean rows at $1.98 per 1,000. No API key, no quotas.

Title, views, likes, channel, and metadata for any public YouTube video or Short — paste links, export rows.

🔥 **$1.98 per 1,000 rows** · up to **500** URLs per run · ⚡ API-based — no browser, no proxies · [integration guide](https://www.socialfetch.dev/docs/integrations/apify)

### 💡 Why this scraper

- 💵 **Flat $1.98 per 1,000 rows** — about 80% below typical YouTube scrapers on the Store, with platform API usage included in the price.
- ⚡ **API calls, not browser automation** — no headless Chrome to babysit, no proxies to rent, no cookies or logins. Runs start fast and fit in 256–512 MB of memory.
- 📦 **Structured rows, every time** — each dataset row is the same [Social Fetch API](https://www.socialfetch.dev/docs/api) envelope (`data`, `meta`, and `lookupStatus` where applicable), so your parsing never breaks when YouTube redesigns its UI.
- 🔁 **Nothing locked to Apify** — the same endpoint is available on the [Social Fetch API](https://www.socialfetch.dev/docs/api) with an `sfk_` key when you outgrow Actor runs.

New to Social Fetch on Apify? The [integration guide](https://www.socialfetch.dev/docs/integrations/apify) has screenshots, the actor catalog, and troubleshooting.

### 🎯 What can you do with it

| You need | Give the Actor | You get |
|---|---|---|
| Benchmark against competitors | Competitor upload URLs | Views, likes, and metadata to compare side by side |
| Vet channels before sponsoring | A creator's recent uploads | Real performance numbers before you sign |
| Research titles and formats | Links from a niche or search results | Titles, descriptions, and chapters to mine for patterns |
| Report in a specific market | The same links with a `language` code | Localized titles and descriptions where available |

### 📦 Data you get

**Video**

- Title, URL, and thumbnail
- Description, duration, publish date, and chapters

**Performance**

- Views and likes
- Comment counts

**Channel**

- Handle and display name
- Channel link

### 🚀 Quick start

1. Fill in the **Input** below — sample values are pre-filled.
2. Click **Start** and wait for the run to finish.
3. Open the **Dataset** tab and export as JSON, CSV, or Excel.

### 🧪 Input recipes

- **`videoUrls`** — public YouTube watch or Shorts links
- **`language`** — optional language code for localized metadata

#### Single lookup

Start with one link to see the exact row shape.

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=Y2Ah_DFr8cw"
  ]
}
```

#### Batch up to 500 links

Swap in your own links — one dataset row per URL, in input order.

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=Y2Ah_DFr8cw",
    "https://www.youtube.com/shorts/<video-id>"
  ]
}
```

#### Localized metadata

Pass a language code to get titles and descriptions localized where the channel provides them.

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=Y2Ah_DFr8cw"
  ],
  "language": "es"
}
```

### 📤 Example output

```json
{
  "data": {
    "lookupStatus": "found",
    "video": {
      "id": "Y2Ah_DFr8cw",
      "url": "https://www.youtube.com/watch?v=Y2Ah_DFr8cw",
      "title": "Example video",
      "thumbnailUrl": "https://img.youtube.com/vi/Y2Ah_DFr8cw/maxresdefault.jpg"
    },
    "channel": {
      "handle": "afroballer8906",
      "displayName": "Afroballer"
    },
    "metrics": {
      "views": 372864,
      "likes": 4043
    },
    "relatedVideos": [
      {
        "id": "lzDTK5kEdkM",
        "url": "https://www.youtube.com/watch?v=lzDTK5kEdkM",
        "title": "Charles Barkley and Shaq FUNNIEST MOMENTS",
        "thumbnailUrl": "https://i.ytimg.com/vi/lzDTK5kEdkM/hqdefault.jpg",
        "publishedAt": "2025-02-16T19:25:39.493Z",
        "publishedTimeText": "11 months ago",
        "viewCount": 1800000,
        "viewCountText": "1.8M views",
        "durationSeconds": 1081,
        "durationText": "18:01",
        "channel": {
          "displayName": "SkyHooked",
          "handle": "SkyHooked",
          "profileUrl": "https://www.youtube.com/@SkyHooked",
          "platformUserId": "UCrX8GD5f_O-Cu5Y2vQuSSvw"
        }
      }
    ]
  },
  "meta": {
    "requestId": "req_01example",
    "version": "v1"
  }
}
```

Rows may include `data.lookupStatus` (`found`, `not_found`, or `private`). Completed lookups are billed, including `not_found`.

### 💵 Pricing & cost control

| | Cost per 1,000 lookups |
|---|---|
| **YouTube Video Scraper** | $1.98 |
| Typical YouTube scrapers on Apify | $10.00 |

Roughly **80% less** than many YouTube scrapers on the Store — structured API data behind every row.

**Keeping costs predictable**

- Pay-per-event pricing: you pay for results, not platform usage — no compute or proxy surcharges on top.
- A run can never bill more rows than the URLs you submit (up to 500), so the ceiling on a run's cost is known before you press Start.
- Completed lookups are billed even when the result is `not_found` or `private` — the work was done, and the row tells you why.

### 🧩 Related actors

- [TikTok Video Scraper](https://apify.com/social-fetch/tiktok-video-scraper) — TikTok video metadata by URL

### 🔗 Wire it up

Works with [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [n8n](https://www.socialfetch.dev/docs/integrations/n8n), Apify webhooks, and scheduled runs — or call the [Social Fetch API](https://www.socialfetch.dev/docs/api) directly.

### 🛠️ Troubleshooting

| Symptom | What's happening |
|---|---|
| A row says `"lookupStatus": "not_found"` | The YouTube content doesn't exist, was deleted, or the input has a typo. The lookup completed, so the row is billed — it echoes the input value so you can spot the culprit. |
| Links you know exist come back `not_found` | Check the URL format against the recipes above — this Actor expects `youtube.com/watch?v=…` or Shorts links. |
| Run fails with `No dataset items were produced` | The input list was empty or no lookups completed. Copy a recipe above and swap in your own values. |

### ❓ FAQ

- **Do I need a Social Fetch API key?** No — your Apify token is enough. Never paste an `sfk_` key into Actor input.
- **Why was I charged for `not_found`?** The lookup completed, but YouTube did not return that profile, video, or post. That still counts as a billable dataset row.
- **What URLs work?** Standard YouTube watch links (`youtube.com/watch?v=...`) or Shorts URLs.
- **Do I need a YouTube Data API key?** No — no Google Cloud project, no quota management. Your Apify token is all you need.
- **Do Shorts work?** Yes — paste the Shorts URL as-is.
- **Is it legal to scrape YouTube?** This Actor reads only publicly available data — no logins, no private accounts, nothing beyond what YouTube shows any visitor. How you store and use the data is your responsibility; review YouTube's terms and the laws that apply to your use case.

### 🤝 Support & more

- [Apify integration guide](https://www.socialfetch.dev/docs/integrations/apify) — quick start and actor catalog
- [API reference](https://www.socialfetch.dev/docs/api) — same endpoints with your `sfk_` key
- Missing a field or hit a snag? Open an issue on this Actor's **Issues** tab or email <support@socialfetch.dev>.

# Actor input Schema

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

Public YouTube watch or Shorts links to look up.

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

Optional language code for localized metadata.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=Y2Ah_DFr8cw"
  ]
}
```

# Actor output Schema

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

Dataset items — one row per handle or URL lookup, including lookupStatus and API payload fields.

# 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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=Y2Ah_DFr8cw"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("social-fetch/youtube-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 = { "videoUrls": ["https://www.youtube.com/watch?v=Y2Ah_DFr8cw"] }

# Run the Actor and wait for it to finish
run = client.actor("social-fetch/youtube-video-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=Y2Ah_DFr8cw"
  ]
}' |
apify call social-fetch/youtube-video-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=social-fetch/youtube-video-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/vNzsQOucvEue2q40Z/builds/xIEIb7BThoihZoCSe/openapi.json
