# YouTube Search Scraper | Videos, Views and Rank (`atesen-software/youtube-search-scraper`) Actor

Scrape YouTube search and video URLs with title, channel, views, duration, upload date, likes, comments, description and tags. Filter by sort, upload date, type and duration. Each row keeps its rank position. No API key and no browser.

- **URL**: https://apify.com/atesen-software/youtube-search-scraper.md
- **Developed by:** [Atesen Software](https://apify.com/atesen-software) (community)
- **Categories:** Social media, Videos, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 search 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/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

Scrape **YouTube search results** and **videos**: title, URL, channel, **views, duration, upload date**, description snippet and thumbnail, and optionally the **exact publish date, view count, likes, comment count, full description and hashtags** (plus keywords and category when YouTube provides them). Use YouTube's own filters: **sort by upload date / view count / rating, upload date (hour, today, week, month, year), type (video, channel, playlist) and duration**. Video URLs work too.

- **$1 per 1,000 results**; exact video details +$0.80 per 1,000. Full data for $1.80 per 1,000 videos, less than half the $4 per 1,000 of the most used YouTube scraper.
- **No YouTube API key, no quota, no login**, no browser, 256 MB. Hundreds of results per query (paginated).
- Every result has its `position`, so it doubles as a **YouTube rank tracker**.
- Bad URLs and empty searches become free status rows; the run never fails because of one input.

### Use cases

- **YouTube SEO and rank tracking**: where your videos rank for your keywords, over time.
- **Market and trend research**: what is being published this week about a topic, and what gets views.
- **Influencer discovery**: find channels by keyword (type = channel).
- **Datasets for AI**: titles, descriptions, tags and stats at scale.
- **Video stats for a list of URLs**: views, likes and comments of your or your competitors' videos.

### Input

| Field | Description |
|---|---|
| `searchQueries` | Keywords |
| `videoUrls` | Videos to scrape directly (always with details) |
| `maxResultsPerQuery` | Default 50, 0 = all YouTube returns |
| `sortBy` | relevance, upload_date, view_count, rating |
| `uploadDate` | any, hour, today, week, month, year |
| `type` | video, channel, playlist, all |
| `duration` | any, short (<4 min), medium (4-20), long (>20) |
| `videoDetails` | Exact date, views, likes, comments, description, hashtags |
| `country` | Results country (default US) |

> Keywords, category and exact duration come from YouTube's player data, which YouTube sometimes withholds. When that happens those fields are `null`; publish date, views, likes, comment count, description, hashtags and channel subscribers still come from the watch page (`detailsSource: "watch-page"`).

```json
{
  "searchQueries": ["web scraping tutorial", "bitcoin"],
  "maxResultsPerQuery": 100,
  "sortBy": "upload_date",
  "uploadDate": "week",
  "videoDetails": true
}
```

### Output

```json
{
  "type": "result",
  "resultType": "video",
  "position": 1,
  "searchQuery": "bitcoin",
  "videoId": "xYz123AbCdE",
  "title": "Why JP Morgan Is Finally Bullish on Bitcoin",
  "url": "https://www.youtube.com/watch?v=xYz123AbCdE",
  "channelName": "Crypto Channel",
  "channelId": "UC...",
  "viewCount": 29260,
  "likeCount": 507,
  "commentCount": 120,
  "publishedAt": "2026-10-20T09:30:02-07:00",
  "durationSec": 895,
  "keywords": ["bitcoin", "jp morgan"],
  "category": "Education"
}
```

Not affiliated with YouTube or Google.

### Pricing

Pay per event: **$0.001 per search result** ($1 per 1,000) and **$0.0008 per video** when `videoDetails` is on. Status rows are free. Set a maximum cost per run and the Actor stops there. Platform usage is included in the event price.

### FAQ

**Do I need a YouTube API key?** No. The Actor reads public YouTube pages. It is not affiliated with YouTube or Google.

**Can I track rank?** Yes. Every row includes `position` for that query, so a scheduled run is a rank tracker.

**How do I keep the first run cheap?** Leave `videoDetails` off and set `maxResultsPerQuery` to 20. You still get titles, channels, views and URLs.

# Actor input Schema

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

What you would type into YouTube search, one per line.

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

Optional. Video, Shorts or youtu.be URLs (or IDs) to scrape directly with full details.

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

0 = as many as YouTube returns (usually several hundred).

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

YouTube's sort filter.

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

YouTube's upload date filter.

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

Videos only (default), channels, playlists or everything.

## `duration` (type: `string`):

YouTube's duration filter.

## `videoDetails` (type: `boolean`):

Also load each video's exact publish date, exact view count, likes, comment count, full description, tags/keywords, category and channel subscribers (small extra charge per video, see Pricing). Off = fast list data (approximate dates like "3 days ago").

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

Two-letter country for search results, default "US".

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

How many queries are scraped at the same time.

## Actor input object example

```json
{
  "searchQueries": [
    "web scraping tutorial"
  ],
  "maxResultsPerQuery": 50,
  "sortBy": "relevance",
  "uploadDate": "any",
  "type": "video",
  "duration": "any",
  "videoDetails": false,
  "maxConcurrency": 3
}
```

# Actor output Schema

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

No description

## `allFields` (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("atesen-software/youtube-search-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("atesen-software/youtube-search-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 atesen-software/youtube-search-scraper --silent --output-dataset

```

## MCP server setup

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