# YouTube Scraper API by SocialScrape (`socialscrape/youtube-scraper-api`) Actor

Scrape YouTube channels, videos, Shorts, playlists, comments, search results, community posts and transcripts as JSON. 18 endpoints in one actor, with the same field names on every platform. Pay per result: no API key and no other account needed.

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

## Pricing

$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

### What does YouTube Scraper API do?

**YouTube Scraper API by SocialScrape** gets YouTube data as JSON: channels, videos, Shorts, live streams, playlists, community posts, comments and replies, search results, hashtags, sponsors and transcripts. It has 18 endpoints in one actor: pick one, fill in what it needs, and every result becomes a row in the dataset. You pay per result, and there is no API key to bring and no other account to create.

- **No key, no account.** The actor runs on SocialScrape's own API access, so the price on this page is the whole price.
- **You pay for results.** One row in the dataset is one result. A request that fails or finds nothing adds no row and costs nothing.
- **One shape on every platform.** SocialScrape returns profiles, posts, comments and transcripts with the same field names on every platform, so one parser covers them all.
- **Nothing to maintain.** There are no scrapers to run and nothing to patch when YouTube changes. The actor makes plain API calls, so a single request finishes in seconds.
- **Everything Apify adds.** Schedule runs, call the actor from the Apify API, send rows to other tools through integrations, and export the dataset as JSON, CSV or Excel.

The same data is available directly through the [SocialScrape API](https://socialscrape.dev/youtube-api?utm_source=apify.com\&utm_medium=directory\&utm_campaign=listing), for when you would rather call it from your own code: [API docs](https://socialscrape.dev/docs) | [Pricing](https://socialscrape.dev/pricing)

### What YouTube data can you get?

| Endpoint | `endpoint` value | Needs | One result is |
|---|---|---|---|
| Channel details | `channel` | `handle` or `id` or `url` | A profile |
| Channel videos | `channel.videos` | `handle` or `id` or `url` | A post |
| Search inside a YouTube channel | `channel.search` | `handle` or `id` or `url`, `query` | A post, a profile, a collection or a community |
| Channel playlists | `channel.playlists` | `handle` or `id` or `url` | A collection |
| Channel Shorts | `channel.shorts` | `handle` or `id` or `url` | A post |
| Channel live streams | `channel.lives` | `handle` or `id` or `url` | A post |
| Channel community posts | `channel.community_posts` | `handle` or `id` or `url` | A post |
| Video or Short details | `video` | `url` or `id` | A post |
| Video transcript | `video.transcript` | `url` or `id` | A transcript |
| Video sponsors | `video.sponsors` | `url` or `id` | An advertiser |
| Search | `search` | `query` | A post, a profile, a collection or a community |
| Search suggestions | `search.typeahead` | `query` | A suggestion |
| Videos by hashtag | `search.hashtag` | `hashtag` | A post |
| Video comments | `video.comments` | `url` or `id` | A comment |
| Comment replies | `video.comment.replies` | nothing | A comment |
| Trending YouTube Shorts | `shorts.trending` | nothing | A post |
| Playlist videos | `playlist` | `url` or `id` | A post |
| Community post | `community_post` | `url` | A post |

### How to use YouTube Scraper API

1. Pick an **Endpoint** and fill in the fields it needs. The help under each field says which endpoints use it.
2. For a list, set **Max pages** to follow the cursor, and **Max items** to stop at a number of results.
3. Click **Start**. Rows land in the dataset, and a `SUMMARY` record holds the pages and results of the run.

### How much does it cost?

This actor costs **$1.50 per 1,000 results**. A result is one row in the dataset, and the table above says what a row is for each endpoint. There is nothing else to buy: no SocialScrape key, account or subscription.

- **A request that fails or finds nothing is free.** It adds no row, so there is nothing to charge.
- **A list costs what its rows cost.** A page of 20 posts is 20 results. **Max pages** and **Max items** bound a run.
- **You set the ceiling.** **Max items** stops a run at a number of results, and the maximum charge you set for a run in Apify is honoured: the actor stops fetching when it is reached.

### Input

Every run needs `endpoint`, plus the fields that endpoint needs (the **Needs** column above). For example:

```json
{
  "endpoint": "channel",
  "handle": "NASA"
}
```

### Output

One dataset row per result. A single object (a profile, a post) is one row, and a list is one row per item.

A `channel` run with the input above returns one row like this. This row is from a run on Apify on 2026-11-12; `bio` and `extra` are shortened here.

```json
{
  "object": "profile",
  "platform": "youtube",
  "id": "UCLA_DiR1FfKNvjuUpBHmylQ",
  "handle": "NASA",
  "name": "NASA",
  "headline": null,
  "url": "https://www.youtube.com/@NASA",
  "kind": "channel",
  "bio": "NASA's mission is to pioneer the future in space exploration, scientific discovery, and aeronautics research.",
  "avatar_url": "https://yt3.googleusercontent.com/eIf5fNPcIcj9ig-wZBeq4stFy1lgjWTW1nLT5dYlFkHZprZ03QBiMcbpwNMB6XSBjrSFGtAGQg=s160-c-k-c0x00ffffff-no-rj",
  "banner_url": "https://yt3.googleusercontent.com/y8Srh-oCcilLvBO8jAPI546m1bn0puA5DIvQiBZ1cSxc_rZfKxKSFlTCtoCQCtB6viUf1NGsaQ=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
  "verified": true,
  "is_private": null,
  "external_url": "https://www.nasa.gov",
  "links": [
    {
      "title": "nasa.gov",
      "url": "https://www.nasa.gov"
    },
    {
      "title": "X",
      "url": "https://x.com/nasa"
    },
    {
      "title": "Facebook",
      "url": "https://www.facebook.com/NASA"
    },
    {
      "title": "Flickr",
      "url": "https://www.flickr.com/photos/nasahqphoto/"
    },
    {
      "title": "Instagram",
      "url": "https://www.instagram.com/nasa"
    },
    {
      "title": "Commenting Policy",
      "url": "https://www.nasa.gov/nasa-policies-and-guidelines-for-digital-and-social-media/"
    }
  ],
  "location": null,
  "category": null,
  "created_at": "2008-06-03T00:00:00Z",
  "stats": {
    "followers": 15100000,
    "following": null,
    "posts": 6202,
    "likes": null,
    "views": 1135373383
  },
  "extra": {
    "channel_url": "https://www.youtube.com/channel/UCLA_DiR1FfKNvjuUpBHmylQ",
    "subscribers_text": "15.1M subscribers",
    "video_count_text": "6.2K videos",
    "joined_text": "Joined Jun 3, 2008",
    "verified_kind": "verified",
    "is_live": true
  }
}
```

Every row carries the fields of its type, with the same names on every platform. A field the platform does not give is `null`.

| Row type | Fields |
|---|---|
| Profile | `platform`, `id`, `handle`, `name`, `headline`, `url`, `kind`, `bio`, `avatar_url`, `banner_url`, `verified`, `is_private`, `external_url`, `links`, `location`, `category`, `created_at`, `stats` (`followers`, `following`, `posts`, `likes`, `views`), `extra` |
| Post | `platform`, `id`, `url`, `type`, `author` (`id`, `handle`, `name`, `url`, `avatar_url`, `verified`), `title`, `text`, `published_at`, `duration_seconds`, `language`, `hashtags`, `mentions`, `stats` (`views`, `likes`, `comments`, `shares`, `saves`, `dislikes`), `media` (`thumbnail_url`, `video_url`, `audio_url`, `image_urls`, `width`, `height`), `song` (`id`, `title`, `artist`, `url`), `location` (`name`, `address`, `city`, `region`, `country`, `latitude`, `longitude`), `is_pinned`, `is_sponsored`, `extra` |
| Collection | `platform`, `id`, `url`, `kind`, `title`, `description`, `owner` (`id`, `handle`, `name`, `url`, `avatar_url`, `verified`), `item_count`, `cover_url`, `updated_at`, `extra` |
| Transcript | `platform`, `video_id`, `url`, `language`, `source`, `duration_seconds`, `text`, `segments`, `available_languages`, `extra` |
| Advertiser | `platform`, `id`, `name`, `url`, `page_id`, `country`, `verified`, `ad_count`, `extra` |
| Suggestion | `platform`, `kind`, `text`, `id`, `handle`, `url`, `image_url`, `verified`, `extra` |
| Comment | `platform`, `id`, `url`, `post_id`, `parent_id`, `author` (`id`, `handle`, `name`, `url`, `avatar_url`, `verified`), `text`, `published_at`, `stats` (`likes`, `replies`, `dislikes`), `is_pinned`, `is_by_creator`, `extra` |

The full response reference is in the [API docs](https://socialscrape.dev/docs).

### FAQ

#### Do I need a SocialScrape account or an API key?

No. The actor calls the SocialScrape API on its own access, and you pay Apify for the results. There is no key to paste and nothing to sign up for.

#### What counts as a result?

One row in the dataset: a profile for `channel`, and the **One result is** column above for every other endpoint. A page of a list is as many results as it has items.

#### What happens when a request fails?

A failed request adds no row, so it costs nothing. When the API marks a failure as retryable the actor tries again, up to two more times. Any other failure stops the run with the error code and the request id.

#### How do I get more than one page?

Set **Max pages**, up to 500. The actor follows the cursor for that many pages. **Max items** stops the run early once enough results are in. The `SUMMARY` record holds the next cursor when there is more.

#### How do I limit what a run costs?

**Max items** stops a run at a number of results, and the maximum charge you set for a run in Apify is honoured. When the run reaches it the actor stops fetching, so you are not charged past it and nothing is fetched that you did not ask to pay for.

#### Can I get the same data without Apify?

Yes. The same endpoints are a plain HTTP API at SocialScrape, with SDKs for Python and JavaScript and an MCP server for Claude and Cursor. It is priced on its own, apart from this actor: see the [YouTube API page](https://socialscrape.dev/youtube-api?utm_source=apify.com\&utm_medium=directory\&utm_campaign=listing), the [API docs](https://socialscrape.dev/docs) and the [pricing page](https://socialscrape.dev/pricing).

#### Where do I get help?

Email hello@socialscrape.dev, or open an issue on the actor's Issues tab.

# Actor input Schema

## `endpoint` (type: `string`):

What to fetch. The fields below are shared by the endpoints; each endpoint uses only the ones it needs.

## `handle` (type: `string`):

Channel handle, with or without @. Used by: channel, channel.community_posts, channel.lives, channel.playlists, channel.search, channel.shorts, channel.videos.

## `id` (type: `string`):

For channel, channel.videos, channel.search, channel.playlists, channel.shorts, channel.lives, channel.community_posts: Channel id (UC...). For video, video.transcript, video.sponsors, video.comments, video.comment.replies: 11-character video id. For playlist: Playlist id (PL..., UU..., OL...).

## `url` (type: `string`):

For channel, channel.videos, channel.search, channel.playlists, channel.shorts, channel.lives, channel.community_posts: Any channel URL (/@handle, /channel/UC..., /c/name). For video, video.transcript, video.sponsors, video.comments, video.comment.replies: Video or Short URL (watch, youtu.be, shorts, live, embed). For playlist: Playlist URL (list=...). For community_post: Community post URL (/post/Ug... or /channel/.../community?lb=...).

## `trim` (type: `boolean`):

Smaller response: drops null fields and `extra`.

## `raw` (type: `boolean`):

Also return the platform's original object as `raw`.

## `max_age_days` (type: `number`):

Accept a cached result fetched within this many days. It answers faster.

## `sort` (type: `string`):

For channel.videos, channel.shorts: Order of results. Changing it restarts the cursor chain (one of: latest, popular). For search: Order of results. YouTube now answers `latest` and `rating` in relevance order, so they are refused with invalid_params; use `relevance` or `popular` (view count) and narrow with `upload_date` (one of: relevance, latest, popular, rating). For video.comments: Order of results. Changing it restarts the cursor chain (one of: top, latest).

## `include_extras` (type: `boolean`):

For channel.videos: Also fetch exact views, likes, description and publish time per video (slower, more errors). Comment counts come from the video endpoint. For channel.shorts: Also fetch exact views, length, publish date, likes and description per Short (slower, more errors). For search: Also fetch likes, comment count and description per video (slightly slower).

## `query` (type: `string`):

For channel.search: Keywords to search for inside the channel. For search: Search terms. For search.typeahead: Partial or complete search text.

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

For video: Preferred response language, 2 letters (en, es, fr). Not guaranteed: YouTube localises on its own. For video.transcript: Language code ("en", "es", "en-US"). Overrides the default track unless `original_audio` is set. For video.sponsors: 2-letter language used for the transcript lookup.

## `original_audio` (type: `boolean`):

Only return captions in the video's original spoken language. Takes precedence over `language`. Used by: video.transcript.

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

For search: Kind of result (one of: video, channel, playlist, short, live). For search.hashtag: Kind of result (one of: all, short).

## `upload_date` (type: `string`):

Upload date filter. Used by: search.

## `duration` (type: `string`):

Video length (videos only, not Shorts). Used by: search.

## `region` (type: `string`):

Two-letter country code (ISO 3166-1) for results that vary by country. Used by: search, shorts.trending.

## `hashtag` (type: `string`):

Hashtag, with or without #. Used by: search.hashtag.

## `comment_id` (type: `string`):

Id of the parent comment. Used by: video.comment.replies.

## `maxPages` (type: `integer`):

Follow the cursor for up to this many pages. You pay for the results, not for the pages.

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

Stop after this many results. 0 means no limit other than Max pages.

## Actor input object example

```json
{
  "endpoint": "channel",
  "handle": "NASA",
  "trim": false,
  "raw": false,
  "include_extras": false,
  "original_audio": false,
  "maxPages": 1,
  "maxItems": 0
}
```

# Actor output Schema

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

One dataset row per result.

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

Pages and results of the run, why it stopped, and the next cursor when there is more.

# 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 = {
    "handle": "NASA"
};

// Run the Actor and wait for it to finish
const run = await client.actor("socialscrape/youtube-scraper-api").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 = { "handle": "NASA" }

# Run the Actor and wait for it to finish
run = client.actor("socialscrape/youtube-scraper-api").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 '{
  "handle": "NASA"
}' |
apify call socialscrape/youtube-scraper-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,socialscrape/youtube-scraper-api"
        }
    }
}
```

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/xsIbO6uKF8b3cAOvA/builds/bvgolXQoW4d8z6U7j/openapi.json
