# YouTube Search Scraper \[From $0.20/1K 💰] Official API (`cybermax/youtube-search-scraper`) Actor

💰 $0.20 per 1,000 videos + $0.001 per run; empty searches are free. YouTube search results and trending videos by country with views, likes, comments, duration and tags, through the official YouTube Data API with your own free API key. Date, length, region and language filters; monitor.

- **URL**: https://apify.com/cybermax/youtube-search-scraper.md
- **Developed by:** [CyberMax](https://apify.com/cybermax) (community)
- **Categories:** Videos, Social media, MCP servers
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Vidtrawl: YouTube Search Scraper & Trending Videos (Official API)

#### YouTube search results and trending charts with views, likes, comments and duration, from the official YouTube Data API with your own free key

Vidtrawl is a **YouTube search scraper** that does not scrape: it runs your searches through the **official YouTube Data API v3** with **your own free API key** and returns every result with **views, likes, comment count, duration, publish date, channel, tags, topics and thumbnail**. Sort by relevance, date or views; filter by **upload date, length, country, language, captions or Creative Commons licence**; search inside one channel; or pull the **trending (most popular) chart for any country**. **Monitor mode** returns only videos it has not delivered before, so a daily schedule becomes a new-video alert for any keyword.

**[▶ Try it now](https://apify.com/cybermax/youtube-search-scraper)** (run it empty for a free demo of the output format) · $0.20 per 1,000 videos + $0.001 per run · Apify's free plan includes $5 of credit a month

**Built for:** content and SEO teams researching what ranks for a keyword on YouTube · brand and PR teams watching for new videos that mention a product · market researchers sampling a topic · agencies finding creators in a niche · AI agents that need video search as a tool

**Real output** (real run on Apify, 12 Nov 2026: 2 searches + the US trending chart, 148 videos in 3.8 s, 204 API units):

| Search | # | Title | Channel | Published | Length | Views | Likes |
|---|---|---|---|---|---|---|---|
| web scraping tutorial | 1 | Learn Web Scraping in 5 Minutes (NO PRIOR KNOWLEDGE) | CodeHead | 2026-03-05 | 4:53 | 188,610 | 6,852 |
| web scraping tutorial | 3 | Python Web Scraping Tutorial: Complete Guide 2026 | Oxylabs | 2026-02-20 | 8:01 | 9,442 | 555 |
| trending:US | 48 | My GODDESS Forbidden Love! | Aphmau | 2026-11-11 | 21:31 | 95,653 | 3,763 |
| trending:US | 50 | The Elite: Army Rangers | Official Trailer | Paramount+ | Paramount Plus | 2026-11-11 | 1:31 | 46,317 | 523 |

```json
{
  "type": "video",
  "query": "web scraping tutorial",
  "position": 1,
  "videoId": "hHQlcnubuFI",
  "url": "https://www.youtube.com/watch?v=hHQlcnubuFI",
  "title": "Learn Web Scraping in 5 Minutes (NO PRIOR KNOWLEDGE)",
  "publishedAt": "2026-03-05T15:01:30Z",
  "channelTitle": "CodeHead",
  "durationSeconds": 293,
  "duration": "4:53",
  "views": 188610,
  "likes": 6852,
  "comments": 96,
  "tags": ["web dev", "programming tutorials", "learn to code"],
  "hasCaptions": false,
  "topics": ["Knowledge", "Technology"],
  "retrievedAt": "2026-11-12T03:04:05.396Z"
}
```

### What it costs

| What | Price |
|---|---|
| Video returned | **$0.0002** ($0.20 per 1,000) |
| Run started (once per run, after YouTube accepts your key) | **$0.001** |
| Searches with no results, videos under your minimum views, API errors, videos already delivered in monitor mode, demo runs, runs with a refused key | free |

Example: 20 searches × 50 results = 1,000 videos for **$0.201**. Prices of other Store Actors for the same job on 12 Nov 2026 (their Free-plan tier): grow_media/youtube-search-api $1.00 per 1,000, delicious_zebu/youtube-video-scraper-by-keyword $1.20 per 1,000, api-ninja/youtube-search-scraper $5.00 per 1,000 + $0.01 per run, streamers/youtube-scraper $4.00 per 1,000. Those need no API key; Vidtrawl needs your free key.

**The limit to know:** on YouTube's API a page of 50 search results costs **100 units**, so the free 10,000 daily units cover about **100 result pages (5,000 results) a day**. Trending charts cost 1 unit per 50 videos. Need more? Ask Google for a higher quota, or spread schedules over the day.

### Get your free YouTube Data API key (about 3 minutes, once)

1. Open [Google Cloud Console](https://console.cloud.google.com/) and create a project (any name; no billing account is needed for this API).
2. Go to **APIs & Services → Library**, search **YouTube Data API v3** and press **Enable**.
3. Go to **APIs & Services → Credentials → Create credentials → API key**.
4. Optional but wise: edit the key, set **API restrictions → YouTube Data API v3**, and leave **Application restrictions** on *None* (the Actor calls Google from Apify's servers).
5. Paste the key into the **YouTube Data API key** field. It is a secret input: Apify stores it encrypted, the Actor sends it only to `googleapis.com` and never writes it to the log or the dataset.

Google gives every project **10,000 API units a day for free**; the quota resets at midnight Pacific time. If you run out, the run stops cleanly, keeps what it has and tells you; you can ask Google for a higher quota in the same console.

### How to use it

1. Paste your **YouTube Data API key**.
2. Add **search terms**, one per line, and choose **Results per search**.
3. Optional: sort order, date range, length, country, language, minimum views.
4. Optional: add **Trending: countries** (US, GB, DE…) for the most-popular chart.
5. Run and download JSON, CSV or Excel.

### Ready-made inputs

```json
{ "apiKey": "YOUR_KEY", "queries": ["web scraping tutorial"], "maxResultsPerQuery": 50 }
```

```json
{ "apiKey": "YOUR_KEY", "queries": ["your brand name"], "sortBy": "date", "publishedAfter": "7 days", "monitor": true }
```

```json
{ "apiKey": "YOUR_KEY", "trendingRegions": ["US", "GB", "DE"], "maxTrendingPerRegion": 50, "trendingCategoryId": "20" }
```

### Run it on a schedule (only new videos)

Turn on **Monitor mode**, set **Sort by: Upload date** and schedule the Actor daily. Each run returns only videos it has not delivered before for that watchlist; a run with nothing new costs only the $0.001 run fee (and 100 API units per search on your side).

### Integrations

- **API:** `POST https://api.apify.com/v2/acts/cybermax~youtube-search-scraper/run-sync-get-dataset-items`.
- **Python / JavaScript:** `apify-client`.
- **AI agents (MCP):** `https://mcp.apify.com/?tools=cybermax/youtube-search-scraper`.
- **No code:** Make, Zapier and n8n through their Apify apps.

### Why Vidtrawl

- **Official search.** The same search service YouTube offers developers, with exact statistics for every result.
- **Real filters:** date range, length, country, language, captions, Creative Commons, one channel.
- **Trending by country and category** in the same run.
- **Fast and dependable:** no browser, no proxies; 148 videos in under 4 seconds.
- **Honest limits:** about 5,000 search results a day on the free quota, at most about 500 results per search, and results can differ slightly from what a signed-in person sees on youtube.com.

### FAQ

**Why do I need my own API key?** YouTube's terms forbid scraping its site; its official API is the legitimate route, and Google issues the free quota per project.

**Why did a nonsense search still return videos?** YouTube's search is fuzzy and often returns loosely related videos. Use quotes for exact phrases and **Minimum views** to drop noise.

**Can it search Shorts only?** Use **Length: Under 4 minutes**; the API has no Shorts-only switch. For one channel's Shorts use [Chanroll](https://apify.com/cybermax/youtube-channel-scraper).

**Does it return transcripts or comments?** No. It returns the comment count and whether captions exist.

**Can an AI agent use it?** Yes, through Apify's MCP server; pass the key in the tool input.

### Terms and data source

This Actor is an API client for **YouTube API Services**: every row comes from the official [YouTube Data API v3](https://developers.google.com/youtube/v3), called with your own key and your own quota. It does not load youtube.com pages or feeds and does not download videos, audio or captions. By using it you agree to be bound by the [YouTube Terms of Service](https://www.youtube.com/t/terms); Google's handling of data is described in the [Google Privacy Policy](https://policies.google.com/privacy). Your Google Cloud project is the API client of record, so the [YouTube API Services Terms](https://developers.google.com/youtube/terms/api-services-terms-of-service) and [Developer Policies](https://developers.google.com/youtube/terms/developer-policies) apply to how you store and use the results (for example, refresh or delete stored statistics after 30 days). CyberMax is not affiliated with, endorsed by or sponsored by YouTube or Google. YouTube is a trademark of Google LLC.

### Also from CyberMax

- [Chanroll: YouTube Channel Video Scraper](https://apify.com/cybermax/youtube-channel-scraper) · every upload of a channel, Shorts/long/live split, upload monitor.
- [Vidvett: YouTube Video Details Scraper](https://apify.com/cybermax/youtube-video-details) · bulk stats for video links and playlists, with growth deltas.
- [Swellmeter: Google Trends Scraper](https://apify.com/cybermax/google-trends) · is interest in the topic rising?
- [Keyfern: Keyword Ideas](https://apify.com/cybermax/keyword-ideas) · what people type before they search.

Found this useful? A quick rating helps others find it.

© 2026 CyberMax. All rights reserved.

# Actor input Schema

## `queries` (type: `array`):

One search per line, as you would type it on YouTube (operators such as -word and "exact phrase" work). Each page of 50 results uses 100 of your 10,000 free daily API units, so about 5,000 results a day on the default quota.

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

Your own YouTube Data API v3 key from Google Cloud Console (free, about 3 minutes: create a project, enable 'YouTube Data API v3', create an API key; steps in the README). It is stored encrypted, sent only to googleapis.com and never logged. Leave empty for a free demo that returns illustrative rows.

## `maxResultsPerQuery` (type: `integer`):

YouTube returns at most about 500 results per search.

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

Order of the results, as on YouTube.

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

A date (2026-01-31) or an age (24 hours, 7 days, 3 months). Empty = no limit.

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

A date (2026-06-30). Empty = no limit.

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

YouTube's own length filter.

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

Two-letter country code (US, GB, DE, BR, IN…): results that can be watched in that country.

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

Two-letter language code (en, es, de, pt…): prefers results in that language.

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

A UC… channel ID, to search inside one channel.

## `minViews` (type: `integer`):

Leave out videos with fewer views. Videos left out are not charged.

## `creativeCommonsOnly` (type: `boolean`):

Only videos their owners published under the Creative Commons licence.

## `captionsOnly` (type: `boolean`):

Only videos that have closed captions.

## `trendingRegions` (type: `array`):

Two-letter country codes (US, GB, DE, JP…). Returns YouTube's most popular videos chart for each country. Costs 1 API unit per 50 videos.

## `maxTrendingPerRegion` (type: `integer`):

The chart holds up to 200 videos.

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

Optional YouTube category ID: 10 Music, 17 Sports, 20 Gaming, 24 Entertainment, 25 News, 28 Science & Technology.

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

Stop after this many videos across the whole run. Empty = no total cap. You can also cap the cost with the run's 'Maximum charge' option.

## `monitor` (type: `boolean`):

Remembers which videos it has already delivered for these searches and returns only videos it has not delivered before. Schedule it daily with 'Sort by: Upload date' for a new-video alert; videos already delivered are free.

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

Optional name for this watchlist, so two schedules with different inputs keep separate memories. Leave empty to use one memory per unique input.

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

For developers who already use Google OAuth: an access token with a YouTube read scope. Tokens expire after about an hour, so an API key is simpler for scheduled runs.

## Actor input object example

```json
{
  "queries": [
    "web scraping tutorial"
  ],
  "maxResultsPerQuery": 50,
  "sortBy": "relevance",
  "duration": "any",
  "creativeCommonsOnly": false,
  "captionsOnly": false,
  "maxTrendingPerRegion": 50,
  "monitor": false
}
```

# Actor output Schema

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

No description

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

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "web scraping tutorial"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cybermax/youtube-search-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 = { "queries": ["web scraping tutorial"] }

# Run the Actor and wait for it to finish
run = client.actor("cybermax/youtube-search-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 '{
  "queries": [
    "web scraping tutorial"
  ]
}' |
apify call cybermax/youtube-search-scraper --silent --output-dataset

```

## MCP server setup

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