# YouTube Scraper: Channel Videos, Shorts & Search, $1/1,000 (`trueline-data/youtube-videos-scraper`) Actor

List every video on a YouTube channel (Videos, Shorts and Live tabs) or in a YouTube search: title, views, upload date, length, channel and links. Fast and cheap: no proxy needed for most runs.

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

## Pricing

$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/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 Scraper: Channel Videos, Shorts & Search, $1/1,000

List the videos of any YouTube channel, or of any YouTube search, with the numbers you need:

- **Every video on a channel**: the Videos tab, and the Shorts and Live tabs if you want them.
- **YouTube search results**: sort by relevance, views or rating, and keep only this hour, today,
  this week, this month or this year.
- **For each video**: title, link, views (as a number), upload date, length in seconds, channel
  name, channel id and link, thumbnail, and whether it is a Short or a live stream. Search results
  also carry the description snippet and badges such as "New" or "4K".
- **For each channel**: one free row with its name, handle, subscribers, video count, description
  and keywords.

### Why this one

- **Fast and cheap.** It reads YouTube's own data directly, without a browser and, for most runs,
  without a proxy. If YouTube blocks the run, it switches to residential IPs by itself.
- **You pay only for videos.** Channel rows and error rows are free.
- **Pairs with the YouTube Transcript Scraper**: list a channel here, then send the links there.

### Input

| Field | What it does |
| --- | --- |
| `channels` | Channel URLs, @handles or channel ids. |
| `includeShorts` / `includeLive` | Also list the channel's Shorts and Live tabs. |
| `searchQueries` | Words to search on YouTube, one per line. |
| `searchSort` | `relevance`, `viewCount` or `rating`. |
| `uploadDate` | `any`, `hour`, `today`, `week`, `month`, `year`. |
| `maxResults` | Max videos for each channel tab and each query. |
| `language`, `country` | YouTube's language and country (search results follow the country). |

```json
{
  "channels": ["https://www.youtube.com/@mkbhd"],
  "searchQueries": ["heat pump installation"],
  "uploadDate": "week",
  "maxResults": 100
}
```

### Output

One `channel` row per channel, then one `video` row per video.

Real rows from a test run on 17 October 2026 (some fields left out to keep it short):

```json
[
  {
    "type": "channel",
    "input": "@mkbhd",
    "channelName": "Marques Brownlee",
    "handle": "@mkbhd",
    "subscriberCount": 21400000,
    "videoCount": 1800
  },
  {
    "type": "video",
    "source": "search",
    "input": "heat pump installation",
    "rank": 1,
    "videoId": "j7Lc9wonJBw",
    "title": "We Spent £4,000 Heating a Bungalow… So We Got a Heat Pump",
    "channelName": "Andrew Till / Mr. EV",
    "viewCount": 605,
    "publishedText": "42 minutes ago",
    "durationSeconds": 2638,
    "isShort": false,
    "isLive": false,
    "url": "https://www.youtube.com/watch?v=j7Lc9wonJBw"
  }
]
```

### Pricing

Pay per video returned. Channel rows and errors are free.

### Notes

- YouTube shows upload dates as "3 days ago"; that text is passed through as `publishedText`.
- YouTube no longer honours "sort by upload date" in search, so it is not offered. Use the
  `uploadDate` filter to get recent videos.

# Actor input Schema

## `channels` (type: `array`):

Channel URLs, @handles or channel ids. Any form works: youtube.com/@name, /channel/UC…, /c/name, /user/name, @name.

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

Also list the channel's Shorts tab.

## `includeLive` (type: `boolean`):

Also list the channel's Live tab (past and upcoming streams).

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

Words to search on YouTube, one per line. Each query is its own list of results.

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

How YouTube orders search results.

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

Only search results uploaded in this period.

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

Stop after this many videos for each channel tab and each search query.

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

Language code for YouTube's texts, such as en, es, de.

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

Two-letter country code. Search results follow this country.

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

How many channels and queries to work on in parallel.

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

Not needed for most runs. The tool goes direct and switches to residential IPs on its own if YouTube blocks it. Set a proxy here only to force your own.

## Actor input object example

```json
{
  "channels": [
    "https://www.youtube.com/@mkbhd"
  ],
  "includeShorts": false,
  "includeLive": false,
  "searchSort": "relevance",
  "uploadDate": "any",
  "maxResults": 50,
  "language": "en",
  "country": "US",
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (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 = {
    "channels": [
        "https://www.youtube.com/@mkbhd"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("trueline-data/youtube-videos-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 = {
    "channels": ["https://www.youtube.com/@mkbhd"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("trueline-data/youtube-videos-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 '{
  "channels": [
    "https://www.youtube.com/@mkbhd"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call trueline-data/youtube-videos-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,trueline-data/youtube-videos-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/QbIkkoUzxXVT5wXU5/builds/A9yUbE6V6BiaFgu1M/openapi.json
