# YouTube Search Scraper (`icoe-man/youtube-search-scraper`) Actor

A youtube search scraper: search YouTube by keyword, search inside one channel, or collect search suggestions, with titles, channels, view counts and dates. Export JSON, CSV or Excel.

- **URL**: https://apify.com/icoe-man/youtube-search-scraper.md
- **Developed by:** [Icoe Man](https://apify.com/icoe-man) (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

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.
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 Search Scraper

Download public YouTube search results in a table for side-by-side comparisons or use in other tools. Pick a mode under What to collect and enter a keyword to find videos and Shorts across YouTube, search within one channel, or collect search suggestions. Each video result includes its link, title, channel, view count, and upload date.

### What you get

Under **What to collect**, choose the type of results you want. Fill in the fields for that choice, then start the run. Each run returns one kind of result. The Actor ignores fields from other modes. Choose **Live** under **Data freshness** to collect fresh data on every run.

### Collection modes

#### Search videos

Search public YouTube videos and Shorts by keyword, filter by upload date, type, length, or country, and include matching channels if you need them. In `search-videos` mode, fill in **Keywords** (up to 100 entries), and **Uploaded** (optional), **Videos or Shorts** (optional), **Long videos only** (optional), **Country** (optional), **Add likes, comments and descriptions** (optional), **Also return channels** (optional). Use **Result limit per target** to set how many posts the Actor can collect per entry. The default is 100 and the highest setting is 1000. Each post appears in its own row and counts as one **Search videos** charge.

Example result for one post:

```json
{
  "status": "ok",
  "type": "post",
  "platform": "youtube",
  "id": "LHUvedAssyE",
  "url": "https://www.youtube.com/watch?v=LHUvedAssyE",
  "author": {
    "id": "UCLA_DiR1FfKNvjuUpBHmylQ",
    "username": "NASA",
    "displayName": "NASA"
  },
  "text": "A short example sentence about a space mission, shown for illustration.",
  "createdAt": "2026-11-09T17:08:54Z",
  "metrics": {
    "likes": null,
    "comments": null,
    "views": 60193
  },
  "hashtags": [],
  "mentions": [],
  "media": [
    {
      "kind": "video",
      "url": "https://www.youtube.com/watch?v=LHUvedAssyE",
      "thumbnailUrl": "https://i.ytimg.com/vi/LHUvedAssyE/hqdefault.jpg",
      "durationSec": 87
    }
  ],
  "details": {
    "youtube": {
      "kind": "video",
      "title": "An example video title for illustration",
      "durationSec": 87,
      "genre": null,
      "timeApproximate": true,
      "channelSubscribers": null
    }
  },
  "collectedAt": "2026-11-14T12:00:00Z",
  "input": {
    "keyword": "nasa artemis",
    "maxItems": 20
  }
}
```

#### Channel search

Search one YouTube channel by keyword for public videos, Shorts, and live streams, with the option to include matching playlists. In `channel-search` mode, fill in **Keywords** (up to 100 entries), and **Channel**, **Also return playlists** (optional). Use **Result limit per target** to set how many posts the Actor can collect per entry. The default is 100 and the highest setting is 1000. Each post appears in its own row and counts as one **Channel search** charge.

Example result for one post:

```json
{
  "status": "ok",
  "type": "post",
  "platform": "youtube",
  "id": "LHUvedAssyE",
  "url": "https://www.youtube.com/watch?v=LHUvedAssyE",
  "author": {
    "id": "UCLA_DiR1FfKNvjuUpBHmylQ",
    "username": "NASA",
    "displayName": "NASA"
  },
  "text": "A short example sentence about a space mission, shown for illustration.",
  "createdAt": "2026-11-09T17:08:54Z",
  "metrics": {
    "views": 60193
  },
  "hashtags": [],
  "mentions": [],
  "media": [
    {
      "kind": "video",
      "url": "https://www.youtube.com/watch?v=LHUvedAssyE",
      "thumbnailUrl": "https://i.ytimg.com/vi/LHUvedAssyE/hqdefault.jpg",
      "durationSec": 87
    }
  ],
  "details": {
    "youtube": {
      "kind": "video",
      "title": "An example video title for illustration",
      "durationSec": 87,
      "timeApproximate": true,
      "videoCount": null
    }
  },
  "collectedAt": "2026-11-14T12:00:00Z",
  "input": {
    "channel": "@NASA",
    "keyword": "nasa artemis",
    "maxItems": 20
  }
}
```

#### Search suggestions

Enter a word to collect the search terms YouTube suggests as you type it. In `search-suggestions` mode, fill in **Keywords** (up to 100 entries). Use **Result limit per target** to set how many keywords the Actor can collect per entry. The default is 20 and the highest setting is 100. Each keyword appears in its own row and counts as one **Search suggestions** charge.

Example result for one keyword:

```json
{
  "status": "ok",
  "type": "keyword",
  "platform": "youtube",
  "id": "nasa artemis",
  "text": "nasa artemis",
  "details": {
    "youtube": {
      "kind": "query",
      "channelId": null,
      "handle": null
    }
  },
  "collectedAt": "2026-11-14T12:00:00Z",
  "input": {
    "keyword": "nasa artemis",
    "maxItems": 20
  }
}
```

### Ways to use the data

- Topic research: See which videos YouTube shows when you search for a topic you're studying.
- Channel research: Find a channel's videos on a topic without scrolling through every upload.
- Keyword research: Use YouTube's suggestions to find related phrases for your search term.
- Content ideas: See which takes on a topic get views by comparing video titles and view counts.

### What to enter

| Field key | Name on the form | What to enter |
| --- | --- | --- |
| `mode` | What to collect | Choose one type of result per run, then fill in the fields for that choice. |
| `keywords` | Keywords | Enter a search term such as nasa artemis. Channel search looks for the term in one channel. Search suggestions shows how YouTube would complete it. |
| `uploadedWithin` | Uploaded | Choose today or week to get uploads from today or this week. Leave blank to include any upload date. |
| `contentType` | Videos or Shorts | Choose videos for videos only or shorts for Shorts only. Leave blank to get both. Don't choose shorts with Long videos only. |
| `longOnly` | Long videos only | Turn this on to keep only videos longer than 20 minutes. You can't use it if you choose shorts in Videos or Shorts. |
| `country` | Country | Enter a two-letter country code like GB to see the results YouTube shows viewers there. Leave blank to use the default. |
| `includeExtras` | Add likes, comments and descriptions | Adds like and comment counts, descriptions, and exact upload times when YouTube provides them. The run takes longer. If these details aren't available for a result, you still get the row with those fields blank. |
| `includeChannels` | Also return channels | Include channels that match your search. Each counts as one result, with its name, @handle, description, and subscriber count in its own row. |
| `channel` | Channel | Enter the channel's @handle, such as @NASA. |
| `includePlaylists` | Also return playlists | Include playlists from this channel that match your search. Each counts as one result, with its title and video count in its own row. |
| `maxItems` | Result limit per target | Set the most results to collect from each target, up to the mode's maximum. Leave this blank to use the mode's default limit. |
| `freshness` | Data freshness | Standard can return results faster when recently collected data is available. Choose Live to collect fresh data on every run. |

Example input:

```json
{
  "mode": "search-videos",
  "keywords": [
    "nasa artemis"
  ],
  "maxItems": 20,
  "freshness": "standard"
}
```

### Your results

Each mode has its own view of the results table. See **Collection modes** for what each mode returns.

Every row has a `status` field. For each entry that fails, the Actor returns one row with `status: "error"`. The `error` field has a `code` and a `message`. If a required field for your mode is blank, the run returns one error row and collects no data.

### Pricing

You pay per result. Prices for each Apify plan are in USD per 1,000 results.

| What you pay for | Free | Bronze | Silver | Gold | Platinum | Diamond |
| --- | --- | --- | --- | --- | --- | --- |
| Channel search | $3.105 | $2.250 | $1.912 | $1.650 | $1.650 | $1.650 |
| Search suggestions | $3.105 | $2.250 | $1.912 | $1.650 | $1.650 | $1.650 |
| Search videos | $3.105 | $2.250 | $1.912 | $1.650 | $1.650 | $1.650 |

You don't pay for errors or empty results. The run stops when it reaches your spending limit.

On the free plan, you can collect up to 100 results per run and make up to 20 runs per day.

### Common questions

#### What do I get with each search mode?

Search videos finds videos and Shorts across YouTube by keyword. Turn on Also return channels to include matching channels. Channel search looks for videos, Shorts, and live streams in one channel. Turn on Also return playlists to include its matching playlists. Search suggestions gives you the terms YouTube suggests as you start typing a word.

#### Which filters can I use in Search videos?

Use Uploaded for today's or this week's uploads and Videos or Shorts to pick a type. Set Country to see what YouTube shows viewers there. Long videos only keeps videos over 20 minutes and can't be used with shorts. Add likes, comments and descriptions also gives you exact upload times when available. It makes the run take longer, and some rows may still be missing those extra details.

#### What do I enter in Channel for Channel search?

In Channel, enter the channel's @handle, such as @NASA. Links and channel IDs won't work.

#### Are the upload dates exact?

If YouTube shows "2 weeks ago" or a similar label instead of a date, the upload date is approximate. Turn on "Add likes, comments and descriptions" to get the exact upload time when YouTube provides it.

#### Do I need a YouTube account to run this?

No. The Actor only collects public information, so you don't need to sign in to YouTube or share browser cookies.

#### How do I limit the number of results, and what do I pay for?

Set Result limit per target to cap the number of results for each search term. You pay only for results you get, so errors and empty results don't count. The run stops at your spending limit.

#### Is this Actor affiliated with YouTube?

No. This independent tool has no affiliation with, endorsement from, or sponsorship by YouTube or Google. It collects only public information from YouTube.

### Disclaimer

This Actor is not affiliated with, endorsed by, or sponsored by YouTube. All trademarks belong to their owners.

# Actor input Schema

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

Choose one type of result per run, then fill in the fields for that choice.

## `keywords` (type: `array`):

Enter a search term such as nasa artemis. Channel search looks for the term in one channel. Search suggestions shows how YouTube would complete it.

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

Choose today or week to get uploads from today or this week. Leave blank to include any upload date.

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

Choose videos for videos only or shorts for Shorts only. Leave blank to get both. Don't choose shorts with Long videos only.

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

Turn this on to keep only videos longer than 20 minutes. You can't use it if you choose shorts in Videos or Shorts.

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

Enter a two-letter country code like GB to see the results YouTube shows viewers there. Leave blank to use the default.

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

Adds like and comment counts, descriptions, and exact upload times when YouTube provides them. The run takes longer. If these details aren't available for a result, you still get the row with those fields blank.

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

Include channels that match your search. Each counts as one result, with its name, @handle, description, and subscriber count in its own row.

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

Enter the channel's @handle, such as @NASA.

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

Include playlists from this channel that match your search. Each counts as one result, with its title and video count in its own row.

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

Set the most results to collect from each target, up to the mode's maximum. Leave this blank to use the mode's default limit.

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

Standard can return results faster when recently collected data is available. Choose Live to collect fresh data on every run.

## Actor input object example

```json
{
  "mode": "search-videos",
  "keywords": [
    "nasa artemis"
  ],
  "channel": "@NASA",
  "maxItems": 20,
  "freshness": "standard"
}
```

# Actor output Schema

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

See everything this run collected in one table.

# 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 = {
    "mode": "search-videos",
    "keywords": [
        "nasa artemis"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("icoe-man/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 = {
    "mode": "search-videos",
    "keywords": ["nasa artemis"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("icoe-man/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 '{
  "mode": "search-videos",
  "keywords": [
    "nasa artemis"
  ],
  "maxItems": 20
}' |
apify call icoe-man/youtube-search-scraper --silent --output-dataset

```

## MCP server setup

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