# YouTube Scraper: Videos, Channels, Comments & Transcripts (`scrapysocial/youtube-scraper`) Actor

Scrape YouTube search (videos, Shorts, channels, playlists), video details, related videos, comments and replies, transcripts, channel tabs, playlists, hashtags, community posts and live chat. Real-time, no API quota, clean JSON. Pay only for results.

- **URL**: https://apify.com/scrapysocial/youtube-scraper.md
- **Developed by:** [Scrapy Social](https://apify.com/scrapysocial) (community)
- **Categories:** Social media, Videos, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Scraper: Videos, Channels, Comments & Transcripts

Search, videos, channels, playlists, hashtags, community posts, comments, transcripts and live chat from YouTube as the same clean JSON, with automatic pagination and no YouTube Data API quota.

**28 endpoints** · real-time data · no YouTube account or cookies needed · automatic pagination · batch input · pay only for results ($2.50 / 1,000 results, down to $1.50 on higher Apify plans).

### What can this scraper do?

- **Search**: Search All, Search Videos, Search Shorts, Search Channels, Search Playlists
- **Video**: Video Info, Related Videos, Video Comments, Comment Replies, Video Transcript
- **Channel**: Channel Info, Channel About, Channel Videos, Channel Shorts, Channel Live Streams, Channel Playlists, Channel Podcasts, Channel Posts, Channel Search
- **Playlist**: Playlist Videos
- **Hashtag**: Hashtag Videos
- **Post**: Post Detail, Post Comments, Post Comment Replies
- **Live**: Live Chat
- **Utility**: Search Filters, Resolve URL, Channel ID From Handle

### Use cases

- Keyword research: video, Shorts, channel and playlist search with upload-date, duration and feature filters.
- Channel analytics: about, videos, Shorts, streams, playlists, podcasts and community posts for any handle.
- Comment mining: comments and replies for videos and community posts.
- Content intelligence: video details, related videos and full transcripts.
- Live monitoring: live chat messages and Super Chats.

### Why this scraper

- **Clean, consistent JSON.** The same fields (`id`, `author`, `stats`, `createdAt` …) across endpoints, so you write your parser once.
- **Real-time.** Every run fetches live data; nothing is served from a stale database.
- **No login, no blocking headaches.** Sessions, proxies, signatures and retries are handled for you.
- **Pagination built in.** Set *Max results per query*; the actor follows cursors for you and de-duplicates.
- **Batch mode.** Many usernames / posts / keywords in one run.
- **Fair billing.** Not-found lookups and failed calls are never charged.

### How to use it

1. Pick **What to scrape** (for example *Search Videos*).
2. Fill the fields that endpoint uses (each field lists the endpoints that use it). Leave the others empty.
3. Set **Max results per query**, then click **Start**.
4. Download the results as JSON, CSV, Excel or HTML, or read them through the Apify API.

#### Input examples

**Search videos by keyword**

```json
{
  "endpoint": "search-videos",
  "keyword": "new york",
  "maxItems": 100
}
```

**A channel's latest videos**

```json
{
  "endpoint": "channel-videos",
  "handle": "@MrBeast",
  "maxItems": 100
}
```

**Comments on a video**

```json
{
  "endpoint": "video-comments",
  "videoId": "dQw4w9WgXcQ",
  "maxItems": 200
}
```

**Transcript of a video**

```json
{
  "endpoint": "video-transcript",
  "videoId": "dQw4w9WgXcQ",
  "maxItems": 50
}
```

**Several channels in one run (batch)**

```json
{
  "endpoint": "channel-info",
  "batch": [
    {
      "handle": "@MrBeast"
    },
    {
      "handle": "@NASA"
    }
  ],
  "maxItems": 50
}
```

### Output

Each result is one dataset row. List endpoints produce one row per item; lookups produce one row. Every row has a `_meta` object (endpoint, query, page, scrapedAt). Trend lists and similar responses also carry the list's own fields under `_context`. Example row from **Search Videos**:

```json
{
  "id": "4NoxPOuUqQw",
  "title": "People trapped in Brooklyn building collapse, FDNY reports",
  "snippet": [
    "A three-story building has collapsed in the Flatbush neighborhood of Brooklyn. According to the FDNY, five people have been ..."
  ],
  "publishedTimeText": "15 hours ago",
  "durationText": "10:33",
  "viewCountText": "214,082 views",
  "shortViewCountText": "214K views",
  "thumbnail": "https://i.ytimg.com/vi/4NoxPOuUqQw/hq720.jpg?…",
  "badges": [
    "New",
    "CC"
  ],
  "isLive": false,
  "channel": {
    "id": "UCIjSUWHWp6KohfnR5OQTXnQ",
    "name": "FOX 5 New York",
    "handle": "/@fox5ny",
    "avatar": "https://yt3.ggpht.com/ubXW-2eHXSCtDSTkkNvUBLE4CQkUJIv6OLC5KjQQ-S6AOceM0VwNH_MXpxQoCeE8T0_V?…"
  },
  "_meta": {
    "endpoint": "search-videos",
    "query": {
      "keyword": "new york"
    },
    "page": 1,
    "scrapedAt": "2026-11-11T08:00:00.000Z"
  }
}
```

A run summary (results, pages, not found, failed, stop reason) is saved to the key-value store as `OUTPUT`.

### Endpoints

| Group | Endpoint (`endpoint` value) | What you get | Paginated |
|---|---|---|---|
| Search | Search All (`search-all`) | Search YouTube and get videos, Shorts, channels and playlists in one list. | yes |
| Search | Search Videos (`search-videos`) | Search YouTube videos with upload date, duration, feature and sort filters. | yes |
| Search | Search Shorts (`search-shorts`) | Search YouTube Shorts by keyword. | yes |
| Search | Search Channels (`search-channels`) | Search YouTube channels by keyword. | yes |
| Search | Search Playlists (`search-playlists`) | Search YouTube playlists by keyword. | yes |
| Video | Video Info (`video-info`) | Get title, description, views, likes, duration, keywords and channel of a video. |  |
| Video | Related Videos (`video-related`) | Get the "Up next" related videos of a video. | yes |
| Video | Video Comments (`video-comments`) | Get comments of a video, sorted by top or newest. | yes |
| Video | Comment Replies (`video-comment-replies`) | Get the replies of a video comment. | yes |
| Video | Video Transcript (`video-transcript`) | Get the transcript (captions text with timestamps) of a video. |  |
| Channel | Channel Info (`channel-info`) | Get a channel profile: name, handle, subscribers, video count, avatar, banner, links. |  |
| Channel | Channel About (`channel-about`) | Get the About panel of a channel: country, join date, total views, links. |  |
| Channel | Channel Videos (`channel-videos`) | Get the latest videos uploaded by a channel. | yes |
| Channel | Channel Shorts (`channel-shorts`) | Get the latest Shorts of a channel. | yes |
| Channel | Channel Live Streams (`channel-streams`) | Get the live streams (current, upcoming and past) of a channel. | yes |
| Channel | Channel Playlists (`channel-playlists`) | Get the public playlists created by a channel. | yes |
| Channel | Channel Podcasts (`channel-podcasts`) | Get the podcasts of a channel. | yes |
| Channel | Channel Posts (`channel-posts`) | Get community posts of a channel: text, images, polls, likes. | yes |
| Channel | Channel Search (`channel-search`) | Search videos inside one channel. | yes |
| Playlist | Playlist Videos (`playlist-videos`) | Get a playlist: title, owner, video count and its videos. | yes |
| Hashtag | Hashtag Videos (`hashtag-videos`) | Get videos tagged with a hashtag. | yes |
| Post | Post Detail (`post-detail`) | Get one community post: text, images, poll, likes and author. |  |
| Post | Post Comments (`post-comments`) | Get comments of a community post. | yes |
| Post | Post Comment Replies (`post-comment-replies`) | Get the replies of a community post comment. | yes |
| Live | Live Chat (`live-chat`) | Get the latest live chat messages and Super Chats of a live stream. | yes |
| Utility | Search Filters (`search-filters`) | List YouTube search filter options with their `sp` codes. |  |
| Utility | Resolve URL (`utility-resolve-url`) | Turn any YouTube URL (channel, @handle, video, Short, playlist, hashtag, post) into ids. |  |
| Utility | Channel ID From Handle (`utility-channel-id`) | Convert a channel @handle into its channel id (UC…). |  |

#### Endpoint reference

##### Search

###### Search All · `search-all`

Runs a YouTube search exactly like the search box and returns every result type the page shows: `videos`, `shorts`, `channels` and `playlists`, plus YouTube's estimated total. Supports `type`, `sort`, `uploadDate`, `duration`, `feature` and raw `sp` filters — see each param for the allowed values, or call `the "Search Filters" endpoint` for YouTube's own filter codes. Paginate with `cursor` / `hasMore`. Zero hits return 200 with empty lists.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search query, as typed in the YouTube search box. |
| `type` |  | Result type. Allowed: `video`, `shorts`, `channel`, `playlist`, `movie`. Omit = everything (mixed results). |
| `sort` |  | Result order. Allowed: `relevance` (YouTube default ranking), `popularity` (most viewed first). Omit = `relevance`. |
| `uploadDate` |  | Upload date filter. Allowed: `hour` (last hour), `today`, `week` (this week), `month` (this month), `year` (this year). Omit = any time. |
| `duration` |  | Video length filter. Allowed: `short` (under 3 minutes), `medium` (3–20 minutes), `long` (over 20 minutes). Omit = any length. |
| `feature` |  | One feature filter. Allowed: `live` (live now), `4k`, `hd`, `subtitles` (subtitles/CC), `creative_commons`, `360` (360°), `vr180`, `3d`, `hdr`, `location` (has location), `purchased`. Omit = no feature filter. To combine several features use `sp` from `the "S… |
| `sp`|  | Advanced: raw YouTube filter code (the`sp=`value of a youtube.com search URL, or`options\[].sp`from`the "Search Filters" endpoint`). It is applied after the friendly filters above, so it can add more filters (for example two features). Example `EgQQAUAB`… |
| `language`|  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube`hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country`|  | Content region (YouTube`gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor`|  | Pagination token. Omit for the first page; pass`cursor\` from the previous response to get the next page (keep the other params the same). |

###### Search Videos · `search-videos`

Video-only YouTube search (Shorts excluded). Each item has id, title, snippet, duration, views, upload time, badges, live flag and channel. Filters: `sort`, `uploadDate`, `duration`, `feature` (one), plus raw `sp` for combinations (from `the "Search Filters" endpoint`). Paginate with `cursor` / `hasMore`; zero hits return 200 + `[]`.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search query, as typed in the YouTube search box. |
| `sort` |  | Result order. Allowed: `relevance` (YouTube default ranking), `popularity` (most viewed first). Omit = `relevance`. |
| `uploadDate` |  | Upload date filter. Allowed: `hour` (last hour), `today`, `week` (this week), `month` (this month), `year` (this year). Omit = any time. |
| `duration` |  | Video length filter. Allowed: `short` (under 3 minutes), `medium` (3–20 minutes), `long` (over 20 minutes). Omit = any length. |
| `feature` |  | One feature filter. Allowed: `live` (live now), `4k`, `hd`, `subtitles` (subtitles/CC), `creative_commons`, `360` (360°), `vr180`, `3d`, `hdr`, `location` (has location), `purchased`. Omit = no feature filter. To combine several features use `sp` from `the "S… |
| `sp`|  | Advanced: raw YouTube filter code (the`sp=`value of a youtube.com search URL, or`options\[].sp`from`the "Search Filters" endpoint`). It is applied after the friendly filters above, so it can add more filters (for example two features). Example `EgQQAUAB`… |
| `language`|  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube`hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country`|  | Content region (YouTube`gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor`|  | Pagination token. Omit for the first page; pass`cursor\` from the previous response to get the next page (keep the other params the same). |

###### Search Shorts · `search-shorts`

Shorts-only YouTube search. Items have id, title, view count and thumbnail; use `the "Video Info" endpoint` for full details. Supports `sort` and `uploadDate`. Paginate with `cursor` / `hasMore`.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search query, as typed in the YouTube search box. |
| `sort` |  | Result order. Allowed: `relevance` (YouTube default ranking), `popularity` (most viewed first). Omit = `relevance`. |
| `uploadDate` |  | Upload date filter. Allowed: `hour` (last hour), `today`, `week` (this week), `month` (this month), `year` (this year). Omit = any time. |
| `sp` |  | Advanced: raw YouTube filter code (the `sp=` value of a youtube.com search URL, or `options[].sp` from `the "Search Filters" endpoint`). It is applied after the friendly filters above, so it can add more filters (for example two features). Example `EgQQAUAB`… |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Search Channels · `search-channels`

Channel-only YouTube search. Each item has channel id, title, handle, subscriber count text, description snippet, avatar and verified flag. Use the `id` with any `/youtube/channel/*` endpoint. Supports `sort`. Paginate with `cursor` / `hasMore`.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search query, as typed in the YouTube search box. |
| `sort` |  | Result order. Allowed: `relevance` (YouTube default ranking), `popularity` (most viewed first). Omit = `relevance`. |
| `sp` |  | Advanced: raw YouTube filter code (the `sp=` value of a youtube.com search URL, or `options[].sp` from `the "Search Filters" endpoint`). It is applied after the friendly filters above, so it can add more filters (for example two features). Example `EgQQAUAB`… |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Search Playlists · `search-playlists`

Playlist-only YouTube search. Each item has playlist id, title, owner / "Playlist" metadata, video count badge and thumbnail. Use the `id` with `the "Playlist Videos" endpoint`. Supports `sort`. Paginate with `cursor` / `hasMore`.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search query, as typed in the YouTube search box. |
| `sort` |  | Result order. Allowed: `relevance` (YouTube default ranking), `popularity` (most viewed first). Omit = `relevance`. |
| `sp` |  | Advanced: raw YouTube filter code (the `sp=` value of a youtube.com search URL, or `options[].sp` from `the "Search Filters" endpoint`). It is applied after the friendly filters above, so it can add more filters (for example two features). Example `EgQQAUAB`… |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

##### Video

###### Video Info · `video-info`

Full metadata of one video or Short by `videoId`: title, description, duration, view and like counts, keywords, category, publish / upload date, live and family-safe flags, thumbnails and channel. Counts are strings exactly as YouTube returns them. 404 = the video does not exist, was removed or is private.

| Field | Required | Description |
|---|---|---|
| `videoId` | yes | YouTube video id (11 characters, the `v=` value of a watch URL or the id in `/shorts/{id}`), e.g. `dQw4w9WgXcQ`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |

###### Related Videos · `video-related`

The related / up-next list YouTube shows beside a video (videos, mixes and playlists). Paginate with `cursor` / `hasMore`.

| Field | Required | Description |
|---|---|---|
| `videoId` | yes | YouTube video id (11 characters, the `v=` value of a watch URL or the id in `/shorts/{id}`), e.g. `dQw4w9WgXcQ`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Video Comments · `video-comments`

Top-level comments of a video or Short: text, author, likes, reply count and publish time. `sort` = `top` (default) or `newest`. Each comment with replies has an entry in `replyCursors` — pass its `cursor` to `the "Comment Replies" endpoint`. Paginate with `cursor` / `hasMore` (keep `videoId`). Videos with comments turned off return an empty list.

| Field | Required | Description |
|---|---|---|
| `videoId` | yes | YouTube video id (11 characters, the `v=` value of a watch URL or the id in `/shorts/{id}`), e.g. `dQw4w9WgXcQ`. |
| `sort` |  | Comment order. Allowed: `top` (most relevant first), `newest` (newest first). Omit = `top`. Ignored when `cursor` is sent (the cursor keeps the order of the first page). |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Comment Replies · `video-comment-replies`

Replies under one top-level comment. Take `cursor` from `replyCursors[].cursor` of `the "Video Comments" endpoint`, then pass each next `cursor` from this endpoint to page further.

| Field | Required | Description |
|---|---|---|
| `cursor` | yes | Reply cursor: `replyCursors[].cursor` from `the "Video Comments" endpoint` for the first page, then `cursor` from this endpoint. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |

###### Video Transcript · `video-transcript`

Transcript lines of a video in the default caption language: start time in seconds, timestamp label and text. Works for auto-generated and uploaded captions. Videos without captions return an empty `segments` list.

| Field | Required | Description |
|---|---|---|
| `videoId` | yes | YouTube video id (11 characters, the `v=` value of a watch URL or the id in `/shorts/{id}`), e.g. `dQw4w9WgXcQ`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |

##### Channel

###### Channel Info · `channel-info`

Profile of one channel by `channelId` or `handle`: title, handle, description, subscriber and video count texts, avatar, banner, keywords, RSS feed, canonical URL and the tab list. Use `the "Channel About" endpoint` for country, join date and total views. 404 = the channel does not exist or was terminated.

| Field | Required | Description |
|---|---|---|
| `channelId` |  | Channel id (`UC…`, 24 characters), e.g. `UCX6OQ3DkcsbYNE6H8uQQuVA`. Send this **or** `handle`. |
| `handle` |  | Channel handle with or without `@`, e.g. `@MrBeast` or `MrBeast`. Resolved to `channelId` automatically. Send this **or** `channelId`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |

###### Channel About · `channel-about`

The channel "About" panel: full description, country, joined date, total view count, subscriber and video count texts, canonical URL and external links (title + URL). Accepts `channelId` or `handle`. 404 = the channel does not exist.

| Field | Required | Description |
|---|---|---|
| `channelId` |  | Channel id (`UC…`, 24 characters), e.g. `UCX6OQ3DkcsbYNE6H8uQQuVA`. Send this **or** `handle`. |
| `handle` |  | Channel handle with or without `@`, e.g. `@MrBeast` or `MrBeast`. Resolved to `channelId` automatically. Send this **or** `channelId`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |

###### Channel Videos · `channel-videos`

The channel "Videos" tab, newest first: id, title, views / age metadata, duration badge and thumbnail. Accepts `channelId` or `handle`. Paginate with `cursor` / `hasMore`; a channel without this tab returns an empty list.

| Field | Required | Description |
|---|---|---|
| `channelId` |  | Channel id (`UC…`, 24 characters), e.g. `UCX6OQ3DkcsbYNE6H8uQQuVA`. Send this **or** `handle`. |
| `handle` |  | Channel handle with or without `@`, e.g. `@MrBeast` or `MrBeast`. Resolved to `channelId` automatically. Send this **or** `channelId`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Channel Shorts · `channel-shorts`

The channel "Shorts" tab, newest first: id, title, view count and thumbnail. Accepts `channelId` or `handle`. Paginate with `cursor` / `hasMore`; a channel without this tab returns an empty list.

| Field | Required | Description |
|---|---|---|
| `channelId` |  | Channel id (`UC…`, 24 characters), e.g. `UCX6OQ3DkcsbYNE6H8uQQuVA`. Send this **or** `handle`. |
| `handle` |  | Channel handle with or without `@`, e.g. `@MrBeast` or `MrBeast`. Resolved to `channelId` automatically. Send this **or** `channelId`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Channel Live Streams · `channel-streams`

The channel "Live" tab: live-now, scheduled and past streams with id, title, metadata (viewers / streamed time), badge and thumbnail. Accepts `channelId` or `handle`. Paginate with `cursor` / `hasMore`; a channel without this tab returns an empty list.

| Field | Required | Description |
|---|---|---|
| `channelId` |  | Channel id (`UC…`, 24 characters), e.g. `UCX6OQ3DkcsbYNE6H8uQQuVA`. Send this **or** `handle`. |
| `handle` |  | Channel handle with or without `@`, e.g. `@MrBeast` or `MrBeast`. Resolved to `channelId` automatically. Send this **or** `channelId`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Channel Playlists · `channel-playlists`

The channel "Playlists" tab: playlist id, title, metadata, video count badge and thumbnail. Use the id with `the "Playlist Videos" endpoint`. Accepts `channelId` or `handle`. Paginate with `cursor` / `hasMore`; a channel without this tab returns an empty list.

| Field | Required | Description |
|---|---|---|
| `channelId` |  | Channel id (`UC…`, 24 characters), e.g. `UCX6OQ3DkcsbYNE6H8uQQuVA`. Send this **or** `handle`. |
| `handle` |  | Channel handle with or without `@`, e.g. `@MrBeast` or `MrBeast`. Resolved to `channelId` automatically. Send this **or** `channelId`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Channel Podcasts · `channel-podcasts`

The channel "Podcasts" tab: podcast playlist id, title, metadata, episode count badge and thumbnail. Accepts `channelId` or `handle`. Paginate with `cursor` / `hasMore`; a channel without this tab returns an empty list.

| Field | Required | Description |
|---|---|---|
| `channelId` |  | Channel id (`UC…`, 24 characters), e.g. `UCX6OQ3DkcsbYNE6H8uQQuVA`. Send this **or** `handle`. |
| `handle` |  | Channel handle with or without `@`, e.g. `@MrBeast` or `MrBeast`. Resolved to `channelId` automatically. Send this **or** `channelId`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Channel Posts · `channel-posts`

The channel "Posts" (community) tab: post id, text runs, publish time, like count, images, attached video or poll choices and author. Use `the "Post Detail" endpoint` and `the "Post Comments" endpoint` with the post `id`. Accepts `channelId` or `handle`. Paginate with `cursor` / `hasMore`; a channel without this tab returns an empty list.

| Field | Required | Description |
|---|---|---|
| `channelId` |  | Channel id (`UC…`, 24 characters), e.g. `UCX6OQ3DkcsbYNE6H8uQQuVA`. Send this **or** `handle`. |
| `handle` |  | Channel handle with or without `@`, e.g. `@MrBeast` or `MrBeast`. Resolved to `channelId` automatically. Send this **or** `channelId`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Channel Search · `channel-search`

Searches only the given channel (the magnifier on a channel page) and returns matching videos with id, title, snippet, duration, views and upload time. Accepts `channelId` or `handle`. Paginate with `cursor` / `hasMore`; a channel without this tab returns an empty list.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search query, as typed in the YouTube search box. |
| `channelId` |  | Channel id (`UC…`, 24 characters), e.g. `UCX6OQ3DkcsbYNE6H8uQQuVA`. Send this **or** `handle`. |
| `handle` |  | Channel handle with or without `@`, e.g. `@MrBeast` or `MrBeast`. Resolved to `channelId` automatically. Send this **or** `channelId`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

##### Playlist

###### Playlist Videos · `playlist-videos`

Playlist header (title, description, owner, video count / views texts, thumbnail) and its videos (id, title, channel / views metadata, duration, thumbnail). Header fields are filled on the first page only. Paginate with `cursor` / `hasMore`. 404 = the playlist does not exist or is private.

| Field | Required | Description |
|---|---|---|
| `playlistId` | yes | Playlist id (the `list=` value of a playlist URL), e.g. `PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

##### Hashtag

###### Hashtag Videos · `hashtag-videos`

The youtube.com/hashtag/{tag} page: header title, stats text (videos / channels) and tagged videos with id, title, duration, views and channel. YouTube currently serves hashtag pages as a single page (`hasMore` false for most tags). A hashtag YouTube does not know returns 404.

| Field | Required | Description |
|---|---|---|
| `hashtag` | yes | Hashtag with or without `#` (URL-encode `#` as `%23`), e.g. `travel`. |
| `hashtagParams` |  | Internal — leave empty. Filled automatically from `hashtag`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

##### Post

###### Post Detail · `post-detail`

A single community post by `postId` with the same post shape as `the "Channel Posts" endpoint`. 404 = the post does not exist or was removed.

| Field | Required | Description |
|---|---|---|
| `postId` | yes | Community post id (from `the "Channel Posts" endpoint` → `posts[].id`, or the id in a youtube.com/post/{id} URL), e.g. `UgkxIkDHJ9iW7XmjtMbke3Ud7rEiV5jSHDnR`. |
| `postParams` |  | Internal — leave empty. Filled automatically from `postId`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |

###### Post Comments · `post-comments`

Top-level comments of a community post (same comment shape as `the "Video Comments" endpoint`). Replies cursors are in `replyCursors`; open them with `the "Post Comment Replies" endpoint`. Paginate with `cursor` / `hasMore` (keep `postId`).

| Field | Required | Description |
|---|---|---|
| `postId` | yes | Community post id (from `the "Channel Posts" endpoint` → `posts[].id`, or the id in a youtube.com/post/{id} URL), e.g. `UgkxIkDHJ9iW7XmjtMbke3Ud7rEiV5jSHDnR`. |
| `postParams` |  | Internal — leave empty. Filled automatically from `postId`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

###### Post Comment Replies · `post-comment-replies`

Replies under one post comment. Take `cursor` from `replyCursors[].cursor` of `the "Post Comments" endpoint`, then page with this endpoint's `cursor`.

| Field | Required | Description |
|---|---|---|
| `cursor` | yes | Reply cursor: `replyCursors[].cursor` from `the "Post Comments" endpoint` for the first page, then `cursor` from this endpoint. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |

##### Live

###### Live Chat · `live-chat`

Recent chat of a stream that is live now: text messages (text runs, author, badges, timestamp in microseconds) and Super Chats (amount, text, author). Call again with the returned `cursor` after about `pollIntervalMs` to receive only newer messages. 404 = the video is not live or has chat turned off.

| Field | Required | Description |
|---|---|---|
| `videoId` | yes | Video id of a stream that is **live now** (find one with `the "Search Videos" endpoint?feature=live`). |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |
| `cursor` |  | Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same). |

##### Utility

###### Search Filters · `search-filters`

Returns the filter panel YouTube shows for a query: groups (Type, Duration, Upload date, Features, Prioritize) with option label, `sp` code and whether it is selected. Pass `keyword` plus your current filters (`sp`) to see how YouTube would combine them; send an option `sp` to `the matching endpoint*` as the `sp` param. The friendly `type` / `sort` / `uploadDate` / `duration` / `feature` params of the search endpoints cover the same options.

| Field | Required | Description |
|---|---|---|
| `keyword` | yes | Search query, as typed in the YouTube search box. |
| `sp` |  | Advanced: raw YouTube filter code (the `sp=` value of a youtube.com search URL, or `options[].sp` from `the "Search Filters" endpoint`). It is applied after the friendly filters above, so it can add more filters (for example two features). Example `EgQQAUAB`… |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |

###### Resolve URL · `utility-resolve-url`

Resolves a youtube.com URL the way the site does: returns the page type and the ids behind it — `browseId` (channel `UC…`, `VL` + playlist, `FEhashtag`, `FEpost_detail`), `params`, `videoId` and `playlistId`. Use it to turn an @handle or custom URL into a `channelId`. 404 = YouTube does not know the URL.

| Field | Required | Description |
|---|---|---|
| `url` | yes | Full youtube.com URL, e.g. `https://www.youtube.com/@MrBeast`, `https://www.youtube.com/watch?v=dQw4w9WgXcQ`, `https://www.youtube.com/hashtag/travel`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |

###### Channel ID From Handle · `utility-channel-id`

Shortcut over `the "Resolve URL" endpoint` for handles: `@MrBeast` → `UCX6OQ3DkcsbYNE6H8uQQuVA`. 404 = no channel uses that handle.

| Field | Required | Description |
|---|---|---|
| `handle` | yes | Channel handle with or without `@`, e.g. `@MrBeast`. |
| `language` |  | Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`. |
| `country` |  | Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`. |

### Pagination, limits and batch

- **Max results per query** (`maxItems`) and **Max pages per query** (`maxPages`) bound each query; the actor stops at whichever comes first or when the source has no more pages.
- **Batch** (`batch`) runs the selected endpoint once per object, e.g. `[{"username":"a"},{"username":"b"}]`. Form fields act as defaults for every batch entry.
- **Parallel queries** (`concurrency`) controls how many batch entries run at once.
- To continue a previous run manually, pass the last `cursor` from the response (with *One row per result* off) as the `cursor` field.

### Pricing

This actor uses **pay per event** pricing: you pay for the results you get, not for compute time.

Higher Apify plans get an automatic Store discount:

| Apify plan | Per 1,000 results | Actor start |
|---|---|---|
| Free | $2.50 | $0.005 |
| Bronze | $2.10 | $0.004 |
| Silver | $1.80 | $0.003 |
| Gold | $1.50 | $0.0025 |
| Platinum | $1.50 | $0.0025 |
| Diamond | $1.50 | $0.0025 |

Example on the Free plan: 1,000 results in one run cost $2.505. Platform usage (compute, proxy, storage) is included; you pay only the events above. The start event is charged once per run at the default 512 MB memory.

Not-found lookups and failed calls are free. With *One row per result* off, a row holding a page of N items counts as N results.

Set **Maximum cost per run** in the run options to cap spending; the actor stops cleanly at that limit and keeps everything it already saved.

### Integrations and API

Run it from code with the Apify API or clients and get results as JSON:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('<username>/youtube-scraper').call({"endpoint":"search-videos","keyword":"new york","maxItems":100});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

It also works with schedules, webhooks, Make, Zapier, n8n, Google Sheets and every other Apify integration.

### FAQ

**Do I need a YouTube account, cookies or an API key?** No. Just pick an endpoint and run.

**Is scraping YouTube legal?** This actor only returns publicly available data. You are responsible for how you use it: respect privacy laws (GDPR, CCPA), the platform's terms, and do not collect personal data without a legitimate reason.

**Why did a query return nothing?** The account, post or keyword may not exist, may be private, or may have no public results. Those queries are reported in the `OUTPUT` summary as *not found* and are not charged.

**Can I get more than the maximum?** Raise *Max results per query* and *Max pages per query*. Very large pulls are best split with *Batch*.

**How fresh is the data?** Real time: each run reads the platform at that moment.

### Changelog and support

See the **Changelog** tab. Found a bug or need a field or endpoint? Open an issue in the **Issues** tab; we usually reply within a day.

# Changelog

This Actor's version history is a separate document: https://apify.com/scrapysocial/youtube-scraper/changelog.md

# Actor input Schema

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

Pick the YouTube data you want. Then fill only the fields that endpoint uses (each field says which endpoints use it). Full list with descriptions: see the README tab.

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

Search query, as typed in the YouTube search box.<br><br><b>Used by:</b> Search All, Search Videos, Search Shorts, Search Channels, Search Playlists, Channel Search +1 more. <b>Required by:</b> Search All, Search Videos, Search Shorts, Search Channels, Search Playlists, Channel Search …. <b>Example:</b> <code>new york</code>

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

Result type. Allowed: `video`, `shorts`, `channel`, `playlist`, `movie`. Omit = everything (mixed results).<br><br><b>Used by:</b> Search All.

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

Comment order. Allowed: `top` (most relevant first), `newest` (newest first). Omit = `top`. Ignored when `cursor` is sent (the cursor keeps the order of the first page).<br><br><b>Used by:</b> Search All, Search Videos, Search Shorts, Search Channels, Search Playlists, Video Comments.

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

Upload date filter. Allowed: `hour` (last hour), `today`, `week` (this week), `month` (this month), `year` (this year). Omit = any time.<br><br><b>Used by:</b> Search All, Search Videos, Search Shorts.

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

Video length filter. Allowed: `short` (under 3 minutes), `medium` (3–20 minutes), `long` (over 20 minutes). Omit = any length.<br><br><b>Used by:</b> Search All, Search Videos.

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

One feature filter. Allowed: `live` (live now), `4k`, `hd`, `subtitles` (subtitles/CC), `creative_commons`, `360` (360°), `vr180`, `3d`, `hdr`, `location` (has location), `purchased`. Omit = no feature filter. To combine several features use `sp` from `the "Search Filters" endpoint`.<br><br><b>Used by:</b> Search All, Search Videos.

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

Advanced: raw YouTube filter code (the `sp=` value of a youtube.com search URL, or `options[].sp` from `the "Search Filters" endpoint`). It is applied after the friendly filters above, so it can add more filters (for example two features). Example `EgQQAUAB` = videos that are live now.<br><br><b>Used by:</b> Search All, Search Videos, Search Shorts, Search Channels, Search Playlists, Search Filters.

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

Interface language for texts such as "3 days ago" or "1.2M views" (YouTube `hl`), e.g. `en`, `id`, `es`, `pt-BR`. Omit = `en`.<br><br><b>Used by:</b> Search All, Search Videos, Search Shorts, Search Channels, Search Playlists, Video Info +22 more.

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

Content region (YouTube `gl`, ISO 3166-1 alpha-2 upper-case), e.g. `US`, `ID`, `GB`. Affects ranking and availability. Omit = `US`.<br><br><b>Used by:</b> Search All, Search Videos, Search Shorts, Search Channels, Search Playlists, Video Info +22 more.

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

Pagination token. Omit for the first page; pass `cursor` from the previous response to get the next page (keep the other params the same).<br><br><b>Used by:</b> Search All, Search Videos, Search Shorts, Search Channels, Search Playlists, Related Videos +14 more. <b>Required by:</b> Comment Replies, Post Comment Replies.

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

YouTube video id (11 characters, the `v=` value of a watch URL or the id in `/shorts/{id}`), e.g. `dQw4w9WgXcQ`.<br><br><b>Used by:</b> Video Info, Related Videos, Video Comments, Video Transcript, Live Chat. <b>Required by:</b> Video Info, Related Videos, Video Comments, Video Transcript, Live Chat. <b>Example:</b> <code>dQw4w9WgXcQ</code>

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

Channel id (`UC…`, 24 characters), e.g. `UCX6OQ3DkcsbYNE6H8uQQuVA`. Send this **or** `handle`.<br><br><b>Used by:</b> Channel Info, Channel About, Channel Videos, Channel Shorts, Channel Live Streams, Channel Playlists +3 more.

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

Channel handle with or without `@`, e.g. `@MrBeast` or `MrBeast`. Resolved to `channelId` automatically. Send this **or** `channelId`.<br><br><b>Used by:</b> Channel Info, Channel About, Channel Videos, Channel Shorts, Channel Live Streams, Channel Playlists +4 more. <b>Required by:</b> Channel ID From Handle. <b>Example:</b> <code>@MrBeast</code>

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

Playlist id (the `list=` value of a playlist URL), e.g. `PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI`.<br><br><b>Used by:</b> Playlist Videos. <b>Required by:</b> Playlist Videos. <b>Example:</b> <code>PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI</code>

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

Hashtag with or without `#` (URL-encode `#` as `%23`), e.g. `travel`.<br><br><b>Used by:</b> Hashtag Videos. <b>Required by:</b> Hashtag Videos. <b>Example:</b> <code>travel</code>

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

Internal — leave empty. Filled automatically from `hashtag`.<br><br><b>Used by:</b> Hashtag Videos.

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

Community post id (from `the "Channel Posts" endpoint` → `posts[].id`, or the id in a youtube.com/post/{id} URL), e.g. `UgkxIkDHJ9iW7XmjtMbke3Ud7rEiV5jSHDnR`.<br><br><b>Used by:</b> Post Detail, Post Comments. <b>Required by:</b> Post Detail, Post Comments. <b>Example:</b> <code>UgkxIkDHJ9iW7XmjtMbke3Ud7rEiV5jSHDnR</code>

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

Internal — leave empty. Filled automatically from `postId`.<br><br><b>Used by:</b> Post Detail, Post Comments.

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

Full youtube.com URL, e.g. `https://www.youtube.com/@MrBeast`, `https://www.youtube.com/watch?v=dQw4w9WgXcQ`, `https://www.youtube.com/hashtag/travel`.<br><br><b>Used by:</b> Resolve URL. <b>Required by:</b> Resolve URL. <b>Example:</b> <code>https://www.youtube.com/@MrBeast</code>

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

Stop paginating a query after this many results. Each saved result is one billable "result-item" event.

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

Upper bound on API pages fetched per query (a page is usually 10–50 results).

## `batch` (type: `array`):

Optional JSON array. Each object is one query for the selected endpoint; its keys override the form fields above. Example: <code>\[{"handle":"@MrBeast"},{"handle":"@NASA"}]</code>

## `splitItems` (type: `boolean`):

On (recommended): every post/user/comment is its own dataset row. Off: one row per API page (the list stays nested). Billing is per result either way.

## `concurrency` (type: `integer`):

How many batch queries run at the same time.

## Actor input object example

```json
{
  "endpoint": "search-videos",
  "keyword": "new york",
  "videoId": "dQw4w9WgXcQ",
  "handle": "@MrBeast",
  "playlistId": "PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI",
  "hashtag": "travel",
  "postId": "UgkxIkDHJ9iW7XmjtMbke3Ud7rEiV5jSHDnR",
  "url": "https://www.youtube.com/@MrBeast",
  "maxItems": 100,
  "maxPages": 10,
  "splitItems": true,
  "concurrency": 3
}
```

# Actor output Schema

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

Scraped YouTube items. One dataset row per result (post, user, comment, hotel …) with a `_meta` object.

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

Summary of the run: results, pages, not found, failed queries and stop reason.

# 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 = {
    "keyword": "new york",
    "videoId": "dQw4w9WgXcQ",
    "handle": "@MrBeast",
    "playlistId": "PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI",
    "hashtag": "travel",
    "postId": "UgkxIkDHJ9iW7XmjtMbke3Ud7rEiV5jSHDnR",
    "url": "https://www.youtube.com/@MrBeast"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapysocial/youtube-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 = {
    "keyword": "new york",
    "videoId": "dQw4w9WgXcQ",
    "handle": "@MrBeast",
    "playlistId": "PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI",
    "hashtag": "travel",
    "postId": "UgkxIkDHJ9iW7XmjtMbke3Ud7rEiV5jSHDnR",
    "url": "https://www.youtube.com/@MrBeast",
}

# Run the Actor and wait for it to finish
run = client.actor("scrapysocial/youtube-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 '{
  "keyword": "new york",
  "videoId": "dQw4w9WgXcQ",
  "handle": "@MrBeast",
  "playlistId": "PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI",
  "hashtag": "travel",
  "postId": "UgkxIkDHJ9iW7XmjtMbke3Ud7rEiV5jSHDnR",
  "url": "https://www.youtube.com/@MrBeast"
}' |
apify call scrapysocial/youtube-scraper --silent --output-dataset

```

## MCP server setup

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