# YouTube Shorts Scraper | Channel Shorts, Views, Likes & Dates (`hridayrungta/youtube-shorts-scraper`) Actor

Extract YouTube Shorts from any channel: URL, title, views, likes, publish date, duration, thumbnail, channel info. Full details for any Shorts URL, plus incremental "only new since last run" tracking. No login, no browser, no proxy. $0.002/run + $0.0007/short.

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

## Pricing

Pay per event

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 | Channel Shorts, Views, Likes & Dates

Extract every Short from a YouTube channel, or full details for any individual Short - using YouTube's own public pages and its internal "innertube" API. No login, no API key sign-up, no browser, no proxy.

### What you get

- **Shorts by channel**: every Short on a channel's `/shorts` tab - id, title, view count, thumbnail, and (optionally) exact view count, like count, publish date, duration, description, keywords and category - paginated past the first 48 via YouTube's own innertube API.
- **Shorts by URL**: full details for one or more individual Shorts, from a `youtube.com/shorts/<id>` link, any other YouTube video URL, or a bare 11-character id.
- **Incremental mode**: track a channel's Shorts over time. Each run after the first returns only Shorts new since the last run - no re-scraping, no re-paying for old Shorts.

### How this works (honestly)

A Short is an ordinary YouTube video under the hood, and its full metadata - `videoDetails` (title, exact view count, duration, keywords) plus `microformat.playerMicroformatRenderer` (publish date, category, and `likeCount` as a plain integer) - comes from YouTube's own internal "innertube player" API: a plain JSON POST with just the video id, the same call the site's own player makes internally. Every Short is normalized to its id and looked up this way (not by scraping the `/watch` or `/shorts` HTML page for that id - live testing found the classic watch-page HTML got an "unusual traffic" interstitial under burst load from Apify's shared IP pool, while this JSON endpoint came back clean every time).

A channel's Shorts grid lives on its `/@handle/shorts` tab, embedded as `ytInitialData`. Each entry is a `shortsLockupViewModel` (confirmed live - not the `reelItemRenderer` older tools describe, which is absent from current pages) carrying the video id, title, a compact view count ("16M views") and a thumbnail - no publish date, no like count, no duration. This Actor:

1. Fetches the channel's `/shorts` tab (or an individual Short's watch page).
2. Parses the embedded JSON for the first page of Shorts.
3. Follows the page's own continuation token through YouTube's internal innertube API (`/youtubei/v1/browse`) for further pages, anonymously - confirmed working live across multiple pages.
4. Optionally fetches each Short's own watch page for the fields the grid doesn't carry (likes, exact views, publish date, duration).

No headless browser, no residential proxy, no login wall to fight - because there isn't one. That keeps this fast, reliable, and cheap, and that cost is passed on to you.

### Incremental mode (channels only)

Set `mode: "changes"`. A channel's Shorts grid is newest-first (confirmed live) and carries no publish date at all, so incremental tracking is id-based first and date-based second: a run stops paging the moment it reaches a Short it has already billed, and with "Fetch full details" on, each Short's exact publish date also lets the first run seed from `firstRunSince` (default 30 days back) instead of pulling full channel history. A run cut short by your budget still advances the mark safely, and a remembered set of Short ids is the real guarantee that no Short is ever billed twice.

### Input at a glance

| Field | Description |
|---|---|
| `channels` | Channels to list Shorts from - a handle (`@MrBeast`), a full `/shorts` URL, or a `UC...` id. |
| `shortsUrls` | Individual Shorts to fetch full details for - a `/shorts/<id>` URL, any video URL, or a bare 11-character id. |
| `includeDetails` | Fetch each channel Short's own watch page for likes, exact views, publish date, duration, description, keywords, category. On by default; same price per row either way. |
| `mode` | `"all"` (default) or `"changes"` (incremental) - channels only. |
| `maxItems` | Budget cap on billed Short rows (channel Shorts + Shorts URL lookups combined). |
| `maxPagesPerSource` | Cap on innertube pagination pages per channel. |
| `firstRunSince` | How far back a channel's first incremental run looks (e.g. `"30 days"`, or `"all"` for full history). |
| `maxRetries` | Retries with backoff for network errors, HTTP 429 and 5xx responses. |
| `stateStoreName` / `stateNamespace` | Advanced: where the incremental high-water mark is stored. |

### Billing (pay-per-event)

| Event | Price |
|---|---|
| Actor started | $0.002 - charged once per run, regardless of results |
| Short scraped | $0.0007 - one flat price per Short row, channel or URL, with or without details |

Real-measured cost on Apify's own infrastructure is dominated by fixed per-run overhead (well under $0.001 even for a run of dozens of Shorts), so pricing is a flat per-event rate with no hidden per-GB or "with extra fields" tier - every row already includes everything this Actor can extract for it.

# Actor input Schema

## `channels` (type: `array`):

One or more YouTube channels, one per line: a handle ("@MrBeast"), a full channel/handle URL, or a UC... channel id. Returns every Short on the channel's Shorts tab, newest first, paginated.

## `shortsUrls` (type: `array`):

One or more individual Shorts, one per line: a youtube.com/shorts/<id> URL, any other YouTube video URL, or a bare 11-character video id. Returns full details: title, channel, exact view count, like count, publish date, duration, description, keywords, thumbnail.

## `includeDetails` (type: `boolean`):

The channel Shorts grid itself only carries title, an approximate view count ("16M views") and a thumbnail. With this on (default), each Short's own page is also fetched to add like count, exact view count, exact publish date, duration, description, keywords and category - one extra request per Short, same price per row. Turn off for maximum speed if you only need ids, titles and rough views.

## `mode` (type: `string`):

Only affects "Channels" above. "all": every Short the run reaches, every time. "changes": only Shorts new since your last run of that channel.

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

Cost cap - you're billed once per Short row saved, shared across channel Shorts and Shorts URL lookups.

## `maxPagesPerSource` (type: `integer`):

How many innertube continuation pages (48 Shorts each) to follow per channel before moving on - a safety cap independent of Max Short rows.

## `firstRunSince` (type: `string`):

A channel's first incremental run only takes Shorts published since this date/span. Default "30 days"; "all" to take everything the run reaches. Needs "Fetch full details" on - the Shorts grid has no publish dates.

## `maxRetries` (type: `integer`):

Retries with backoff for network errors, HTTP 429 and 5xx responses.

## `stateStoreName` (type: `string`):

Name of the key-value store (in YOUR account) that holds the high-water mark per channel. Leave blank for the default.

## `stateNamespace` (type: `string`):

Advanced: an explicit namespace for the mark key. Leave blank to namespace by your Apify user id automatically.

## Actor input object example

```json
{
  "channels": [
    "@MrBeast"
  ],
  "shortsUrls": [],
  "includeDetails": true,
  "mode": "all",
  "maxItems": 100,
  "maxPagesPerSource": 10,
  "firstRunSince": "30 days",
  "maxRetries": 3,
  "stateStoreName": "",
  "stateNamespace": ""
}
```

# 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 = {
    "channels": [
        "@MrBeast"
    ],
    "shortsUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("hridayrungta/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 = {
    "channels": ["@MrBeast"],
    "shortsUrls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("hridayrungta/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 '{
  "channels": [
    "@MrBeast"
  ],
  "shortsUrls": []
}' |
apify call hridayrungta/youtube-shorts-scraper --silent --output-dataset

```

## MCP server setup

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