# YouTube Search Scraper - Videos & Shorts by Keyword (`renzomacar/youtube-search-scraper`) Actor

Search YouTube by keyword and get videos and Shorts in YouTube's order: views, duration, channel, publish date, plus optional likes, comments and description. Filter by upload date, length and type. No API key, no quota.

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

## Pricing

$1.00 / 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

## YouTube Search Scraper - Videos & Shorts by Keyword

Type a keyword, get the YouTube search results as clean rows: every video and Short in the order YouTube shows them, with views as a number, length in seconds, channel, publish date and thumbnail. Turn on one switch to add likes, comment count, exact publish date, full description and channel subscribers.

No YouTube API key, no daily quota, no login.

### What you can do with it

- **Keyword and niche research**: see which videos rank for a term, how many views they have and how old they are.
- **Find creators**: every row carries the channel name, ID and URL; with details on, the subscriber count too.
- **Track rankings**: run the same terms on a schedule and compare `position` over time.
- **Feed AI agents and LLM pipelines**: flat JSON, one row per result, ready for a prompt or a vector store.
- **Trend monitoring**: limit a search to the last hour, day, week or month and sort by views.

### Input

| Field | What it does |
| --- | --- |
| **Search terms** | One search per line, as you would type it on YouTube. Each term is searched separately. |
| **Results per search term** | 1 to 1,000. YouTube itself usually runs out after a few hundred results for one term. |
| **What to return** | Videos and Shorts, videos only, or Shorts only. |
| **Uploaded in the last** | Hour, day, week, month or year. |
| **Length** | Under 4 minutes, 4 to 20 minutes, over 20 minutes. |
| **Order** | Relevance (YouTube's default), most viewed, or best rated. |
| **Add likes, exact date and description** | Opens each result for the exact figures. Same price per result; the run takes longer. |
| **Country / Language** | Results as YouTube shows them in that country. |

```json
{
    "queries": ["home workout", "air fryer recipes"],
    "maxResults": 100,
    "type": "videos",
    "uploadDate": "month",
    "sortBy": "views",
    "includeDetails": true
}
```

### Output

One row per result. This is a real row, with details on:

```json
{
    "query": "home workout",
    "position": 2,
    "type": "video",
    "videoId": "fcN37TxBE_s",
    "url": "https://www.youtube.com/watch?v=fcN37TxBE_s",
    "title": "Fat Burning Cardio Workout - 37 Minute Fitness Blender Cardio Workout at Home",
    "channelName": "FitnessBlender",
    "channelId": "UCiP6wD_tYlYLYh3agzbByWQ",
    "channelUrl": "https://www.youtube.com/@fitnessblender",
    "channelVerified": true,
    "views": 76114819,
    "viewsText": "76,114,819 views",
    "publishedText": "13 years ago",
    "publishedAtApprox": "2013-11-16",
    "duration": "37:10",
    "durationSeconds": 2230,
    "isLive": false,
    "watchingNow": null,
    "descriptionSnippet": "Calorie Burn and full info for this bodyweight cardio workout ...",
    "badges": [],
    "thumbnailUrl": "https://i.ytimg.com/vi/fcN37TxBE_s/hq720.jpg",
    "likes": 610361,
    "comments": 2100,
    "publishedAt": "2013-04-26",
    "description": "Calorie Burn and full info for this bodyweight cardio workout ...",
    "hashtags": [],
    "channelSubscribers": 6550000,
    "detailsFound": true,
    "scrapedAt": "2026-11-17T01:54:47.118Z"
}
```

Without details, the row stops at `thumbnailUrl` and the run is much faster: 450 results for three terms took 30 seconds in our test.

### Price

**$1 per 1,000 results.** You pay for the rows you get, nothing for starting a run, and nothing extra for likes, dates and descriptions. A run that returns no results is not charged. Set a maximum cost per run and the Actor stops when it is reached.

### Good to know

- **Dates**: search results only say "3 years ago", so `publishedAtApprox` is an estimate. Turn details on for the exact day in `publishedAt`.
- **Shorts** in search results come without channel, length or date. Turn details on to get the channel, likes and exact date for each Short.
- **Shorts only**: YouTube surfaces a limited number of Shorts per term, sometimes only a dozen. You get all it gives; you are charged only for those.
- **Newest first**: YouTube no longer offers an order by upload date. Use "Uploaded in the last hour / day / week" instead.
- **Likes and comments** are `null` when the uploader hid them or turned comments off. Comment counts above 1,000 are rounded by YouTube (for example 2,100).
- **Live streams** have `isLive: true` and the current audience in `watchingNow`.
- The run summary (search terms, results per term, filters used) is saved under the key `SUMMARY` in the run's key-value store.

### FAQ

**Do I need a YouTube Data API key?** No. The Actor reads the public search results, so there is no key and no 10,000-unit daily quota.

**How many results can I get for one keyword?** As many as YouTube returns for that search, usually a few hundred. For more coverage, add related terms: each one is searched separately and the `query` field tells you which term a row came from.

**Can I run it from Python, n8n, Make or an AI agent?** Yes. It works through the Apify API, the Apify clients for Python and JavaScript, the integrations for n8n, Make and Zapier, and the Apify MCP server for Claude, ChatGPT and other agents.

**Is it legal?** The Actor only reads publicly visible search results and does not log in. You are responsible for how you use the data.

# Actor input Schema

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

One search per line, exactly as you would type it on YouTube. Each term is searched separately.

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

How many results to return for each term. YouTube itself usually stops giving results after a few hundred.

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

Videos and Shorts together as YouTube mixes them, or only one kind.

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

Keep only results uploaded within this period.

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

YouTube's own length filter.

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

Relevance is the order YouTube shows by default. For the newest videos, use "Uploaded in the last" instead: YouTube no longer offers an order by date.

## `includeDetails` (type: `boolean`):

Opens each result to add the like count, comment count, exact publish date, full description, hashtags and the channel's subscribers. One extra request per result, so the run takes longer. The price per result is the same.

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

Two-letter country code (US, GB, DE, BR, IN...). Results are the ones YouTube shows to viewers in that country.

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

Language code for YouTube's own labels (en, es, de, pt...). Keep "en" to get dates and counts parsed into numbers.

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

Not needed in normal use. Turn it on only if a run reports that YouTube refused the requests.

## Actor input object example

```json
{
  "queries": [
    "air fryer recipes"
  ],
  "maxResults": 20,
  "type": "all",
  "uploadDate": "any",
  "duration": "any",
  "sortBy": "relevance",
  "includeDetails": false,
  "country": "US",
  "language": "en",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per video or Short, in the order YouTube returned them for each search term.

# 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": [
        "air fryer recipes"
    ],
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("renzomacar/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": ["air fryer recipes"],
    "maxResults": 20,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("renzomacar/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": [
    "air fryer recipes"
  ],
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call renzomacar/youtube-search-scraper --silent --output-dataset

```

## MCP server setup

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