# YouTube Scraper: Search, Channel Videos, Video Details (`shipsatnight/youtube-scraper`) Actor

Scrape public YouTube video data from search results, channel pages and video URLs: title, views, duration, publish date, channel, description, tags. $0.001 per video, no start fee. Failed videos are not charged.

- **URL**: https://apify.com/shipsatnight/youtube-scraper.md
- **Developed by:** [Donovan](https://apify.com/shipsatnight) (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

$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: Search, Channel Videos, Video Details

### What does this YouTube Scraper do?

YouTube Scraper gets public video data from YouTube search results, channel pages and video URLs: title, views, likes, duration, publish date, channel, subscribers and description. $1 per 1,000 videos ($0.001 each), no start fee, no YouTube API key. Videos that fail are not charged.

It costs $0.001 per video. There is no start fee. If a video cannot be read, you are not charged for it.

### What can I use it for?

- Find the top videos for a keyword, sorted by relevance, upload date, view count, or rating.
- Track the newest uploads from competitor or creator channels on a schedule.
- Get view counts and publish dates for a list of video links.
- Build datasets of titles, descriptions, views, and likes for keyword research or content planning.

### What data does it return?

| Field | Example |
|---|---|
| title | Python Full Course for Beginners |
| url | https://www.youtube.com/watch?v=\_uQrJ0TkZlc |
| viewCount | 49522395 |
| likeCount | 1274441 |
| publishDate / dateText | 2019-02-18 / Feb 18, 2019 |
| duration / durationSeconds | 6:14:07 / 22447 (from search and channel lists) |
| channelName, channelId, channelHandle, channelUrl | Programming with Mosh, UCWv7vMbMWH4-V0ZXdmDpPBA, @programmingwithmosh |
| channelSubscribersText | 5.18M subscribers |
| description | full description text |
| isLive, concurrentViewers | true and the live viewer count for live streams |
| thumbnailUrl | image link |
| source, searchQuery, inputChannel, inputUrl, position | where the video came from and its rank |

Not included in this version: tags, category, comment counts, and comments. Duration comes from the search or channel list, so it is empty for videos you add by URL and for Shorts. publishDate is a calendar date (YYYY-MM-DD); very new videos or premieres that only show "x hours ago" have publishDate empty and keep the text in dateText.

### How do I use it?

1. Add one or more search queries, channels, or video URLs. You can mix all three in one run.
2. Set "Max videos per query or channel" (default 20, up to 500).
3. For search, pick a sort order. For channels, pick the Videos or Shorts tab.
4. Click Start. Download results as JSON, CSV, Excel, or HTML, or read them with the Apify API.

Example input:

```json
{
  "searchQueries": ["web scraping tutorial"],
  "channels": ["@mkbhd"],
  "videoUrls": ["https://youtu.be/dQw4w9WgXcQ"],
  "maxResultsPerSource": 20,
  "sortBy": "viewCount"
}
```

### How much does it cost?

$0.001 per video written to the dataset, which is $1 per 1,000 videos. No start fee. Platform usage is included in the price. Videos that fail to load are skipped and not charged. You can set a maximum charge per run in the run options, and the actor stops cleanly when it is reached.

### How does the price compare with other YouTube scrapers?

Prices below are the Free plan per-video prices listed on the Apify Store on November 3, 2026. Check each listing for current prices.
| Actor | Price per video |
|---|---|
| This actor | $0.001, no start fee |
| streamers/youtube-scraper | $0.004 |
| streamers/youtube-channel-scraper | $0.0013 |
| apidojo/youtube-scraper | $0.0005 |

Other actors offer extra features this one does not, such as comments, transcripts, or subtitles. Pick the one that fits your job.

### How does it handle errors?

Each request is retried up to 6 times with growing waits, and a blocked request switches to a new proxy IP. A video that still fails is listed in the RUN_SUMMARY record in the key-value store and is not charged. A run fails only when no video at all could be read.

### FAQ

**Do I need a YouTube API key?** No. The actor reads the same public data a logged-out visitor sees.

**Can it scrape private or age-restricted videos?** No. It only reads public data and does not log in.

**Can I scrape a whole channel?** Yes, up to 500 of the newest videos per channel per run. Use the Shorts tab option for Shorts.

**Does it download videos?** No. It returns metadata only.

**Can I run it on a schedule?** Yes. Save your input as a task and add an Apify schedule, for example daily for new uploads.

**Is scraping YouTube legal?** This actor collects public video metadata only, not personal data. You are responsible for how you use the data and for following YouTube's terms and the laws that apply to you.

# Actor input Schema

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

Words to search on YouTube, one per line. Each query returns up to the max results below.

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

Channel URLs, @handles, or channel IDs (UC...). Returns the newest videos from each channel.

## `videoUrls` (type: `array`):

YouTube video, Shorts, or youtu.be links to get details for.

## `maxResultsPerSource` (type: `integer`):

Limit for each search query and each channel.

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

Applies to search queries only.

## `channelTab` (type: `string`):

Which channel tab to read.

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

Two-letter country code for search results, for example US, GB, DE.

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

Interface language code, for example en, de, es.

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

Default Apify Proxy works for most runs.

## Actor input object example

```json
{
  "searchQueries": [
    "web scraping tutorial"
  ],
  "maxResultsPerSource": 20,
  "sortBy": "relevance",
  "channelTab": "videos",
  "country": "US",
  "language": "en",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `summary` (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": [
        "web scraping tutorial"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("shipsatnight/youtube-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 = { "searchQueries": ["web scraping tutorial"] }

# Run the Actor and wait for it to finish
run = client.actor("shipsatnight/youtube-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 '{
  "searchQueries": [
    "web scraping tutorial"
  ]
}' |
apify call shipsatnight/youtube-scraper --silent --output-dataset

```

## MCP server setup

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