# YouTube Search & Channel Videos — Fast & Cheap (`librevlad/youtube-search-channel-videos`) Actor

Get YouTube videos by search query or list all videos of a channel via the public innertube API. No login, public videos only, pay per result.

- **URL**: https://apify.com/librevlad/youtube-search-channel-videos.md
- **Developed by:** [Владислав Новік](https://apify.com/librevlad) (community)
- **Categories:** Videos, Social media, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 videos

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/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 & Channel Videos — Fast & Cheap

**Pricing:** $1.00 per 1,000 videos with title, views, duration, date and channel. Error rows are free.

Apify actor that gets YouTube video data in two modes with one input:

1. **Search** — videos for search queries, the same results you see on `youtube.com/results`.
2. **Channels** — the list of videos on a channel's **Videos** tab.

It talks to the same public innertube API the YouTube page itself calls (`youtubei/v1/search`, `youtubei/v1/browse`, `navigation/resolve_url`). No login, no cookies, no captchas — just public data, fast and cheap.

### Who is it for

Lead generation, competitor monitoring, niche research, market analysis — anything where you need lists of videos with titles, view counts, publish dates and durations for many queries or many channels, without paying $4 per 1,000 results.

### Pricing

**$1.00 per 1,000 videos** — you pay the `video` paid event for each video row returned. Error rows and empty results are not charged. For comparison, the most popular YouTube scraper on Apify Store charges around $4 per 1,000 results.

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `searchQueries` | list of strings | `["lofi hip hop"]` | Search queries, one per line. Required — at least this one is prefilled. |
| `channelUrls` | list of strings | empty | Channel URLs (`https://www.youtube.com/@handle`, `/channel/UC...`, `/c/...`, `/user/...`). Optional — leave empty to run search only. |
| `maxResultsPerQuery` | integer (1–500) | `50` | Max videos per search query. |
| `maxVideosPerChannel` | integer (1–1000) | `50` | Max videos per channel (Videos tab). |
| `sortBy` | select | `relevance` | Search sort order: `relevance`, `date` (newest), `views` (most viewed). Applies to search only. |
| `includeShorts` | boolean | `true` | Include Shorts in the results. |
| `maxConcurrency` | integer (1–10) | `3` | How many queries/channels run at the same time. |
| `proxyConfiguration` | proxy editor | Apify datacenter proxy | The default datacenter proxy works well for YouTube and keeps the run cheap. |

### Output example

Each dataset item is one video (`type: "video"`) or an error row (`status: "error"`, not charged):

```json
{
    "type": "video",
    "videoId": "nx32Ue0AAA0",
    "url": "https://www.youtube.com/watch?v=nx32Ue0AAA0",
    "title": "a rainy night 🌧️ lofi rain for deep focus",
    "channelName": "Lofi Girl",
    "channelId": "UCSJ4gkVC6NrvII8umztf0Ow",
    "channelUrl": "https://www.youtube.com/@LofiGirl",
    "viewCount": 506000,
    "viewCountText": "506K views",
    "publishedText": "8 days ago",
    "durationSeconds": 28800,
    "isShort": false,
    "isLive": false,
    "thumbnailUrl": "https://i.ytimg.com/vi/nx32Ue0AAA0/hq720.jpg",
    "descriptionSnippet": "a rainy night lofi rain for deep focus...",
    "source": "channel:https://www.youtube.com/@LofiGirl"
}
```

Error row example (not charged):

```json
{
    "type": "error",
    "status": "error",
    "error": "YouTube asks for sign-in / bot check: Sign in to confirm you're not a bot",
    "source": "search:some query"
}
```

### Notes on the data

- Requests always use `hl=en`, `gl=US`, so numbers and dates come back in English ("1.2M views", "3 days ago") and are parsed into `viewCount` (integer) and `durationSeconds` (seconds, from "12:34" or "1:02:03").
- Live streams have `isLive: true` and `durationSeconds: null`.
- In search results, Shorts are detected from `reelItemRenderer` / `shortsLockupViewModel`; on channels, both the classic `videoRenderer` rows and the newer `lockupViewModel` rows are parsed.
- Ads, playlists, channels and "mixes" in search results are skipped.

### Limitations

- Public videos only. No login, cookies, captchas or stealth tricks, so private, members-only and age-restricted videos are not available.
- If YouTube asks for a sign-in or bot check, the task returns an error row instead of pretending; the actor retries twice with a fresh proxy and then moves on.
- `viewCount` for live streams is the number of current watchers ("watching"), as YouTube reports it.
- The User-Agent honestly identifies the actor; this is not a browser emulator.

### FAQ

**How do I get more than 500 results for one query?** Search itself stops at ~500 per query (`maxResultsPerQuery` max). Split a broad query into several narrower ones; each query is an independent task.

**Can I combine search and channels?** Yes — fill both `searchQueries` and `channelUrls`; every item is marked in `source` (`search:<query>` or `channel:<url>`).

**Why do view counts differ from what I see on YouTube?** YouTube rounds counts per viewer locale ("73 тис.", "7,3 Tsd."). This actor always reads the English UI, so `viewCount` is exact when YouTube gives the full number and an approximation (rounded) when only the short form ("1.2M") is available; `viewCountText` always keeps the original text.

**Are Shorts included on channel pages?** The actor reads the channel's Videos tab, the same as on youtube.com. Shorts that appear there are included unless you untick `includeShorts`.

**Does it download videos or comments?** No — metadata rows only.

**Why is it so cheap?** It calls YouTube's public page API directly through the datacenter proxy you already have, with no browser overhead and no paid events for anything but video rows.

Use responsibly and check YouTube's terms for your use case.

### More actors from the same developer

Pay only for results, no logins:

- [YouTube Transcript Scraper](https://apify.com/librevlad/youtube-transcripts-fast) — transcripts as plain text, timestamped segments or SRT.
- [YouTube Shorts Scraper](https://apify.com/librevlad/youtube-shorts-scraper-fast) — Shorts from keyword search and from channels' Shorts tab.
- [Website Crawler to Markdown](https://apify.com/librevlad/website-crawler-markdown) — crawl a website or docs section into clean Markdown for RAG and LLMs.
- [Website to Markdown](https://apify.com/librevlad/website-to-markdown) — turn a list of pages and PDFs into clean Markdown or text.
- [Website Screenshot & PDF](https://apify.com/librevlad/page-screenshot-pdf) — full-page and mobile screenshots, URL to PDF.
- [App Store Scraper](https://apify.com/librevlad/app-store-scraper) — app details, keyword search positions and reviews from Apple's public API.
- [Google Trends Scraper](https://apify.com/librevlad/google-trends-scraper-fast-cheap) — interest over time, interest by region and related queries.
- [Threads Scraper](https://apify.com/librevlad/threads-scraper) — public Threads posts and profiles without login.

# Actor input Schema

## `searchQueries` (type: `array`):

YouTube search queries, exactly like typing them into youtube.com/results. Each query is one task and costs one 'video' paid event per returned video.

## `channelUrls` (type: `array`):

YouTube channel URLs, one per line: https://www.youtube.com/@handle, https://www.youtube.com/channel/UC..., https://www.youtube.com/c/name or https://www.youtube.com/user/name. Optional — leave empty to run search only.

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

Maximum number of videos to return for each search query (1–500).

## `maxVideosPerChannel` (type: `integer`):

Maximum number of videos to return for each channel, like the channel's Videos tab (1–1000).

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

Sort order for search results (applies to search mode only): relevance (default), date (newest first) or views (most viewed first).

## `includeShorts` (type: `boolean`):

Include YouTube Shorts in the results (Shorts from search results and any Shorts the channel serves in the Videos tab). Default: true.

## `maxConcurrency` (type: `integer`):

How many queries/channels to process at the same time (1–10). Default: 3.

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

Proxy settings. The default Apify datacenter proxy works well for YouTube and keeps the actor fast and cheap.

## Actor input object example

```json
{
  "searchQueries": [
    "lofi hip hop"
  ],
  "maxResultsPerQuery": 50,
  "maxVideosPerChannel": 50,
  "sortBy": "relevance",
  "includeShorts": true,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "searchQueries": [
        "lofi hip hop"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("librevlad/youtube-search-channel-videos").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 = { "searchQueries": ["lofi hip hop"] }

# Run the Actor and wait for it to finish
run = client.actor("librevlad/youtube-search-channel-videos").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 '{
  "searchQueries": [
    "lofi hip hop"
  ]
}' |
apify call librevlad/youtube-search-channel-videos --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,librevlad/youtube-search-channel-videos"
        }
    }
}
```

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/7yLcUyy0Bm23bT9if/builds/vSzln2Ouh5NtG1eBC/openapi.json
