# YouTube Scraper API - Search, Playlists & Videos ($1/1K) (`sonic_scraper/youtube-scraper-api`) Actor

YouTube scraper API for search terms, playlists, channels and video or Shorts URLs. Export titles, channels, view counts, durations, thumbnails and links to JSON/CSV for $1 per 1,000 videos. No YouTube API key or quota.

- **URL**: https://apify.com/sonic_scraper/youtube-scraper-api.md
- **Developed by:** [Group Oject](https://apify.com/sonic_scraper) (community)
- **Categories:** Videos, Social media, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

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 API - Search, Playlists & Videos ($1/1K)

Scrape YouTube videos from keyword searches, playlists, channels and video URLs into one clean dataset. Get titles, channels, view counts, durations, thumbnails and links for **$1 per 1,000 videos**. No YouTube Data API key, no quota, no login.

![YouTube Scraper API output in Apify: title, channel, views, duration, published, video url, thumbnail](https://api.apify.com/v2/key-value-stores/lwQu1lCMCLQIIhSMQ/records/youtube-scraper-api-output.png)

*Real output from a default run of YouTube Scraper API in Apify Console.*

### What can this YouTube scraper do?

- **Search YouTube by keyword** and export the top video results for each search term.
- **Scrape playlists** by URL or playlist ID.
- **List a channel's latest uploads** from a channel URL, `@handle`, or `UC...` ID.
- **Enrich video and Shorts URLs** with title, channel, view count, duration, description and thumbnail.
- **Mix all four sources in one run**, with automatic de-duplication of repeated video IDs.
- **Set language and country** so search results match the market you care about.
- **Respect your budget**: `maxTotalResults` and your run's maximum charge cap the number of paid results.

Built for keyword and trend research, competitor content audits, influencer discovery, playlist exports, and feeding video lists into AI or analytics pipelines.

### What data can I extract from YouTube?

| Field | Search | Playlist | Channel | Video URL |
|---|---|---|---|---|
| `videoId`, `videoUrl`, `title` | yes | yes | yes | yes |
| `channelName` | yes | yes | yes | yes |
| `channelId` | - | - | yes | yes |
| `views` (number) | yes | when shown | yes | yes |
| `viewCountText` | yes | when shown | - | - |
| `durationText`, `durationSeconds` | yes | yes | - | yes |
| `publishedAt` (ISO date) | - | - | yes | - |
| `description` | - | - | yes | yes |
| `thumbnailUrl` | yes | yes | yes | yes |
| `sourceType`, `query`, `scrapedAt` | yes | yes | yes | yes |

`sourceType` is `search`, `playlist`, `channel` or `video`, and `query` holds the input that produced the row, so you can group results by keyword or source.

### How much does it cost to scrape YouTube?

Pay-per-event pricing:

- **$1.00 per 1,000 videos** ($0.001 per video saved to the dataset)
- **$0.00005 per Actor start** (per GB of memory)

| Job | Videos | Approx. cost |
|---|---|---|
| 10 keyword searches | ~200 | $0.20 |
| 5 playlists | ~250 | $0.25 |
| 1,000 video URLs | 1,000 | $1.00 |

Duplicates removed by `dedupe` are not saved and not charged. See the Pricing tab for current rates.

### How to use YouTube Scraper API

1. Add one or more **search terms**, **playlist URLs**, **channel URLs**, or **video URLs**.
2. Set `maxResultsPerQuery` (per source) and `maxTotalResults` (whole run).
3. Optional: set `language` (for example `en`) and `country` (for example `US`).
4. Click **Start**, then download the dataset as JSON, CSV, Excel or HTML, or read it through the API.

#### Input example

```json
{
  "searchTerms": ["ai coding assistant review", "cursor vs copilot"],
  "playlistUrls": ["https://www.youtube.com/playlist?list=PLx0sYbCqOb8TBPRdmBHs5Iftvv9TPboYG"],
  "channelUrls": ["https://www.youtube.com/@fireship"],
  "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ", "https://youtube.com/shorts/abc123def45"],
  "maxResultsPerQuery": 30,
  "maxTotalResults": 200,
  "language": "en",
  "country": "US",
  "dedupe": true
}
```

#### Output example

```json
{
  "videoId": "dQw4w9WgXcQ",
  "title": "Cursor vs Copilot: which AI coding assistant wins?",
  "channelName": "Example Dev Channel",
  "views": 482113,
  "viewCountText": "482,113 views",
  "durationText": "12:41",
  "durationSeconds": 761,
  "thumbnailUrl": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hq720.jpg",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "sourceType": "search",
  "query": "cursor vs copilot",
  "scrapedAt": "2026-10-25T08:30:41.512Z"
}
```

### Input reference

| Field | Default | Notes |
|---|---|---|
| `searchTerms` | \[] | YouTube search keywords |
| `channelUrls` | \[] | Channel URLs, `@handles`, or `UC...` IDs (latest uploads from the channel feed) |
| `playlistUrls` | \[] | Playlist URLs or IDs |
| `videoUrls` | \[] | Video URLs, Shorts URLs, or 11-character IDs |
| `maxResultsPerQuery` | 30 | Cap per search term, channel or playlist |
| `maxTotalResults` | 100 | Cap for the whole run (max 10,000) |
| `language` / `country` | `en` / `US` | Search locale |
| `dedupe` | true | Skip repeated video IDs across sources |
| `includeVideoDetails` | true | Fetch full details for direct video URLs |

### Limits you should know

- **Search**: returns the first page of YouTube results for each term (usually about 20 videos). Use several specific search terms to collect more.
- **Channels**: returns the latest uploads from the public channel feed (up to 15 per channel). For scheduled "new upload" alerts, use [YouTube Channel Monitor](https://apify.com/sonic_scraper/youtube-channel-monitor).
- **Playlists**: returns the first page of the playlist that YouTube serves.
- Likes, comments and transcripts are not included in this Actor.

### Use it from code, MCP and no-code tools

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("sonic_scraper/youtube-scraper-api").call(run_input={
    "searchTerms": ["n8n tutorial"],
    "maxResultsPerQuery": 20,
})
for v in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(v["views"], v["title"], v["videoUrl"])
```

- **MCP**: `https://mcp.apify.com?tools=sonic_scraper/youtube-scraper-api` lets Claude, Cursor or ChatGPT search YouTube for you.
- **Make, Zapier, n8n**: use the Apify integration to run the Actor and send rows to Sheets, Airtable or a CRM.
- **Schedules**: save a task with your keywords and schedule it daily to track what ranks for them.

Each run also stores a `SUMMARY` record and an `ERRORS` record listing any input that failed and why.

### FAQ

**Do I need a YouTube Data API key?** No. There is no API key, no OAuth and no 10,000-unit daily quota.

**Can it scrape YouTube Shorts?** Yes. Shorts URLs work in `videoUrls`, and Shorts can appear in search, playlist and channel results.

**Does it scrape comments?** No. Use [YouTube Comments Scraper API](https://apify.com/sonic_scraper/youtube-comments-scraper-api) for comments.

**Why are view counts slightly different from YouTube Studio?** Public view counts are rounded or delayed by YouTube. Treat them as public estimates.

**Is it legal to scrape YouTube?** The Actor collects only publicly visible data. Make sure your use complies with YouTube's terms and data protection law, especially for personal data.

### Related Actors

- [YouTube Channel Monitor](https://apify.com/sonic_scraper/youtube-channel-monitor) - scheduled new-video alerts for many channels
- [YouTube Channel Scraper API](https://apify.com/sonic_scraper/youtube-channel-scraper-api) - subscribers, video counts, emails in bio
- [YouTube Comments Scraper API](https://apify.com/sonic_scraper/youtube-comments-scraper-api) - comments, likes and reply counts

# Actor input Schema

## `searchTerms` (type: `array`):

YouTube search keywords for keyword research, trend monitoring, and competitor content discovery.

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

YouTube channel URLs, @handles, or UC channel IDs. Public channel RSS is used when available.

## `playlistUrls` (type: `array`):

YouTube playlist URLs or playlist IDs.

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

Specific YouTube video URLs, Shorts URLs, or video IDs to enrich.

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

Maximum videos collected for each search term, channel, or playlist.

## `maxTotalResults` (type: `integer`):

Maximum videos output across the whole run. Default keeps test runs affordable.

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

YouTube language code.

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

YouTube country code.

## `dedupe` (type: `boolean`):

Remove duplicate video IDs across all input sources.

## `includeVideoDetails` (type: `boolean`):

Fetch richer metadata for direct video URLs.

## `debugMode` (type: `boolean`):

Verbose logging.

## Actor input object example

```json
{
  "searchTerms": [
    "openai tutorials",
    "shopify marketing"
  ],
  "channelUrls": [
    "https://www.youtube.com/@OpenAI"
  ],
  "maxResultsPerQuery": 30,
  "maxTotalResults": 100,
  "language": "en",
  "country": "US",
  "dedupe": true,
  "includeVideoDetails": true,
  "debugMode": false
}
```

# Actor output Schema

## `videos` (type: `string`):

One row per YouTube video.

## `summary` (type: `string`):

Totals, source counts, and warnings.

## `errors` (type: `string`):

Inputs that failed.

# 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 = {
    "searchTerms": [
        "openai tutorials",
        "shopify marketing"
    ],
    "channelUrls": [
        "https://www.youtube.com/@OpenAI"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("sonic_scraper/youtube-scraper-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 = {
    "searchTerms": [
        "openai tutorials",
        "shopify marketing",
    ],
    "channelUrls": ["https://www.youtube.com/@OpenAI"],
}

# Run the Actor and wait for it to finish
run = client.actor("sonic_scraper/youtube-scraper-api").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 '{
  "searchTerms": [
    "openai tutorials",
    "shopify marketing"
  ],
  "channelUrls": [
    "https://www.youtube.com/@OpenAI"
  ]
}' |
apify call sonic_scraper/youtube-scraper-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sonic_scraper/youtube-scraper-api"
        }
    }
}
```

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/uXWrxCykichRZHVdG/builds/G12gcQdvxy6HljhhH/openapi.json
