# Fast YouTube Search Results Scraper (`matthewjames/fast-youtube-search-results-scraper`) Actor

Scrape YouTube search results by keyword. Filter videos by upload date, duration, and captions. Collect titles, views, video links, and channel data for content research and automated workflows. Export to JSON, CSV, or Excel. No YouTube API key required.

- **URL**: https://apify.com/matthewjames/fast-youtube-search-results-scraper.md
- **Developed by:** [Matthew James](https://apify.com/matthewjames) (community)
- **Categories:** Videos, Automation, Social media
- **Security:** Limited permissions
- **Stats:** 70 total users, 1 monthly users, 100.0% runs succeeded, 9 bookmarks
- **User rating**: 5.00 out of 5 stars

## 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

**Fast YouTube Search Results Scraper** helps you find relevant videos for research and automation. Search by keyword, filter by upload date, duration, and captions, then export video and channel data to JSON, CSV, or Excel. No YouTube account or YouTube Data API key is required.

Collect a few videos for a scheduled workflow or search several topics in one run.

### Features

- **Search multiple topics at once:** Enter a list of search terms and collect results for each query.
- **Go beyond the first page:** Automatically collect more results, up to your chosen limit per query.
- **Find fresh content:** Filter by upload date, including Last hour, Today, This week, This month, and This year.
- **Choose video length:** Find videos under 3 minutes, between 3 and 20 minutes, or over 20 minutes.
- **Find videos with captions:** Use YouTube's Subtitles/CC filter to narrow your search.
- **Sort for your research:** Order results by relevance, upload date, view count, or rating.
- **Get cleaner results:** Automatically remove repeat videos within each query while keeping the search term attached to every result.
- **Use data in your workflows:** Get video links, view counts, duration in seconds, channel IDs, and more.
- **Identify Shorts:** Flag Shorts when YouTube identifies them in supported video results.
- **Keep collected results:** Results are saved as the search progresses, so a later failure does not discard earlier results.

### Use cases for YouTube search data

- **Content research:** Find videos about your topic and compare titles, lengths, and displayed view counts.
- **Find relevant channels:** Discover creators publishing about a niche, then use channel IDs and links in your research.
- **Monitor new content:** Combine an upload-date filter with scheduled runs to collect recent search results. Compare video IDs across runs to identify new videos.

### Export YouTube search results to CSV or JSON

After a run, open its dataset and select **Export**. Choose CSV for spreadsheets, JSON for applications, or Excel for analysis. Every row includes the original search query, so results remain traceable when you search several topics at once.

### Data Output Structure

- **dateScraped:** ISO8601 timestamp of when this data was scraped.
- **query:** The original search term used to generate this result.
- **filterUsed:** Upload-date filter applied to the search (e.g. "This month").
- **sortByUsed:** Human-readable sort order used (e.g. "Relevance").
- **videoId:** Unique YouTube video ID.
- **watchUrl:** Direct link to the YouTube video.
- **timePosted:** How long ago the video was uploaded in human-readable format.
- **title:** Title of the YouTube video.
- **description:** Description snippet shown in the search result.
- **thumbnail:** URL of the video's thumbnail image.
- **viewCount:** Numeric view count. Abbreviated counts such as 1.2M are converted to numbers; these remain estimates. Returns `null` when unavailable.
- **length:** Duration of the video in HH:MM:SS or MM:SS format.
- **durationSeconds:** Numeric duration in seconds, or `null` when unavailable (for example, a live stream).
- **channelId:** YouTube channel ID for matching videos to channels, or `null` when unavailable.
- **channelName:** Name of the channel that uploaded the video.
- **channelThumbnail:** URL of the channel's avatar image.
- **channelUrl:** Direct link to the YouTube channel.
- **isShort:** Whether YouTube identifies the video as a Short in the returned result.

### Example Output

```json
{
    "dateScraped": "2025-07-01T00:00:00.000Z",
    "query": "python tutorial",
    "filterUsed": "This month",
    "sortByUsed": "Relevance",
    "videoId": "abc123XYZ",
    "watchUrl": "https://www.youtube.com/watch?v=abc123XYZ",
    "timePosted": "2 days ago",
    "title": "Python Basics for Beginners",
    "description": "Learn variables, loops, and functions in this beginner-friendly Python tutorial.",
    "thumbnail": "https://i.ytimg.com/vi/abc123XYZ/hqdefault.jpg",
    "viewCount": 9876,
    "length": "12:34",
    "durationSeconds": 754,
    "channelId": "UC1234567890",
    "channelName": "Example Coding Channel",
    "channelThumbnail": "https://yt3.ggpht.com/placeholder-avatar=s68-c-k-c0x00ffffff-no-rj",
    "channelUrl": "https://www.youtube.com/channel/UC1234567890",
    "isShort": false
}
```

### Use with n8n, Make, or the Apify API

Use Apify's integration in n8n or Make to run this Actor with your search terms. Wait for the run to finish, then retrieve its default dataset items for the next step in your workflow.

For a custom application, use the endpoints in this Actor's **API** tab to start a run and retrieve its results. You need an Apify API token, but no YouTube Data API key. Apify schedules can repeat searches automatically, and webhooks can notify your workflow when a run finishes.

#### Example payload for workflow integration:

Find captioned videos between 3 and 20 minutes long, uploaded this year, and sorted by view count:

```json
{
    "searchQueries": [
        "apify",
        "scraping"
    ],
    "maxResults": 10,
    "filter": "This year",
    "sortBy": "View count",
    "duration": "3 - 20 minutes",
    "captionsOnly": true
}
```

#### Customize your search

- **Duration:** Set `duration` to `Any` (default), `Under 3 minutes`, `3 - 20 minutes`, or `Over 20 minutes`.
- **Captions:** Set `captionsOnly` to `true` to find videos using YouTube's Subtitles/CC filter. The default is `false`.
- **Result limit:** Set `maxResults` to the maximum number of unique videos you want **per query**. The default is 10. Set it to `0` for no result-count cap; time limits still apply.
- **Combine filters:** Use duration and captions together with upload date and sorting to focus your results.

A video that matches multiple search terms can appear once under each term, so you can see which searches found it. Repeating the exact same search term does not run it twice.

#### What to expect

YouTube may return fewer videos than your requested limit. Each query has a 110-second time limit; a query that exceeds it fails, but results already collected remain available.

Caption availability does not guarantee downloadable transcripts or captions in a specific language. The Actor collects standard video results; dedicated Shorts shelves and other special result sections are not fully covered.

### Frequently asked questions

#### Do I need a YouTube API key or account?

No. Enter search terms in Apify without supplying YouTube credentials. Programmatic access through the Apify API requires an Apify API token.

#### Can I search multiple keywords at once?

Yes. Add several terms to **Search Queries**. **Max Results** applies separately to each unique query, not to the entire run.

#### Does this Actor download captions or transcripts?

No. **Only Videos with Captions** applies YouTube's Subtitles/CC search filter. Use a separate transcript Actor to retrieve available transcript text. Caption discovery does not guarantee that a transcript can be downloaded.

#### Are duplicates removed?

Repeated video IDs are removed within each query. Videos matching different queries remain under each matching term. Separate runs have separate results; compare `query` and `videoId` if you combine their datasets.

#### Can I download the actual videos?

No. This Actor collects search-result metadata and video links, not video files.

### YouTube transcript extraction

Need transcripts for the videos you find? Use [YouTube Transcript Scraper And Formatter](https://apify.com/matthewjames/youtube-transcript-scraper-and-formatter) to retrieve available transcripts in plain text, SRT, or VTT. Pass this Actor's `watchUrl` values into its `videoUrls` input.

Transcript extraction is a separate step with its own pricing and availability limits. A video appearing in a caption-filtered search does not guarantee that its transcript can be retrieved.

# Actor input Schema

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

List of search terms to query YouTube (e.g. "apify tutorial").

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

Optional upload-date filter.

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

Optional sort order (upload date, view count, rating).

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

Use YouTube's native duration filter. Any leaves duration unrestricted.

## `captionsOnly` (type: `boolean`):

Apply YouTube's Subtitles/CC search filter. Does not guarantee downloadable transcripts or a particular caption language.

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

Maximum number of videos to return per query (0 = no limit).

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

Maximum number of parallel search requests.

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

Select which proxies to use or enter custom proxy URLs.

## Actor input object example

```json
{
  "searchQueries": [
    "apify"
  ],
  "filter": "None",
  "sortBy": "Relevance",
  "duration": "Any",
  "captionsOnly": false,
  "maxResults": 10,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("matthewjames/fast-youtube-search-results-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": ["apify"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,matthewjames/fast-youtube-search-results-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/ik3SM9apynGCesLEZ/builds/gdPNVcNqubeSqks2C/openapi.json
