# YouTube Shorts Scraper (`bgfc97/youtube-shorts-scraper`) Actor

Scrape YouTube Shorts by channel or keyword: title, URL, views, likes, duration, publish date, channel and thumbnail. Fast, no login.

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

## Pricing

$2.30 / 1,000 short scrapeds

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 Shorts Scraper

Scrape **public YouTube Shorts** — by channel or by keyword search — without logging in and without a YouTube Data API key or quota. It parses the data YouTube itself embeds in its pages and paginates through YouTube's own innertube endpoints.

### What it does

Give it a channel (or several) and/or a search keyword, and it returns that channel's Shorts, or the Shorts YouTube surfaces for your query, with full metadata for each one.

### Input

```json
{
  "channelUrls": ["https://www.youtube.com/@MrBeast"],
  "searchQueries": ["funny cats"],
  "maxItems": 20,
  "includeVideoDetails": true,
  "proxyConfiguration": { "useApifyProxy": true },
  "timeoutSecs": 30
}
```

- `channelUrls` — channel URLs (`/@handle`, `/channel/UC...`, `/c/Name`, `/user/Name`), a bare `@handle`, or a bare `UC...` channel ID. Its **Shorts** tab is scraped. Optional.
- `searchQueries` — keywords; returns the Shorts YouTube surfaces for each query. Optional.
- At least one of `channelUrls` / `searchQueries` is required.
- `maxItems` — max Shorts per channel and per query (paginated with continuation tokens). Default 20, up to 500.
- `includeVideoDetails` — when `true` (default) each Short's watch page is fetched for exact view/like counts, duration, publish date, channel and description. Set `false` for a faster, lighter run (listing fields only).
- `proxyConfiguration` — defaults to the free datacenter group; falls back to Residential then the Unblocker automatically if blocked.
- `timeoutSecs` — per-request timeout.

### Output

One item per Short:

| Field | Description |
|---|---|
| `videoId` | 11-char Short ID |
| `url` | `https://www.youtube.com/shorts/<id>` |
| `title` | Short title |
| `viewCount` / `viewCountText` | Exact views (number) and the listing text (`"27K views"`) |
| `likeCount` | Exact like count |
| `duration` / `durationText` | Length in seconds and as `m:ss` |
| `publishDate` / `uploadDate` | ISO timestamps |
| `channelName` / `channelId` / `channelUrl` | Author channel |
| `description` | Short description (may be empty) |
| `thumbnail` | Best available thumbnail URL |
| `source` | `channel` or `search` |
| `inputRef` | The channel/query this item came from |

With `includeVideoDetails: false` you get `videoId`, `url`, `title`, `viewCountText` and `thumbnail` only (plus channel name/id for channel inputs).

On a failed input you get `{ "input": "...", "error": "..." }` instead of a silent skip.

### Notes

- No login, no YouTube Data API key, no Google quota.
- Some fields (like count, description) may be `null` when hidden or absent on a given Short.
- Works best with Apify Proxy; the datacenter group is usually accepted by YouTube and is free on most plans.

### ⭐ Enjoying this Actor?

A quick **rating/review** helps others find it. Feature requests (comments, sound/track, hashtags) — open a ticket on the **Issues** tab.

# Actor input Schema

## `channelUrls` (type: `array`):

Channels whose Shorts tab should be scraped. Accepts channel URLs (https://www.youtube.com/@handle, /channel/UC..., /c/Name, /user/Name), a bare @handle, or a bare channelId (UC...). Leave empty if you only want keyword search.

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

Keywords to search YouTube for Shorts. Each query returns the Shorts that YouTube surfaces for it. Leave empty if you only want channel Shorts.

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

Maximum number of Shorts to return per channel and per search query (most recent / most relevant first). Pagination uses YouTube's innertube continuation tokens.

## `includeVideoDetails` (type: `boolean`):

When enabled (recommended), each Short's /watch page is fetched to add exact view count, like count, duration, publish date, channel and description. Disable for a much faster/cheaper run that returns only the fields visible on the Shorts listing (videoId, title, view-count text, thumbnail).

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

Apify Proxy configuration used for all requests to YouTube. The default datacenter group is free on most plans and usually accepted by YouTube; the Actor automatically falls back to Residential and then the Unblocker if a request is blocked.

## `timeoutSecs` (type: `integer`):

Timeout in seconds for each HTTP request made to YouTube (5-90).

## Actor input object example

```json
{
  "channelUrls": [
    "https://www.youtube.com/@MrBeast"
  ],
  "searchQueries": [
    "funny cats"
  ],
  "maxItems": 20,
  "includeVideoDetails": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "BUYPROXIES94952"
    ]
  },
  "timeoutSecs": 30
}
```

# Actor output Schema

## `dataset` (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 = {
    "channelUrls": [
        "https://www.youtube.com/@MrBeast"
    ],
    "searchQueries": [
        "funny cats"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bgfc97/youtube-shorts-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 = {
    "channelUrls": ["https://www.youtube.com/@MrBeast"],
    "searchQueries": ["funny cats"],
}

# Run the Actor and wait for it to finish
run = client.actor("bgfc97/youtube-shorts-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 '{
  "channelUrls": [
    "https://www.youtube.com/@MrBeast"
  ],
  "searchQueries": [
    "funny cats"
  ]
}' |
apify call bgfc97/youtube-shorts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bgfc97/youtube-shorts-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/ZnSyLklwupHc5QvUe/builds/B4YgjbiMJUWR0kEjI/openapi.json
