# YouTube Scraper: Videos, Channels, Shorts & Search, $0.50/1K (`fit_melon/youtube-scraper`) Actor

Scrape YouTube videos, Shorts, channels, playlists and search results: views, likes, comments count, exact date, duration, description, hashtags, tags, category and channel subscribers. A YouTube API alternative: no login, no API key. $0.50 per 1,000 results, all-in. Find influencers by keyword.

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

## Pricing

$0.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 is this YouTube Scraper?

**YouTube Scraper** is a YouTube channel scraper, YouTube Shorts scraper and YouTube search scraper in one: it turns searches, channels, playlists and video links into clean YouTube video data. For every video and Short you get the title, full description, **views, likes and comments count**, exact publication date, duration, hashtags and tags, category, thumbnail, live status and the channel with its subscribers. For every channel you get subscribers, total views, exact video count and joined date, plus country and external links when the channel shows them. **$0.50 per 1,000 results, all included**: video details, comments count, channel data, date filter, proxies and platform usage. No add-ons, no start fee.

A YouTube API alternative: it uses plain HTTP requests to YouTube's public pages, with no browser, no login and no YouTube API key or quota. In our benchmark (October 2026), a 500-video search finished in about 3.5 minutes and 5 complete channels (1,779 videos, Shorts and live streams, plus the 5 channel results) in about 7.5 minutes.

Use it for market and trend research, influencer and competitor monitoring, content strategy, video SEO or data enrichment. Run it from Apify Console, through the API, on a schedule, or from Make, n8n and Zapier. Apify's free plan ($5 of monthly credit) covers up to 10,000 results a month.

> 🇫🇷 **Scraper YouTube** : vidéos, Shorts, chaînes, playlists et recherches, avec vues, likes, nombre de commentaires, date exacte et abonnés. 0,50 $ les 1 000 résultats, tout compris.
> 🇩🇪 **YouTube Scraper**: Videos, Shorts, Kanäle, Playlists und Suchergebnisse mit Aufrufen, Likes, Kommentaranzahl und Abonnenten. 0,50 $ pro 1.000 Ergebnisse, alles inklusive.
> 🇪🇸 **Scraper de YouTube**: vídeos, Shorts, canales, listas y búsquedas con vistas, likes, número de comentarios y suscriptores. 0,50 $ por 1.000 resultados.

- **Full details on every video**, not just what a list shows: exact view count, like count, comments count, ISO publication date (UTC), duration in seconds, full description, hashtags, tags, category, Short and live flags, channel subscribers.
- **Videos, Shorts and live streams separately.** Set how many regular videos, Shorts and live streams you want per search term or channel.
- **Channels.** Paste `@handle`, `/channel/UC…`, `/c/…` or `/user/…` links: one channel result plus its videos, Shorts and live streams, sorted by latest, popular or oldest.
- **Search filters.** Upload date, duration, result type (videos, Shorts, channels, playlists, movies), popularity, country and language.
- **Date filter for channels and playlists, included.** Only videos published after a date (`2026-01-31`) or in the last `30 days`.
- **No duplicates.** A video found by two searches is delivered and charged once.
- **Safe on big jobs.** Runs resume after a platform restart with no double charge, stop cleanly before the run's time limit and at your maximum cost per run. Error rows are free.
- **Drop-in for other YouTube scrapers.** The input names most used on the Store also work (`searchQueries`, `startUrls`, `maxResults`, `maxResultsShorts`, `maxResultStreams`, `sortingOrder`, `dateFilter`…).

⭐ If this actor saves you time, please **bookmark it and leave a review**: it helps other users find it.

### How to scrape YouTube (step by step)

1. Enter one or more **search terms** (`lofi hip hop`, `iphone 17 review`, `home workout`…), and/or paste **channels**, **playlists** or **video** links.
2. Set **Max videos** per search term, channel or playlist. Add **Max Shorts** and **Max live streams** if you want them too.
3. Optional: pick filters (upload date, duration, type, popularity), a **country**, or a **date** for channels and playlists.
4. Click **Start**, then download the results as CSV, Excel or JSON, or send them to Google Sheets, your database, Make, n8n or Zapier.

### What YouTube data can you extract?

| Data | Fields | Filled in our benchmark\* |
|---|---|---|
| Video identity | `videoId`, `url`, `title`, `thumbnailUrl` | 100% |
| Description | `description` (full text, as written by the creator) | 96% to 99% (some videos have none) |
| Statistics | `viewCount`, `likeCount`, `commentCount` | views 97.5% to 100%, likes 97% to 99.9%, comments 97% to 98% |
| Date and length | `publishedAt` (ISO 8601, UTC), `durationSeconds` | date 100%, duration 99.6% to 100% (none while a stream is live) |
| Topics | `category`, `keywords` (tags), `hashtags` | category 100%, tags 75% to 86% |
| Type | `isShort`, `isLive`, `isUpcoming`, `isLiveContent`, `liveStartedAt`, `liveEndedAt` | flags 100%, live times on live streams only |
| Channel of the video | `channelName`, `channelId`, `channelUrl`, `channelHandle`, `channelSubscriberCount` | 99% (subscribers) to 100% |
| Channel results | `subscriberCount`, `videoCount`, `viewCount`, `country`, `joinedAt`, `links`, `description`, `avatarUrl`, `bannerUrl`, `isVerified` | subscribers, video count, total views, joined date 100%; `country` and `links` only when the channel shows them |
| Context | `searchQuery`, `sourceUrl`, `sourceType`, `sourceList`, `rank`, `scrapedAt` | always set (`searchQuery` only on search results) |

\* A 500-video search and 5 complete channels (1,784 results), October 2026. Fields stay empty when YouTube does not show them (likes hidden by the creator, comments turned off, no tags). In the rare case YouTube refuses a video's details on every IP, the video comes with what the list showed (approximate date, no likes or tags) and `detailsStatus: "partial"`; this did not happen in our benchmark.

### Why this YouTube Scraper?

| | This actor |
|---|---|
| Price for 1,000 videos **with full details** | **$0.50**, all included (no start fee, no add-ons) |
| Comments count and channel subscribers on each video | ✅ Included (can be turned off for about 20% faster runs) |
| Channels with Shorts and live streams, sorted latest / popular / oldest | ✅ Included |
| Only videos published after a date (channels, playlists) | ✅ Included (a paid add-on in the most used YouTube scraper) |
| Exact date and duration in seconds | ✅ `publishedAt` ISO 8601 (UTC), `durationSeconds` |
| Category and tags | ✅ Included |
| Login, cookies or YouTube API key | ❌ Not needed |

For comparison, the most used YouTube scraper on the Apify Store charges $4.00 per 1,000 videos on Apify's Free plan down to $2.40 on Business ($1.00 on the highest tier), plus $1.30 to $0.60 per 1,000 on the same plans for its channel date-range add-on (public Store prices, October 2026). On the 22 videos both scrapers returned in a 30-video test, view counts matched within 0.02% and dates, durations and titles were identical. Their like counts were rounded (35,000,000) where ours are exact (35,969,169); their comments counts were exact where ours are rounded above 1,000 (1,200,000 for 1,244,140).

### YouTube scraper input

| Field | What it does |
|---|---|
| `searchQueries` | Search terms, one search per line. |
| `maxResults` | Regular videos per search term, channel and playlist (20 when no limit at all is set). |
| `maxResultsShorts` | Shorts per search term and channel (0 = none). |
| `maxResultStreams` | Live streams per search term (streams live now) and per channel (its Live tab: live, upcoming and past streams) (0 = none). |
| `channelUrls` | Channel links or handles. Each one gives a channel result plus its videos, Shorts and streams. |
| `playlistUrls` | Playlist links or IDs. Videos in playlist order. |
| `videoUrls` | Video links or IDs: `watch?v=`, `youtu.be/`, `/shorts/`, `/live/`. |
| `startUrls` | Any mix of the links above and search result links, or a CSV/text file of links. As in other YouTube scrapers, search terms are ignored when start URLs are given. |
| `uploadDate`, `duration`, `type`, `sortBy` | Search filters: upload date (last hour to this year), duration (< 3 min, 3–20 min, > 20 min), result type (videos, Shorts, channels, playlists, movies), relevance or popularity. |
| `country`, `language` | Country of the search results (`US`, `FR`, `JP`…) and interface language of the searches. |
| `sortVideosBy` | Order of a channel's videos: `NEWEST`, `POPULAR` or `OLDEST`. |
| `oldestPostDate` | Channels and playlists: only videos published after this date (`2026-01-31`) or this period (`30 days`, `6 months`). |
| `includeCommentCount` | Comments count and channel subscribers on each video (default on). |

#### Example inputs

Search, with Shorts:

```json
{
  "searchQueries": ["home workout", "meal prep"],
  "maxResults": 100,
  "maxResultsShorts": 20,
  "country": "US"
}
```

Recent videos of several channels (last 30 days, videos and Shorts):

```json
{
  "channelUrls": ["https://www.youtube.com/@kurzgesagt", "@veritasium", "https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw"],
  "maxResults": 500,
  "maxResultsShorts": 500,
  "oldestPostDate": "30 days"
}
```

Find channels on a topic (one channel result each, with subscribers, total views and links):

```json
{
  "searchQueries": ["personal finance"],
  "type": "channels",
  "maxResults": 50
}
```

Specific videos and a playlist:

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ", "https://youtu.be/jNQXAC9IVRw", "https://www.youtube.com/shorts/aSE9EJoklDo"],
  "playlistUrls": ["https://www.youtube.com/playlist?list=PLoaTDHRuxwgxk0WTXRJJJlXUYuHBSrbcF"],
  "maxResults": 200
}
```

Input written for another YouTube scraper (works as is; here `dateFilter` and `sortingOrder` also apply to the pasted search link):

```json
{
  "startUrls": [{ "url": "https://www.youtube.com/results?search_query=crawlee" }, { "url": "https://www.youtube.com/@Apify" }],
  "maxResults": 20,
  "maxResultsShorts": 5,
  "maxResultStreams": 0,
  "dateFilter": "year",
  "sortingOrder": "views"
}
```

### YouTube data output example

A video (from the `home workout` benchmark search, description and tags shortened, some fields left out):

```json
{
  "type": "video",
  "videoId": "jKTxe236-4U",
  "url": "https://www.youtube.com/watch?v=jKTxe236-4U",
  "title": "30 MIN FULL BODY WORKOUT - Apartment & Small Space Friendly (No Equipment, No Jumping)",
  "description": "If you live in an apartment or feel limited working out at home, this workout is for you! …",
  "channelName": "MadFit",
  "channelId": "UCpQ34afVgk8cRQBjSJ1xuJQ",
  "channelUrl": "https://www.youtube.com/channel/UCpQ34afVgk8cRQBjSJ1xuJQ",
  "channelHandle": "@MadFit",
  "channelSubscriberCount": 11700000,
  "publishedAt": "2023-04-04T15:21:49.000Z",
  "durationSeconds": 1948,
  "viewCount": 5620672,
  "likeCount": 96923,
  "commentCount": 1400,
  "thumbnailUrl": "https://i.ytimg.com/vi/jKTxe236-4U/maxresdefault.jpg",
  "hashtags": ["#homeworkout", "#fitness", "#workout"],
  "keywords": ["full body workout", "home workout", "at home workout"],
  "category": "People & Blogs",
  "isShort": false,
  "isLive": false,
  "isUpcoming": false,
  "searchQuery": "home workout",
  "sourceType": "search",
  "sourceList": "videos",
  "rank": 10,
  "scrapedAt": "2026-10-28T08:43:01.014Z"
}
```

A Short (from a channel's Shorts tab, some fields left out):

```json
{
  "type": "video",
  "videoId": "V_uq3v6xK-4",
  "url": "https://www.youtube.com/shorts/V_uq3v6xK-4",
  "title": "The Sphere Intersection Puzzle",
  "channelName": "3Blue1Brown",
  "channelHandle": "@3blue1brown",
  "channelSubscriberCount": 8720000,
  "publishedAt": "2026-10-25T14:30:46.000Z",
  "durationSeconds": 46,
  "viewCount": 227410,
  "likeCount": 7037,
  "commentCount": 319,
  "category": "Education",
  "isShort": true,
  "sourceType": "channel",
  "sourceUrl": "https://www.youtube.com/@3blue1brown",
  "sourceList": "shorts",
  "rank": 1
}
```

A channel (links shortened, some fields left out):

```json
{
  "type": "channel",
  "channelId": "UCsXVk37bltHxD1rDPwtNM8Q",
  "channelName": "Kurzgesagt – In a Nutshell",
  "channelUrl": "https://www.youtube.com/channel/UCsXVk37bltHxD1rDPwtNM8Q",
  "handle": "@kurzgesagt",
  "subscriberCount": 25800000,
  "videoCount": 396,
  "viewCount": 3977840968,
  "country": "Germany",
  "joinedAt": "2013-07-09",
  "links": [{ "title": "Patreon", "url": "http://www.patreon.com/Kurzgesagt" }, { "title": "Instagram", "url": "https://instagram.com/Kurzgesagt" }],
  "isVerified": true,
  "sourceType": "channel",
  "sourceUrl": "https://www.youtube.com/@kurzgesagt",
  "sourceList": "info"
}
```

Videos, channels and playlists come in one dataset (`type` tells them apart). The **Videos**, **Channels** and **Video details** tabs of the output show the main columns. Inputs that cannot be scraped (a channel that does not exist, a private video) give a free row with `status: "error"`, an `error` code and the `input`.

### How much does it cost to scrape YouTube?

**$0.50 per 1,000 results** (videos, Shorts, channels or playlists actually delivered), everything included. You are never charged for error rows, duplicates or results above your limits, and the run stops at your maximum cost per run. Apify's free plan ($5 of monthly credit) covers about 10,000 results a month.

| Job | Results | Time (benchmark) | Price |
|---|---|---|---|
| 20 videos from links | 20 | ~20 s | $0.01 |
| 500 videos from one search | 500 | ~3.5 min | $0.25 |
| 5 complete channels (videos, Shorts, streams) | 1,784 | ~7.5 min | $0.89 |

### Use it via API, Make, n8n or AI agents

Start a run and get the results with one HTTP call:

```bash
curl -X POST "https://api.apify.com/v2/acts/fit_melon~youtube-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchQueries": ["lofi hip hop"], "maxResults": 20}'
```

The same actor works in **Make**, **n8n** and **Zapier** (Apify modules), from the Apify JavaScript and Python clients, and from AI agents through the Apify MCP server. If you used another YouTube scraper, replace its actor ID with `fit_melon/youtube-scraper`: the usual input names work. Output fields are named as in the YouTube data above; the table below maps the most common other names.

| Other scrapers | This actor |
|---|---|
| `id` | `videoId` |
| `text` | `description` |
| `date` | `publishedAt` |
| `likes` | `likeCount` |
| `commentsCount` | `commentCount` |
| `duration` (`00:03:27`) | `durationSeconds` (`207`) |
| `numberOfSubscribers` | `channelSubscriberCount` (videos) / `subscriberCount` (channels) |
| `channelUsername` | `channelHandle` |
| `order` | `rank` |

### YouTube Scraper FAQ

#### How much does it cost to scrape YouTube?

$0.50 per 1,000 results, all included: details of each video, comments count, channel data, date filter, proxies and platform usage. No start fee and no paid options.

#### Does it get the comments count, likes and subscribers?

Yes. Likes and views are exact. The comments count is exact below 1,000 and rounded above, as YouTube shows it next to the video (for example `2400000` for "2.4M"; comment texts are never loaded). It is 0 when comments are open but empty, and empty (null) when comments are turned off, the video is live or age-restricted, or the option is off. Subscriber counts are rounded by YouTube itself (3 significant digits, like `25800000`) for every tool.

#### Can I scrape YouTube Shorts?

Yes. Set **Max Shorts** for search terms (YouTube's Shorts filter) or channels (the channel's Shorts tab). Each Short gets the same details as a video, with `isShort: true` and a `/shorts/` URL.

#### Can I get all videos of a channel?

Yes: set all three limits high (for example `maxResults`, `maxResultsShorts` and `maxResultStreams` at 10,000; a limit you leave out counts as 0 once another one is set). You get everything the channel's Videos, Shorts and Live tabs list. In our benchmark, 1,779 of the 1,780 uploads announced by 5 channels were delivered.

#### How do I get only recent videos?

For searches, use **Upload date** (last hour, today, this week, this month, this year). For channels and playlists, use **Only videos published after** with a date or a period like `7 days`: with the Latest order, the channel is scanned only down to that date.

#### Does it scrape transcripts, subtitles or comments?

No. For transcripts and subtitles, use our [YouTube Transcript Scraper](https://apify.com/fit_melon/youtube-transcript-scraper). Comment texts and commenter data are not collected.

#### Can I download videos or audio?

No. This actor only collects public metadata; it never downloads videos or audio.

#### Do I need a YouTube API key, an account or proxies?

No. No API key, no quota, no login or cookies. Apify proxies are included in the price.

#### How many results can I get from one search?

YouTube ends a search after about a hundred to a few hundred results. When it stops early, the actor runs the same search again with other filters (popularity, duration, upload date) and merges the results without duplicates, so a 500-video search delivered 500 unique videos in our benchmark. Very niche searches simply have fewer videos.

#### How fast is it?

About 140 results per minute on a single search and about 240 per minute on several channels in parallel (benchmark, default settings). Turn off the comments count for about 20% faster runs. Small runs take 20 to 90 seconds.

#### Which memory should I use?

The default (1 GB). In our benchmark it was 1.7 to 2.8 times faster than 512 MB. Your price is $0.50 per 1,000 results whatever the memory.

#### Is it legal to scrape YouTube?

This actor only reads public pages, as a logged-out visitor, at a moderate rate. Video and channel data can still include personal data (for example a creator's name in a description). If you process it, you are responsible for doing it lawfully (GDPR, CCPA) and for respecting YouTube's terms and copyright. This actor is not affiliated with, endorsed or sponsored by YouTube or Google.

#### Can I switch from another YouTube scraper?

Yes: the most common input names are accepted, so your input usually works as is (see the last example input). Output names differ for a few fields (`id`, `text`, `date`, `likes`…): remap them in your workflow with the table above.

### Use cases

- **Market and trend research**: what gets views in a niche, which formats and lengths work, how Shorts compare with long videos.
- **Influencer marketing**: find channels on a topic with their subscribers, total views, country and links, then check their recent videos.
- **Competitor monitoring**: track a list of channels every day or week with the date filter, and watch views, likes and comments grow.
- **Content and video SEO**: titles, tags, hashtags and descriptions of the videos that rank for your keywords, by country.
- **Research and data science**: build datasets of videos with exact dates, durations, categories and engagement.

### Limitations & fair use

- Public data only, as seen by a logged-out visitor: no private, members-only or age-gated content beyond its public details, no login, no CAPTCHA solving.
- Subscriber counts are rounded by YouTube for every tool. Comments counts above 1,000 are rounded as in YouTube's video panel (`1200000` for "1.2M"), because the actor never loads the comments themselves.
- Search results depend on YouTube's ranking for the chosen country and can change from one run to the next.
- The actor keeps a moderate request rate. Very large jobs are best split into several runs.

### Changelog

- **2026-10-30**: faster channel runs. A channel's Videos, Shorts and Live tabs are now read at the same time instead of one after another (a video listed by two tabs is still delivered and charged once).
- **2026-10-29**: faster small runs. A slow proxy connection can no longer hold a run: every request has a hard deadline, a video whose details are slow is replaced by the next listed one, and the requests still in flight are cancelled as soon as an input has its max results.
- **1.0 (2026-10-28)**: first public version. Videos, Shorts, live streams, channels, playlists and searches; comments count and channel subscribers; date filter; input names of other YouTube scrapers.

### More actors by this developer

- [YouTube Transcript Scraper](https://apify.com/fit_melon/youtube-transcript-scraper): transcripts and subtitles of YouTube videos.
- [Google Maps Scraper](https://apify.com/fit_melon/google-maps-scraper-cheap): local business leads with phones, websites and emails, $0.50 per 1,000 places.

# Actor input Schema

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

What you would type in the YouTube search bar, one search per line. Each term returns up to "Max videos" regular videos (plus Shorts and live streams if you set those limits).

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

Regular videos returned for each search term, each channel and each playlist (20 when no limit at all is set). Set 0 to get only Shorts or live streams. You pay only for results actually returned ($0.0005 each).

## `maxResultsShorts` (type: `integer`):

Shorts returned for each search term and each channel (0 = no Shorts).

## `maxResultStreams` (type: `integer`):

Live streams per search term (streams live now) and per channel (its Live tab: live, upcoming and past streams). 0 = none.

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

Channel links or handles: https://www.youtube.com/@MrBeast, @MrBeast, https://www.youtube.com/channel/UC…, /c/… or /user/… links. Each channel returns one channel result (subscribers, total views, video count, country, joined date, links) plus its latest videos, Shorts and live streams up to the limits above.

## `playlistUrls` (type: `array`):

Playlist links or IDs (https://www.youtube.com/playlist?list=PL…). Returns up to "Max videos" videos per playlist, in playlist order.

## `videoUrls` (type: `array`):

Video links or IDs: watch?v=…, youtu.be/…, /shorts/…, /live/… One result per video.

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

Any mix of video, Short, channel, playlist or search results links (https://www.youtube.com/results?search_query=…), or a CSV / text file of links. Kept for compatibility with other YouTube scrapers: as there, when start URLs are given the search terms above are ignored.

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

Only videos uploaded in this period (search terms only).

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

Only videos of this length (search terms only).

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

What a search returns: videos (default), Shorts only, channels (one channel result each, with subscribers and total views) or playlists.

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

Search order. YouTube now offers relevance and popularity only (sorting by upload date or rating is no longer supported by YouTube; use the upload date filter instead).

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

Two-letter country code for search results (e.g. US, FR, DE, JP, BR). YouTube ranks results for this country.

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

Interface language used for searches (e.g. en, fr, de, ja). Titles and descriptions are always returned as written by the creator.

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

Order of a channel's videos, Shorts and live streams (the channel's Latest / Popular / Oldest buttons).

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

Skip videos published before this date: an absolute date (2026-01-31) or a relative one ("30 days", "6 months"). Included in the price (no add-on). With the Latest order, a channel is scanned only down to this date.

## `includeCommentCount` (type: `boolean`):

Adds commentCount (exact below 1,000, rounded above by YouTube) and channelSubscriberCount to each video. Included in the price; turn it off for about 20% faster runs.

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

Apify datacenter proxies are used by default and included in the price. Residential proxies are only a limited, automatic fallback.

## Actor input object example

```json
{
  "searchQueries": [
    "lofi hip hop"
  ],
  "maxResults": 10,
  "uploadDate": "any",
  "duration": "any",
  "type": "videos",
  "sortBy": "relevance",
  "country": "US",
  "language": "en",
  "sortVideosBy": "NEWEST",
  "includeCommentCount": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One item per video, Short or channel; Videos table.

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

Channel results: subscribers, total views, video count, country, joined date, links.

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

Description, hashtags, tags, channel subscribers, live times of each video.

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

Run statistics: requests, timings, blocks, cost estimate.

# 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": [
        "lofi hip hop"
    ],
    "maxResults": 10,
    "maxResultsShorts": 0,
    "maxResultStreams": 0,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("fit_melon/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": ["lofi hip hop"],
    "maxResults": 10,
    "maxResultsShorts": 0,
    "maxResultStreams": 0,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("fit_melon/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": [
    "lofi hip hop"
  ],
  "maxResults": 10,
  "maxResultsShorts": 0,
  "maxResultStreams": 0,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call fit_melon/youtube-scraper --silent --output-dataset

```

## MCP server setup

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