# YouTube Niche Scraper (`cheapget/youtube-niche-scraper`) Actor

Search YouTube by keyword and get video results with related channel details, contact emails, stats, and links in one output. Built for creator research, outreach, and keyword discovery.

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

## Pricing

from $4.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Keyword Finder - Find YouTube Videos by Keyword and Get Channel Details

![Support](https://img.shields.io/badge/Support-24%2F7%20Online-blueviolet) ![Rating](https://img.shields.io/badge/Rating-⭐⭐⭐⭐⭐-yellow) ![Reliability](https://img.shields.io/badge/Reliability-99.9%25-28a745) ![YouTube Keyword Finder](https://apify.com/actor-badge?actor=cheapget/youtube-keyword-finder&fpr=aiagentapi)

> **Find keyword-matched YouTube videos and get the related channel profiles — views, likes, comments, tags, thumbnails, and contact details.**

Search any topic and get a list of keyword-matched YouTube videos with the related channel profile: channel name, subscriber count, total views, contact emails from the description, social links, channel tags, country, join date, and full details for the matched video.

### 🏆 Key Features

#### 📺 **Complete Channel Profiles**

- **🪪 Channel Identity**: Channel name, unique ID, direct URL, avatar, and banner image for every result.
- **✅ Verification & Handle**: Public handle and verified badge status in a clean channel profile.
- **📊 Audience Numbers**: Subscriber count, total video views, and total video count in one profile.
- **📅 Channel Age**: Exact join date so you can see how long they've been active.
- **🌍 Country**: Country of origin for each channel.

#### 📬 **Contact & Link Info**

- **📧 Email Addresses**: Contact emails found directly in channel descriptions — ready for outreach.
- **🔗 Social Links**: All external URLs from channel links (Instagram, Twitter, websites, etc.).
- **📡 RSS & Channel Details**: Channel RSS URL plus clear channel details in one place.
- **🏷️ Channel Tags**: Full list of tags the creator uses to describe their content.
- **📝 Description**: Complete channel about/description text.

#### 🎯 **Video Details**

- **🖼️ Video Snapshot**: The matched video's title, description, thumbnail, and publish timestamp.
- **📈 Engagement Stats**: Views, likes, dislikes, and comment counts when available from YouTube.
- **🏷️ Video Classification**: Categories and tags for the specific keyword-matched video.
- **📐 Technical Details**: Duration, width, height, FPS, and audio track fields when yt-dlp exposes them.

### 💰 Pricing

Pricing is usage-based. Each matched video result costs **$0.0085**.

There is no separate charge for the related channel profile details.

### 🎯 Use Cases

#### Find Creators in Your Niche

Search any topic and get a list of YouTube channels that match — see their subscribers, views, and content focus.

#### Get Contact Info for Outreach

Find business emails and social links from channel descriptions so you can reach out to creators directly.

#### Compare Channels Side by Side

Look up multiple channels to compare subscriber counts, view totals, and matched-video details.

#### Build a Creator List

Search by keyword and save matched videos with channel profiles, contact info, social links, and audience numbers.

#### Check Any Channel's Stats

Look up any YouTube channel to see subscribers, total views, video count, tags, and join date.

### 🌟 Why Choose This Actor

**Built for anyone who wants to study keyword-matched YouTube videos fast**, this tool searches by keyword and returns matched videos with full channel profiles and contact info — no YouTube account needed.

| Feature           | YouTube Keyword Finder | Manual Browsing   | YouTube Data API   |
| :---------------- | :--------------------- | :---------------- | :----------------- |
| **Pricing Model** | ✅ **Pay per use**     | ❌ Time-consuming | ❌ Quota limits    |
| **Email Finder**  | ✅ **Included**        | ❌ Manual only    | ❌ Not available   |
| **Social Links**  | ✅ **Included**        | ❌ Manual only    | ❌ Not available   |
| **Setup Time**    | ✅ **Instant**         | ❌ N/A            | ❌ API key + quota |
| **Export**        | ✅ **JSON/CSV**        | ❌ Copy-paste     | ⚠️ Custom code     |

### 🚀 Quick Start

1. **Enter a search keyword** — type any topic like "cooking", "gaming", or "marketing"
2. **Click Start** — hit the **▷ Start** button and wait for results
3. **Download your data** — save matched-video results as JSON, CSV, or Excel

### 💻 Input Parameters

| Parameter     | Type    | Required | Description                                                            |
| ------------- | ------- | -------- | ---------------------------------------------------------------------- |
| `keyword`     | string  | ✅ Yes   | Keyword to search YouTube and find matched videos with channel details |
| `sort_by`     | string  | ✅ Yes   | Choose one sort mode: relevance, view_count, rating, or upload_date    |
| `max_results` | integer | ✅ Yes   | Maximum number of matched videos to return                             |

#### 📝 Example Input

```json
{
  "keyword": "marketing",
  "max_results": 100,
  "sort_by": "relevance"
}
````

**Search term examples:**

- Topic keywords: `marketing`, `cooking`, `gaming`, `fitness`
- Niche terms: `vegan recipes`, `Python tutorials`, `travel vlogs`
- Industry terms: `digital marketing`, `software development`

### 📤 Output Structure

| Field                    | Type    | Description                                                    |
| ------------------------ | ------- | -------------------------------------------------------------- |
| `processor`              | string  | URL of the Apify actor that processed this data                |
| `processed_at`           | string  | When the profile was looked up (ISO 8601 format)               |
| `video_url`              | string  | The keyword-matched YouTube video URL that led to this channel |
| `video_id`               | string  | Unique YouTube ID of the keyword-matched video                 |
| `video_title`            | string  | Title of the keyword-matched video                             |
| `video_description`      | string  | Full description of the keyword-matched video                  |
| `video_thumbnail_url`    | string  | Thumbnail URL of the keyword-matched video                     |
| `video_duration_seconds` | integer | Duration of the keyword-matched video in seconds               |
| `video_published_at`     | string  | Publish timestamp of the keyword-matched video                 |
| `video_categories`       | array   | Categories assigned to the keyword-matched video               |
| `video_tags`             | array   | Tags associated with the keyword-matched video                 |
| `video_view_count`       | integer | View count of the keyword-matched video                        |
| `video_like_count`       | integer | Like count of the keyword-matched video when available         |
| `video_dislike_count`    | integer | Dislike count of the keyword-matched video when available      |
| `video_comment_count`    | integer | Comment count of the keyword-matched video when available      |
| `video_width`            | integer | Video width in pixels when available                           |
| `video_height`           | integer | Video height in pixels when available                          |
| `video_fps`              | number  | Video frame rate when available                                |
| `video_audio_title`      | string  | Audio track title when available                               |
| `video_audio_artist`     | string  | Audio track artist when available                              |
| `channel_id`             | string  | Unique YouTube channel ID                                      |
| `channel_name`           | string  | Display name of the YouTube channel                            |
| `channel_handle`         | string  | Public YouTube handle such as `@channelname`                   |
| `channel_url`            | string  | Direct URL to the YouTube channel                              |
| `channel_joined_date`    | string  | Date when the channel was created                              |
| `channel_country`        | string  | Country shown on the channel about page                        |
| `channel_description`    | string  | Full channel description/about text                            |
| `channel_tags`           | array   | Tags and keywords for the channel                              |
| `channel_links`          | array   | Social and website links with title and domain info            |
| `contact_emails`         | array   | Contact emails found in the channel description                |
| `channel_avatar_url`     | string  | URL to the channel's profile picture                           |
| `channel_banner_url`     | string  | URL to the channel's banner image                              |
| `channel_is_verified`    | boolean | Whether the channel shows a verified badge                     |
| `channel_rss_url`        | string  | YouTube RSS URL for the channel                                |
| `subscriber_count`       | integer | Number of channel subscribers                                  |
| `channel_view_count`     | integer | Total channel view count                                       |
| `channel_video_count`    | integer | Total number of videos on the channel                          |

#### 📤 Example Output

```json
{
  "processor": "https://apify.com/cheapget/youtube-keyword-finder?fpr=aiagentapi",
  "processed_at": "2026-01-01T08:42:33+00:00",
  "video_url": "https://www.youtube.com/watch?v=abc123",
  "video_id": "abc123",
  "video_title": "How I Grew My Marketing Channel to 100K Subscribers",
  "video_description": "A full breakdown of the content system, SEO workflow, and publishing cadence behind the channel.",
  "video_thumbnail_url": "https://i.ytimg.com/vi/abc123/maxresdefault.jpg",
  "video_duration_seconds": 742,
  "video_published_at": "2025-12-20T14:30:00+00:00",
  "video_categories": ["Education", "Howto & Style"],
  "video_tags": ["youtube marketing", "seo", "channel growth"],
  "video_view_count": 845000,
  "video_like_count": 34200,
  "video_dislike_count": null,
  "video_comment_count": 1840,
  "video_width": 1920,
  "video_height": 1080,
  "video_fps": 30,
  "video_audio_title": null,
  "video_audio_artist": null,
  "channel_id": "UCX6OQ3DkcsbYNE6H8uQQuVA",
  "channel_name": "Marketing With Alex",
  "channel_handle": "@MarketingWithAlex",
  "channel_url": "https://www.youtube.com/@MarketingWithAlex",
  "channel_joined_date": "2018-04-15",
  "channel_country": "United States",
  "channel_description": "Weekly videos on digital marketing, SEO, and growth strategies.",
  "channel_tags": ["marketing", "seo", "digital marketing", "growth"],
  "channel_links": [
    {
      "title": "Instagram",
      "url": "https://instagram.com/marketingwithalex",
      "domain": "instagram.com"
    },
    {
      "title": "Website",
      "url": "https://marketingwithalex.com",
      "domain": "marketingwithalex.com"
    }
  ],
  "contact_emails": ["contact@marketingwithalex.com"],
  "channel_avatar_url": "https://yt3.ggpht.com/example-avatar.jpg",
  "channel_banner_url": "https://yt3.ggpht.com/example-banner.jpg",
  "channel_is_verified": true,
  "channel_rss_url": "https://www.youtube.com/feeds/videos.xml?channel_id=UCX6OQ3DkcsbYNE6H8uQQuVA",
  "subscriber_count": 125000,
  "channel_view_count": 8500000,
  "channel_video_count": 312
}
```

### 🔌 Integrations

Connect this tool to your favorite apps via the Apify platform.

#### 🐍 Python SDK

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_API_TOKEN")

run_input = {'keyword': 'marketing', 'max_results': 100}

run = client.actor("cheapget/youtube-keyword-finder").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### 🟨 JavaScript / Node.js SDK

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

const client = new ApifyClient({ token: "YOUR_APIFY_API_TOKEN" });

const run = await client.actor("cheapget/youtube-keyword-finder").call({
  runInput: {
    keyword: "marketing",
    max_results: 100,
  },
});

for await (const item of client.dataset(run.defaultDatasetId).iterateItems()) {
  console.log(item);
}
```

#### 🌐 REST API (curl)

```bash
curl -X POST "https://api.apify.com/v2/acts/cheapget~youtube-keyword-finder/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"keyword": "marketing", "max_results": 100}'
```

#### Ⓜ️ Make.com Integration

**[Get Started with Make.com (1000 Free Credits)](https://www.make.com/en/register?pc=marketingme)** 🎁

```text
Step 1: Add the Make.com module "Run an Actor"
Step 2: Enable mapping and paste Actor ID `cheapget/youtube-keyword-finder`
Step 3: Paste the input JSON and run synchronously
Step 4: Add "Get Dataset Items" with `defaultDatasetId`
```

#### 🎱 N8N.io Integration

**[Open Source Workflow Automation](https://n8n.io/)** ⚡

```text
Step 1: Add the Apify node "Run an Actor and get dataset"
Step 2: Set Selection Mode to By ID
Step 3: Paste Actor ID `cheapget/youtube-keyword-finder`
Step 4: Add your input JSON and read items from `defaultDatasetId`
```

#### 📚 More Info

- **[Python Docs](https://apify.com/cheapget/youtube-keyword-finder/api/python?fpr=aiagentapi)** - Complete Python client guide with examples
- **[JavaScript Docs](https://apify.com/cheapget/youtube-keyword-finder/api/javascript?fpr=aiagentapi)** - Node.js and browser guide

#### 🏗️ JSON-LD

```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "YouTube Keyword Finder - Apify Actor",
  "applicationCategory": "UtilitiesApplication",
  "applicationSubCategory": "YouTube Channel Lookup Tool",
  "operatingSystem": "Cloud",
  "offers": {
    "@type": "Offer",
    "price": "0.0085",
    "priceCurrency": "USD",
    "priceValidUntil": "2099-12-31",
    "availability": "https://schema.org/InStock"
  },
  "description": "Find keyword-matched YouTube videos and get the related channel profiles, video details, and contact info.",
  "featureList": [
    "Complete Channel Profiles",
    "Contact & Link Info",
    "Video Details"
  ],
  "keywords": "youtube keyword finder, youtube keyword lookup, youtube video finder, youtube keyword search",
  "author": {
    "@type": "Organization",
    "name": "cheapget",
    "url": "https://apify.com/cheapget?fpr=aiagentapi"
  },
  "softwareVersion": "1.0.0",
  "datePublished": "2024-01-01",
  "dateModified": "2026-04-16"
}
```

### 🚀 Performance Tips

Get the best results from your YouTuber searches with these tips:

#### 💰 Cost Optimization

- **Start Small**: Test with `max_results: 10` before running larger searches
- **Monitor Usage**: Check the Apify Console usage tab for real-time cost tracking
- **Target Better Keywords**: Narrower queries reduce irrelevant channels and wasted runs

#### ⚡ Speed Optimization

- **Start Smaller**: Smaller runs finish much faster and are easier to review
- **Specific Keywords**: Targeted search terms return more relevant channels with less processing
- **Reasonable Sizes**: Keep searches under 500 channels for stable performance

#### 🛡️ Data Quality Tips

- **Focused Keywords**: More specific search terms produce more relevant creator matches
- **Email Availability**: Not all creators list contact emails — this is normal
- **Social Links**: Link availability depends on what each creator has added to their channel

#### 📊 Best Practices

- **Test First**: Start with a small search to see what data is returned for your keyword
- **Save Results**: Download your data right after the run finishes for safekeeping
- **Use Filters**: Combine results with keyword filters to narrow down the best matches

### ❓ FAQ

#### How are results found?

Results are discovered by searching YouTube for the given keyword and keeping unique matched videos from the search results. The same channel can appear more than once when different videos match.

#### Is this free?

No. Each matched video result costs **$0.0085**, and there is no separate charge for the related channel profile details.

#### Can I get emails for every channel?

No — emails are found only if the creator has listed them in their channel description. Many creators do not publish contact info publicly.

#### What's the difference between `subscriber_count` and `channel_view_count`?

`subscriber_count` is the number of subscribers. `channel_view_count` is the cumulative total views across all the channel's videos.

#### How long does it take?

- 10 results: usually under 1 minute
- 100 results: typically 5–15 minutes
- Large runs take longer because more matched videos must be processed

#### Do large runs significantly increase cost?

Yes. Cost scales with the number of matched video results returned. More results mean higher total cost because each result costs **$0.0085**.

#### What output formats are available?

Results come in JSON format by default. You can also download as CSV or Excel using Apify's built-in export features.

### 🏷️ SEO Keywords

**🔍 Primary Keywords:** youtube keyword finder, youtube keyword lookup, youtube video finder, youtube keyword search, youtube creator search

**📝 Long-Tail Keywords:** find youtube channels by keyword, get youtuber contact email free, check youtube channel subscribers, look up youtube channel stats, find youtuber social media links

**🏢 Industry Keywords:** youtube channel finder, youtuber contact info, youtube creator profile, youtube channel search tool, youtuber email finder

**🌍 Location Keywords:** youtube channels united states, youtuber search uk, youtube creators worldwide, youtube channels india, youtuber any country, youtube creator search global

**💡 Use Case Keywords:** find youtubers in my niche, get youtuber email for outreach, check youtube channel stats, compare youtube channels, search youtube creators by topic

### ⚖️ Legal & Compliance

This tool accesses **publicly available data only**. It does not bypass authentication, access private content, or violate platform terms of service. You are responsible for:

- **Data Rights**: Making sure you have permission to use the data you collect
- **Privacy Compliance**: Following GDPR, CCPA, and other applicable privacy laws when handling personal data
- **Platform Terms**: Respecting YouTube's terms of service and usage policies
- **Ethical Use**: Using the results responsibly and in compliance with applicable laws

Need help or have compliance questions? [Contact us](https://t.me/AiAgentApi).

### 🔗 Related Actors

**💼 Jobs**

- [Best Job Search](https://apify.com/cheapget/best-job-search?fpr=aiagentapi) - Find jobs on LinkedIn, Indeed, and Glassdoor — fast and cheap, with salary info
- [Glassdoor Job Search](https://apify.com/cheapget/glassdoor-job-search?fpr=aiagentapi) - Search Glassdoor jobs with salary ranges, company ratings, and reviews
- [Indeed Job Search](https://apify.com/cheapget/indeed-job-search?fpr=aiagentapi) - Find Indeed jobs with salaries, company details, and apply links
- [LinkedIn Job Search](https://apify.com/cheapget/linkedin-job-search?fpr=aiagentapi) - Search LinkedIn jobs with applicant counts, company info, and seniority levels

**🎬 Videos**

- [Best Video Downloader](https://apify.com/cheapget/best-video-downloader?fpr=aiagentapi) - Download videos from 1000+ sites with quality options and thumbnails
- [TikTok Video Downloader](https://apify.com/cheapget/tiktok-video-downloader?fpr=aiagentapi) - Save TikTok videos without watermarks plus audio, comments, and hashtags
- [YouTube Video Downloader](https://apify.com/cheapget/youtube-video-downloader?fpr=aiagentapi) - Download YouTube videos in multiple qualities with comments and details
- [Video Subtitles Downloader](https://apify.com/cheapget/video-subtitles-downloader?fpr=aiagentapi) - Get subtitles from any video URL as downloadable text files
- [TikTok Live Recorder](https://apify.com/cheapget/tiktok-live-recorder?fpr=aiagentapi) - Record TikTok live streams with chat, gifts, and viewer stats
- [TikTok Video Profile](https://apify.com/cheapget/tiktok-video-profile?fpr=aiagentapi) - Look up TikTok videos with captions, hashtags, engagement stats, and comments
- [YouTube Keyword Finder](https://apify.com/cheapget/youtube-keyword-finder?fpr=aiagentapi) - Find YouTube videos by keyword and get channel details, contact info, and video details
- [Video To Text](https://apify.com/cheapget/video-to-text?fpr=aiagentapi) - Turn any video or audio into text with timestamps and language detection
- [Instagram To Text](https://apify.com/cheapget/instagram-to-text?fpr=aiagentapi) - Turn Instagram video content into searchable text transcripts

**📱 Social Media**

- [Social Media Marketing](https://apify.com/cheapget/social-media-marketing?fpr=aiagentapi) - Generate ready-to-post marketing content from any source with multiple tones
- [Find Any Company On LinkedIn](https://apify.com/cheapget/find-any-company-on-linkedin?fpr=aiagentapi) - Look up any company on LinkedIn — employees, locations, and company details
- [Find Anyone On LinkedIn](https://apify.com/cheapget/find-anyone-on-linkedin?fpr=aiagentapi) - Find anyone on LinkedIn — work history, skills, education, and contact info
- [X Community Profile](https://apify.com/cheapget/x-community-profile?fpr=aiagentapi) - Check any X Community's description, members, creator info, and activity
- [X User Profile](https://apify.com/cheapget/x-user-profile?fpr=aiagentapi) - Look up any X user's verification, followers, pinned tweets, and account details

**🔴 Reddit**

- [Reddit User Profile](https://apify.com/cheapget/reddit-user-profile?fpr=aiagentapi) - Look up any Reddit user's karma, trophies, activity, and account info
- [Reddit Community Profile](https://apify.com/cheapget/reddit-community-profile?fpr=aiagentapi) - Check any subreddit's rules, wiki, pinned posts, and community details
- [Reddit Community Post](https://apify.com/cheapget/reddit-community-post?fpr=aiagentapi) - Browse subreddit posts with comments, votes, authors, and engagement stats
- [Reddit Post Search](https://apify.com/cheapget/reddit-post-search?fpr=aiagentapi) - Search Reddit posts by keyword and get results with comments and votes
- [Reddit Community User](https://apify.com/cheapget/reddit-community-user?fpr=aiagentapi) - Find active users in any subreddit with karma, trophies, and profile info

**💬 Telegram**

- [Telegram Group Member](https://apify.com/cheapget/telegram-group-member?fpr=aiagentapi) - Find members in any public Telegram group with profile details
- [Telegram Channel Message](https://apify.com/cheapget/telegram-channel-message?fpr=aiagentapi) - Get messages from any Telegram channel with views, replies, and reactions
- [Telegram Profile](https://apify.com/cheapget/telegram-profile?fpr=aiagentapi) - Look up any Telegram user, group, bot, or channel profile

**📍 Local & Real Estate**

- [Google Business Profile](https://apify.com/cheapget/google-business-profile?fpr=aiagentapi) - Find local businesses on Google with reviews, ratings, photos, and contact info
- [Zillow Real Estate](https://apify.com/cheapget/zillow-real-estate?fpr=aiagentapi) - Search Zillow listings with prices, photos, valuations, and property details
- [US Real Estate](https://apify.com/cheapget/us-real-estate?fpr=aiagentapi) - Find US property listings with prices, specs, agent details, and market info

### 🤝 Support & Community

**📧 Support**: [Contact Us](https://t.me/AiAgentApi) **💬 Community**: [Telegram Group](https://t.me/Apify_Actor)

***

**Last Updated:** April 16, 2026

# Actor input Schema

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

Search YouTube videos by keyword. Each result includes the matched video plus the related channel profile.

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

Choose one YouTube search sort mode.

## `max_results` (type: `integer`):

Maximum number of matched videos to return from search results.

## Actor input object example

```json
{
  "keyword": "marketing",
  "sort_by": "relevance",
  "max_results": 1
}
```

# Actor output Schema

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

Keyword-matched YouTube video results with full channel details, contact info, and social links

# 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 = {
    "keyword": "marketing",
    "sort_by": "relevance",
    "max_results": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("cheapget/youtube-niche-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 = {
    "keyword": "marketing",
    "sort_by": "relevance",
    "max_results": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("cheapget/youtube-niche-scraper").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 '{
  "keyword": "marketing",
  "sort_by": "relevance",
  "max_results": 1
}' |
apify call cheapget/youtube-niche-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Niche Scraper",
        "description": "Search YouTube by keyword and get video results with related channel details, contact emails, stats, and links in one output. Built for creator research, outreach, and keyword discovery.",
        "version": "0.0",
        "x-build-id": "CfoyEuVqmuEOHLrIZ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/cheapget~youtube-niche-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-cheapget-youtube-niche-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/cheapget~youtube-niche-scraper/runs": {
            "post": {
                "operationId": "runs-sync-cheapget-youtube-niche-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/cheapget~youtube-niche-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-cheapget-youtube-niche-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "max_results",
                    "sort_by",
                    "keyword"
                ],
                "properties": {
                    "keyword": {
                        "title": "Keyword",
                        "type": "string",
                        "description": "Search YouTube videos by keyword. Each result includes the matched video plus the related channel profile."
                    },
                    "sort_by": {
                        "title": "Sort By",
                        "enum": [
                            "relevance",
                            "view_count",
                            "rating",
                            "upload_date"
                        ],
                        "type": "string",
                        "description": "Choose one YouTube search sort mode."
                    },
                    "max_results": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of matched videos to return from search results."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
