# YouTube Scraper – Videos, Shorts, Channels & Comments (`smoldesk/youtube-scraper`) Actor

Scrape YouTube without an API key: search results, channel videos, Shorts, live streams, playlists and comments. Exact views, likes, publish date, tags, chapters, subscribers. Clean, flat JSON/CSV.

- **URL**: https://apify.com/smoldesk/youtube-scraper.md
- **Developed by:** [Smoldesk Studios](https://apify.com/smoldesk) (community)
- **Categories:** Social media, Videos, Lead generation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 videos

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 Scraper – Videos, Shorts, Channels & Comments

![YouTube Scraper: search results, channel videos, Shorts, playlists and comments without an API key](https://raw.githubusercontent.com/smoldesk/apify-scrapers/main/assets/youtube/banner.webp)

Scrape **YouTube search results, channel videos, Shorts, live streams, playlists and comments** without an API key or quota. Every video comes with **exact view and like counts**, **publish date**, **duration**, **comment count**, the **full description with its links and hashtags**, **chapters**, and the **channel's name, handle and subscribers**. Channel URLs also return a **channel profile**: exact total views, video count, join date, country and external links (Instagram, TikTok, shop, Patreon…). Add **comments and replies** with likes, author and pinned/hearted flags.

The output is built to be easy to use: **one flat record per video, channel or comment**, the **same fields every time**, real numbers instead of "1.2M", ISO dates, and a `sourceInput` + `sourcePosition` on each video so you know which search or channel it came from and where it ranked.

### What you can use it for

- **Influencer and creator research**: find channels by keyword, compare subscribers, views per video and posting frequency, collect their social links.
- **Competitor and brand monitoring**: schedule a run on competitor channels with **Only videos published after = 7 days** and get just the new uploads.
- **Content and SEO research**: see what ranks for a keyword, the titles, lengths, chapters and hashtags that win, and how views spread across the top 50.
- **Comment and sentiment analysis**: pull top or newest comments with replies for product feedback, audience questions or AI sentiment scoring.
- **Sponsor and lead discovery**: `descriptionLinks` lists every link in a video description (sponsors, affiliate links, shops); channel profiles list the creator's own sites.
- **Datasets for AI**: clean text fields (`description`, comment `text`) ready for LLMs, RAG and fine-tuning.

### How to use it

**1. Add what to scrape.** Type search terms, paste channel, playlist or video URLs, and set a date filter if you only want recent videos.

![Step 1: add search terms, channels or playlists and the options you need](https://raw.githubusercontent.com/smoldesk/apify-scrapers/main/assets/youtube/how-to-1.webp)

**2. Click Start.** 100 videos take about a minute. The log shows each search and channel as it goes.

![Step 2: click Start and watch the run log](https://raw.githubusercontent.com/smoldesk/apify-scrapers/main/assets/youtube/how-to-2.webp)

**3. Get clean data.** Every video comes with exact views and likes, publish date, duration and channel. Export it as JSON, CSV or Excel, or read it through the API.

![Step 3: get clean data and export it as JSON, CSV, Excel or via API](https://raw.githubusercontent.com/smoldesk/apify-scrapers/main/assets/youtube/how-to-3.webp)

### How to scrape YouTube

1. Create a free Apify account and open this Actor.
2. Add **Search terms** (one per line), and/or **YouTube URLs or @handles**: videos, Shorts, channels (`@mkbhd`, `/channel/UC…`, `/c/…`) or playlists. Over the API, `["@mkbhd"]` and `[{"url": "https://…"}]` both work.
3. Set **Max videos per search / channel tab / playlist** (0 = everything).
4. Optional:
   - **Search filters**: sort by relevance or view count, Videos or Shorts, upload date (last hour → this year), duration, features (4K, HD, subtitles, live, Creative Commons…), country.
   - **Channel tabs**: Videos, Shorts and/or Live. A channel URL ending in `/shorts` or `/streams` scrapes only that tab. Leave the tabs empty to get only the channel profile.
   - **Only videos published after**: a date (`2025-01-31`) or a period (`7 days`, `3 months`). On channels it stops paging as soon as it reaches older videos, so monitoring runs stay small and cheap.
   - **Comments**: max comments per video, top or newest first, and max replies per comment.
5. Click **Start**. 100 videos take about a minute.
6. Download the results as JSON, CSV or Excel, or read them through the Apify API. The **Videos**, **Channels** and **Comments** tabs show each record type as a table.
7. Use **Schedule** to run it daily or weekly.

**Tips**

- Each video is saved once per run, even when it shows up in two searches.
- The run's **maximum cost** stops it cleanly: video pages are only loaded while your budget still pays for them.
- Filter the dataset by `type` (`video`, `channel`, `comment`) when you read it through the API.

### Output: video

```json
{
  "type": "video",
  "id": "8jPQjjsBbIc",
  "url": "https://www.youtube.com/watch?v=8jPQjjsBbIc",
  "title": "How to stay calm when you know you'll be stressed | Daniel Levitin | TED",
  "videoType": "video",
  "liveStatus": null,
  "publishedDate": "2015-11-23",
  "durationSeconds": 741,
  "duration": "12:21",
  "viewCount": 20358146,
  "likeCount": 270554,
  "commentCount": 4000,
  "commentsDisabled": false,
  "channelId": "UCAuUUnT6oDeKwE6v1NGQxug",
  "channelName": "TED",
  "channelHandle": "@TED",
  "channelUrl": "https://www.youtube.com/@TED",
  "channelSubscriberCount": 28000000,
  "channelIsVerified": true,
  "description": "Visit http://TED.com to get our entire library of TED Talks…",
  "descriptionLinks": ["http://TED.com", "http://twitter.com/TEDTalks", "http://facebook.com/TED"],
  "hashtags": [],
  "chapters": [
    {"start": "0:00", "startSeconds": 0, "title": "The personal crisis"},
    {"start": "1:36", "startSeconds": 96, "title": "Brain function under stress"}
  ],
  "thumbnailUrl": "https://i.ytimg.com/vi/8jPQjjsBbIc/hqdefault.jpg",
  "isUnlisted": false,
  "isMembersOnly": false,
  "sourceType": "url",
  "sourceInput": "https://www.youtube.com/watch?v=8jPQjjsBbIc",
  "sourcePosition": 1,
  "scrapedAt": "2026-11-03T03:16:16Z"
}
```

| Field | Notes |
|---|---|
| `videoType` | `video`, `short` or `live` (live streams, premieres and past streams) |
| `liveStatus` | `live` (streaming now), `upcoming` (scheduled), `was_live` (past stream) or `null` |
| `viewCount`, `likeCount` | Exact numbers. `viewCount` is `null` while a stream is live (YouTube shows "watching now" instead) |
| `commentCount` | Rounded the way YouTube shows it ("4K" → 4000). `null` when comments are off or for live chats |
| `channelSubscriberCount` | Rounded the way YouTube shows it ("28M" → 28000000) |
| `durationSeconds` | `null` for Shorts and live streams (YouTube doesn't show their length on public pages) |
| `sourceType` / `sourceInput` / `sourcePosition` | `search`, `channel`, `playlist` or `url`; the search term or URL you gave; the rank in that list (1 = top result) |

### Output: channel

```json
{
  "type": "channel",
  "id": "UCsXVk37bltHxD1rDPwtNM8Q",
  "url": "https://www.youtube.com/@kurzgesagt",
  "handle": "@kurzgesagt",
  "name": "Kurzgesagt – In a Nutshell",
  "description": "Animation videos explaining things with optimistic nihilism since 12,013…",
  "subscriberCount": 25800000,
  "videoCount": 397,
  "viewCount": 3994316980,
  "joinedAt": "2013-07-09",
  "country": "Germany",
  "isVerified": true,
  "links": [
    {"title": "Shop", "url": "https://shop.kgs.link/cool"},
    {"title": "Patreon", "url": "http://www.patreon.com/Kurzgesagt"},
    {"title": "TikTok", "url": "https://www.tiktok.com/@kurz_gesagt"}
  ],
  "keywords": ["Science", "universe", "space"],
  "avatarUrl": "https://yt3.googleusercontent.com/…",
  "bannerUrl": "https://yt3.googleusercontent.com/…",
  "rssUrl": "https://www.youtube.com/feeds/videos.xml?channel_id=UCsXVk37bltHxD1rDPwtNM8Q",
  "sourceType": "channel",
  "sourceInput": "https://www.youtube.com/@kurzgesagt",
  "scrapedAt": "2026-11-03T03:16:17Z"
}
```

### Output: comment

```json
{
  "type": "comment",
  "id": "UgzKYksqeQ5gA3t0g0F4AaABAg",
  "videoId": "dQw4w9WgXcQ",
  "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=UgzKYksqeQ5gA3t0g0F4AaABAg",
  "text": "I Rick rolled my entire French class because…",
  "authorName": "@grustache4569",
  "authorChannelId": "UCKrzgYonJnMd0Dk7zQXjYXw",
  "authorChannelUrl": "https://www.youtube.com/@grustache4569",
  "authorAvatarUrl": "https://yt3.ggpht.com/…",
  "authorIsVerified": false,
  "authorIsChannelOwner": false,
  "likeCount": 106000,
  "replyCount": 665,
  "publishedTimeText": "6 years ago",
  "publishedAtApprox": "2020-11-04T03:16:17Z",
  "isEdited": true,
  "isPinned": false,
  "isHearted": false,
  "isReply": false,
  "parentId": null,
  "videoChannelName": "Rick Astley",
  "sourceInput": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "scrapedAt": "2026-11-03T03:16:17Z"
}
```

Only need comments? [YouTube Comments Scraper](https://apify.com/smoldesk/youtube-comments-scraper) saves just the comments, from video URLs, a channel's latest videos or a keyword search, and doesn't charge for the videos it opens.

Replies have `isReply: true`, the parent comment's ID in `parentId`, and are saved right after their parent. YouTube only shows comment dates as "6 years ago", so `publishedAtApprox` is an estimate (exact to the hour for recent comments).

### Input example

```json
{
  "searchQueries": ["home workout", "meal prep"],
  "startUrls": [
    "@mkbhd",
    "https://www.youtube.com/playlist?list=PLu0W_9lII9agwh1XjRt242xIpHhPT2llg",
    "https://www.youtube.com/watch?v=8jPQjjsBbIc"
  ],
  "maxResults": 50,
  "uploadDate": "month",
  "channelTabs": ["videos", "shorts"],
  "publishedAfter": "30 days",
  "maxComments": 20,
  "commentsSortBy": "top",
  "maxRepliesPerComment": 3
}
```

### Pricing

Pay per result. No monthly fee, no start fee worth mentioning, and Apify's free plan credit covers your first runs.

| What | Price | Per 1,000 |
|---|---|---|
| Video (or Short / stream) with all fields above | $0.001 | **$1.00** |
| Comment or reply | $0.0005 | $0.50 |
| Channel profile | $0.001 | $1.00 |
| Run start | $0.00005 | – |

Example: the latest 50 videos of 20 channels plus their profiles cost about **$1.02**. 100 videos with 20 comments each cost **$1.10**. The date filter is free. Videos that can't be loaded (private, deleted) are not charged.

### Use with AI agents (Claude, ChatGPT, Cursor, MCP)

Add the Actor as a tool through the Apify MCP server: `https://mcp.apify.com?actors=smoldesk/youtube-scraper`. Then paste this into your agent's system prompt or tool notes, so it knows when to call it:

```text
Tool: smoldesk/youtube-scraper (YouTube Scraper, Apify)
Use it when: the user wants YouTube videos or Shorts for a search, a channel's videos, live streams or playlists, exact view and like counts, publish dates, tags, chapters, subscriber counts, or comments. No API key or login needed.
Don't use it when: the user wants video files or transcripts, YouTube Analytics for their own channel, Bilibili videos (use smoldesk/bilibili-scraper), or anything that needs a Google login.
How to call: run the Actor with JSON input and read the dataset items. Results cost money per item, so keep the counts small unless the user asks for more.
Example input: {"searchQueries": ["home espresso review"], "maxResults": 20, "uploadDate": "month", "sortBy": "views"}
```

Questions an agent can answer with it:

- What are the most-viewed espresso machine reviews posted this month?
- How often does this channel post, and which of its last 50 videos did best?
- Summarize the top comments on this video.

**Your agent can pay for its own runs.** This Actor is approved for agentic payments on Apify, so an agent with a Skyfire token or an x402 wallet can call it and pay per result without an Apify account. Skyfire: use `https://mcp.apify.com?payment=skyfire`. x402: buy a prepaid Apify token with USDC. Setup: [Apify agentic payments docs](https://docs.apify.com/platform/integrations/x402).

### Use with AI (LangChain / LlamaIndex / CrewAI)

Descriptions and comments are plain text, so the dataset drops straight into an LLM or RAG pipeline. With LangChain (`pip install langchain-apify`):

```python
from langchain_apify import ApifyWrapper
from langchain_core.documents import Document

apify = ApifyWrapper()  # reads APIFY_API_TOKEN
loader = apify.call_actor(
    actor_id="smoldesk/youtube-scraper",
    run_input={"searchQueries": ["best budget laptop 2026"], "maxResults": 20, "maxComments": 50},
    dataset_mapping_function=lambda v: Document(
        page_content=v.get("text") or f"{v.get('title')}\n\n{v.get('description')}",
        metadata={k: v.get(k) for k in ("type", "url", "videoId", "viewCount", "likeCount", "channelName")},
    ),
)
docs = loader.load()
```

Already have a run? Use `ApifyDatasetLoader(dataset_id="<run's dataset ID>", dataset_mapping_function=...)`. **LlamaIndex**: `ApifyActor` from `llama-index-readers-apify`. **CrewAI**: use the Apify MCP server above.

### Limitations

- **No transcripts or video downloads.** This Actor reads public video pages, not the media.
- **Tags, category and the exact upload time** are not included: YouTube only shows them to its video player, not on the public page.
- **Shorts and live streams have no duration** (`durationSeconds: null`); YouTube shows their length only inside the player.
- **Comment counts and subscriber counts are rounded** the way YouTube displays them. View and like counts are exact; `likeCount` is `null` when the uploader hides likes.
- Collaboration videos (two creators) are listed under the channel that uploaded them.
- Age-restricted and members-only videos show what a logged-out visitor sees.

### FAQ

**Do I need a YouTube API key?** No. There is no daily quota, and you don't need a Google Cloud project.

**How is this different from the YouTube Data API?** No quota (the official API allows about 100 searches a day), exact like counts, chapters, description links and channel social links in one run, and a CSV you can open straight away.

**Can I scrape all videos of a channel?** Yes: set **Max videos** to 0. Add the Shorts and Live tabs if you need those too.

**How do I get only new videos?** Set **Only videos published after** to `7 days` (or your schedule interval) and schedule the run.

**Do I need a login, cookies or proxies?** No. Residential proxies are never needed or used.

**Is it legal to scrape YouTube?** It reads public data that any logged-out visitor can see. Check YouTube's terms and your local rules (e.g. GDPR for personal data in comments) for your use case. This Actor is not affiliated with YouTube or Google.

### Feedback

Found a bug or missing a field? Open an issue in the **Issues** tab. If the Actor saved you time, a short review on this page helps other people find it.

Code examples and a quick reference are also on GitHub: [smoldesk/youtube-scraper](https://github.com/smoldesk/youtube-scraper).

### More Actors from Smoldesk Studios

- [Contact Details Scraper](https://apify.com/smoldesk/contact-details-scraper): emails, phone numbers, social profiles and contact forms from any list of websites, with email domains checked and junk removed, charged only when contacts are found
- [Google Maps Scraper](https://apify.com/smoldesk/google-maps-scraper): places with phones, websites, ratings and hours from any search, plus emails and social profiles from each business website, lead filters and new-place monitoring
- [YouTube Comments Scraper](https://apify.com/smoldesk/youtube-comments-scraper): comments and replies from videos, channels, playlists or keyword searches, with likes, pinned/hearted flags and authors
- [YouTube Channel Scraper](https://apify.com/smoldesk/youtube-channel-scraper): subscribers, exact total views, join date, country and social links of any channel, plus its latest videos
- [WeChat Articles Scraper](https://apify.com/smoldesk/wechat-articles-scraper): WeChat Official Account (公众号) articles from keyword search, full text as Markdown, images, account IDs and publish dates, no login
- [Toutiao Scraper](https://apify.com/smoldesk/toutiao-scraper): Toutiao (今日头条) news search with date ranges, reads and likes, comments and the hot board (热榜), no login
- [Google Trends Scraper](https://apify.com/smoldesk/google-trends-scraper): interest over time, by region and city, related queries and Trending now — no API key
- [Google Ads Transparency Scraper](https://apify.com/smoldesk/google-ads-transparency-scraper): every ad a competitor runs on Google Search, YouTube and Shopping — creatives, landing pages, countries, EU impressions and new-ad alerts
- [Bilibili Scraper](https://apify.com/smoldesk/bilibili-scraper): videos, stats, danmaku, comments and creators from China's video site, no login
- [Weibo Scraper](https://apify.com/smoldesk/weibo-scraper): keyword and hashtag search, posts, comments, profiles and the hot-search board from China's biggest microblog, no login
- [Telegram Channel Scraper](https://apify.com/smoldesk/telegram-channel-scraper): public channel posts, views, reactions and subscribers
- [Substack Scraper](https://apify.com/smoldesk/substack-scraper): newsletters, subscriber counts and posts
- [Google Hotels Scraper](https://apify.com/smoldesk/google-hotels-scraper): hotel prices for your dates in any currency, ratings, review aspects and booking-site prices, worldwide
- [Google Hotels Price Calendar](https://apify.com/smoldesk/google-hotel-price-calendar): the cheapest nightly rate for every check-in date up to a year ahead, for any hotel, with taxes and booking-site prices
- [Shopify Store Analyzer](https://apify.com/smoldesk/shopify-store-analyzer): apps, contacts and products of any Shopify store
- [Career Site Jobs Scraper](https://apify.com/smoldesk/career-site-jobs-scraper): live jobs from 12,000+ company career sites (Greenhouse, Lever, Workday, Ashby) with salary and seniority
- [SEEK, JobStreet & JobsDB Scraper](https://apify.com/smoldesk/seek-jobs-scraper): jobs and salaries across Australia and Southeast Asia
- [Tennis Scraper](https://apify.com/smoldesk/tennis-scraper): ATP, WTA, Challenger and ITF results with betting odds from 15 bookmakers, H2H and rankings

# Actor input Schema

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

Keywords to search on YouTube, one per line. Each term returns up to 'Max videos' results, ranked like youtube.com.

## `startUrls` (type: `array`):

One per line: video or Shorts URLs (or video IDs), channels (https://www.youtube.com/@mkbhd, just @mkbhd, /channel/UC…, /c/…) and playlist URLs. A channel URL ending in /shorts or /streams scrapes only that tab.

## `maxResults` (type: `integer`):

Stop after this many videos for each search term, each channel tab and each playlist. 0 = no limit (whole channel or playlist).

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

Skip videos older than this date. Use a date (2025-01-31) or a period (7 days, 3 months). On channels it also stops paging early, so monitoring runs stay cheap.

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

Search ranking: YouTube's relevance or most viewed. For the newest videos use 'Upload date' below (e.g. Today / This week) together with 'Only videos published after'.

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

Regular videos or Shorts only.

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

YouTube's own upload date filter for searches.

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

Video length filter for searches.

## `features` (type: `array`):

Only videos with all of these features (search only).

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

Two-letter country code that YouTube uses to rank search results (US, GB, IN, MY…).

## `channelTabs` (type: `array`):

Which tabs to scrape for channel URLs. Leave empty to get only the channel profile (subscribers, views, links…).

## `includeChannelInfo` (type: `boolean`):

For channel URLs, also save one channel record: exact total views, subscribers, video count, join date, country, external links.

## `maxComments` (type: `integer`):

Top-level comments to save for every video. 0 = no comments.

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

Top comments (YouTube's ranking) or newest first.

## `maxRepliesPerComment` (type: `integer`):

Replies to save under each comment (they are saved right after their parent and have isReply = true). 0 = no replies.

## `maxConcurrency` (type: `integer`):

How many YouTube pages to load at once. The default is fast and safe.

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

Not needed — the Actor already falls back to Apify datacenter proxy when YouTube slows a connection down. Residential proxy is not used.

## Actor input object example

```json
{
  "searchQueries": [
    "web scraping tutorial"
  ],
  "startUrls": [
    "https://www.youtube.com/@mkbhd"
  ],
  "maxResults": 10,
  "sortBy": "relevance",
  "searchType": "videos",
  "uploadDate": "any",
  "duration": "any",
  "country": "US",
  "channelTabs": [
    "videos"
  ],
  "includeChannelInfo": true,
  "maxComments": 0,
  "commentsSortBy": "top",
  "maxRepliesPerComment": 0,
  "maxConcurrency": 10
}
```

# Actor output Schema

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

Videos, Shorts and streams (type = video).

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

Channel profiles (type = channel).

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

Comments and replies (type = comment).

# 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 = {
    "searchQueries": [
        "web scraping tutorial"
    ],
    "startUrls": [
        "https://www.youtube.com/@mkbhd"
    ],
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("smoldesk/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 = {
    "searchQueries": ["web scraping tutorial"],
    "startUrls": ["https://www.youtube.com/@mkbhd"],
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("smoldesk/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 '{
  "searchQueries": [
    "web scraping tutorial"
  ],
  "startUrls": [
    "https://www.youtube.com/@mkbhd"
  ],
  "maxResults": 10
}' |
apify call smoldesk/youtube-scraper --silent --output-dataset

```

## MCP server setup

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