# YouTube Search & Channel Data Scraper (`dev00/youtube-search-channel-api`) Actor

Scrape YouTube video searches (with nextPage pagination support) and extract rich channel details, banners, and playlists.

- **URL**: https://apify.com/dev00/youtube-search-channel-api.md
- **Developed by:** [dev00](https://apify.com/dev00) (community)
- **Categories:** Videos
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 per 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## YouTube Search & Channel Data Scraper

A lightweight, high-performance, and cost-effective Apify Actor to scrape YouTube video search results (with full nextPage pagination support) and extract rich channel details, banners, and playlists.

Accepts channel IDs, custom URLs, and handles (like `@MrBeast`). It flattens all returned data so it displays perfectly in the Apify Overview grid table out of the box.

***

### Features

- 🔍 **YouTube Video Search:** Fetch up to 20 detailed video results per request with uploader details, verification badges, durations, view counts, relative upload times, and short descriptions.
- 🏢 **Channel Profile & Metadata:** Get subscriber counts, verification badge status, avatar/banner links, related channels list, and tabs continuation tokens.
- 🔄 **nextPage Token Support:** Fully paginates search results and channel lists, returning a continuation token in the dataset so you can fetch the next page in subsequent runs.
- 🗂️ **Database-Friendly Flat Mapping:** Automatically transforms nested lists (like channel uploads) into flat rows, making them immediately viewable, downloadable as CSV, or syncable with database tables.

***

### Input Parameters

The actor accepts the following parameters:

| Field | Type | Description |
|---|---|---|
| **mode** | `string` | Scraping mode: Either `search` (Search Videos by Keyword) or `channel` (Get Channel Info). |
| **query** | `string` | The search keyword (Required if mode is `search`). |
| **channelIdOrUrl** | `string` | The YouTube Channel ID, handle (e.g. `@MrBeast`), or full URL (Required if mode is `channel`). |
| **nextPageToken** | `string` | The continuation token returned in the previous run's `nextpage` column (optional). |

***

### Output Examples

#### 1. Search Results Dataset (CSV/JSON Flat Structure)

```json
{
  "type": "search",
  "id": "/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "duration": 213,
  "views": 1787657742,
  "uploaderName": "Rick Astley",
  "uploaderVerified": true,
  "thumbnail": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/maxresdefault.webp",
  "uploaded": "16 years ago",
  "description": "The official video for Never Gonna Give You Up...",
  "nextpage": "eyJjb250ZXh0Ijp7ImNsaWVudCI6ey..."
}
```

#### 2. Raw JSON Payload

The complete raw JSON response returned by the backend is stored in the default Key-Value Store under the key `OUTPUT`.

# Actor input Schema

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

Choose whether you want to search YouTube videos by keyword or extract detailed information for a specific channel.

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

Enter the search keyword to search for videos (Required if Scraping Mode is Search).

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

Enter the YouTube Channel ID (e.g. UC\_x5XG1OV2P6uZZ5FSM9Ttw) or Custom Handle / URL (e.g. @MrBeast) (Required if Scraping Mode is Channel).

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

Enter the optional nextpage token returned from a previous search or channel run to fetch the next set of results.

## Actor input object example

```json
{
  "mode": "search",
  "query": "never gonna give you up",
  "channelIdOrUrl": "UCuAXFkgsw1L7xaCfnd5JJOw"
}
```

# Actor output Schema

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

No description

## `keyValueStoreResult` (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 = {
    "query": "never gonna give you up",
    "channelIdOrUrl": "UCuAXFkgsw1L7xaCfnd5JJOw"
};

// Run the Actor and wait for it to finish
const run = await client.actor("dev00/youtube-search-channel-api").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 = {
    "query": "never gonna give you up",
    "channelIdOrUrl": "UCuAXFkgsw1L7xaCfnd5JJOw",
}

# Run the Actor and wait for it to finish
run = client.actor("dev00/youtube-search-channel-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "never gonna give you up",
  "channelIdOrUrl": "UCuAXFkgsw1L7xaCfnd5JJOw"
}' |
apify call dev00/youtube-search-channel-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dev00/youtube-search-channel-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/zLGULBmu5PxY2vroJ/builds/U7McdxLXBqVrW6zi1/openapi.json
