# YouTube Search Scraper - Videos by Keyword, Date & Views (`pipiagent/youtube-search-scraper`) Actor

Search YouTube by keyword and export the videos: title, views, duration, publish time, channel and thumbnail. Filter by upload date, sort by views or date. No API key, no quota, no login.

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

## Pricing

$1.00 / 1,000 results

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 Search Scraper

Search [YouTube](https://www.youtube.com) by keyword and export the matching videos, without an API key and without the quota limits of the official YouTube Data API.

Use it for keyword and SEO research, to see who ranks for a topic, to find creators for influencer campaigns, or to monitor new videos about your brand.

- **Search like a viewer, export like an analyst.** Keywords in, a table of videos out.
- **Filters.** Upload date (last hour to this year) and sort by relevance, date or views.
- **Numbers you can sort.** "1.2M views" becomes 1200000, and the original text is kept.
- **No API key, no login and no proxy setup.**
- **Low price.** $1 per 1,000 videos.

### How to use it

1. Click **Try for free**.
2. Type your keywords in **Search keywords**.
3. Click **Start**, then download the results as JSON, CSV or Excel.

### Input example

```json
{
    "searchQueries": ["web scraping", "python tutorial"],
    "uploadDate": "month",
    "sortBy": "views",
    "maxItemsPerQuery": 200
}
```

### Output example

```json
{
    "type": "video",
    "videoId": "k-EkfZBVe3U",
    "url": "https://www.youtube.com/watch?v=k-EkfZBVe3U",
    "title": "how to actually get good at Web Scraping",
    "viewCount": 3696,
    "viewCountText": "3,696 views",
    "durationSeconds": 167,
    "durationText": "2:47",
    "publishedTimeText": "2 weeks ago",
    "publishedAtEstimated": "2026-10-10T11:27:11Z",
    "isShort": false,
    "channelName": "Shade of Code",
    "channelId": "UCmxKkv3HQUNbTCshLwwDu3g",
    "channelHandle": "@Shadeofcode",
    "channelUrl": "https://www.youtube.com/channel/UCmxKkv3HQUNbTCshLwwDu3g",
    "channelIsVerified": false,
    "searchQuery": "web scraping",
    "scrapedAt": "2026-10-24T11:27:11Z"
}
```

### How much does it cost?

You pay per saved result: **$1.00 per 1,000 videos**. There is no start fee and no monthly rental.

| Run | Results | Cost |
|---|---|---|
| 100 videos for one keyword | 100 | $0.10 |
| 500 videos for each of 4 keywords | 2,000 | $2.00 |

Set a maximum charge per run in the run options and the Actor stops when it is reached.

### Limits you should know

- **About 500 videos per keyword.** This is YouTube's own limit. To get more, use several related keywords, different sort orders or upload dates.
- **Dates are estimates.** Search results show relative times such as "2 weeks ago". The Actor keeps that text and adds an estimated date in `publishedAtEstimated`.
- **Likes and comment counts are not in search results.** For those, feed the `url` values into the [YouTube Scraper](https://apify.com/pipiagent/youtube-scraper) in video details mode.
- **"Recent first" is not strictly by date.** YouTube mixes in some relevance.

### Related Actors

- [YouTube Shorts Scraper](https://apify.com/pipiagent/youtube-shorts-scraper): Shorts by keyword or channel, with views, likes and hashtags.
- [YouTube Channel Videos Scraper](https://apify.com/pipiagent/youtube-channel-videos-scraper): every upload of a channel.
- [YouTube Scraper](https://apify.com/pipiagent/youtube-scraper): video details, comments with replies and channel profiles in one Actor.

### FAQ

**Is it legal?** The Actor collects only data that YouTube shows publicly to every visitor. Results can contain personal data such as usernames. Make sure you have a legitimate reason to process it, as required by the GDPR and similar laws.

**Something is broken or missing?** Open a ticket in the Issues tab. Issues are usually answered within a day.

# Actor input Schema

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

One keyword or phrase per line, for example "web scraping" or "iphone 17 review".

## `maxItems` (type: `integer`):

Maximum number of results to save in this run. You are only charged for saved results.

## `maxItemsPerQuery` (type: `integer`):

Optional. Limits results for each keyword, so that one keyword does not use up the whole run.

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

Order of the search results. With "Recent first" YouTube returns new videos, but the order is not strictly by date.

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

Keeps only videos uploaded in this period.

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

Optional. The Actor works without a proxy. Turn one on only if runs start failing with blocked requests.

## Actor input object example

```json
{
  "searchQueries": [
    "web scraping"
  ],
  "maxItems": 100,
  "sortBy": "relevance",
  "uploadDate": "any",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Videos saved by the run, one item per video.

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("pipiagent/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"] }

# Run the Actor and wait for it to finish
run = client.actor("pipiagent/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"
  ]
}' |
apify call pipiagent/youtube-search-scraper --silent --output-dataset

```

## MCP server setup

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