# YouTube Search Scraper — Search Results & Video Data (`hipersoft/youtube-search-scraper`) Actor

Search YouTube by keyword and export the results: video title, URL, channel, view count, published date, duration, description snippet and thumbnail. Sort by relevance, date, views or rating. One clean row per video as JSON, CSV or Excel.

- **URL**: https://apify.com/hipersoft/youtube-search-scraper.md
- **Developed by:** [hiper soft](https://apify.com/hipersoft) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00075 / result scraped

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 Search Scraper — Search Results & Video Data

Run any **YouTube search** and export the results as clean, structured data. Add one or more keywords, choose how to sort, and get one row per video — title, URL, channel, view count, published date, duration, a description snippet and thumbnail. Export to **JSON, CSV or Excel**, or pull straight from the API.

Perfect for **keyword and topic research, competitor and trend analysis, content discovery, influencer sourcing, SEO, and building video datasets** for dashboards or LLMs.

***

### What you get

One flat, ready-to-use record per video result:

| Field | Description |
|---|---|
| `query` | The search keyword that produced the row |
| `videoId` / `url` | The video and its watch link |
| `title` | Video title |
| `channelName` / `channelId` / `channelUrl` | The uploading channel |
| `viewCount` / `viewCountText` | Views (number + label) |
| `publishedText` | When it was published (e.g. "4 years ago") |
| `durationText` / `durationSeconds` | Length |
| `description` | Description snippet from the results page |
| `thumbnail` | Thumbnail image URL |
| `collectedAt` | When the row was scraped |

***

### How to use

#### 1. Add keywords

```json
{
  "searchQueries": ["lofi hip hop", "python tutorial"],
  "sort": "views",
  "maxItems": 200
}
```

#### 2. Sort & limit

- **Sort results by** — *Relevance* (YouTube default), *Upload date*, *View count*, or *Rating*.
- **Max results** — cap the total across all keywords (0 = no limit; the scraper pages deep into the results).

***

### Example output

```json
{
  "query": "python tutorial",
  "videoId": "rfscVS0vtbw",
  "title": "Learn Python - Full Course for Beginners",
  "url": "https://www.youtube.com/watch?v=rfscVS0vtbw",
  "channelName": "freeCodeCamp.org",
  "viewCount": 49309271,
  "publishedText": "6 years ago",
  "durationText": "4:26:52",
  "durationSeconds": 16012,
  "description": "This course will give you a full introduction into all of the core concepts…",
  "thumbnail": "https://i.ytimg.com/vi/rfscVS0vtbw/hq720.jpg",
  "collectedAt": "2026-09-20T06:00:00.000Z"
}
```

***

### Common use cases

- **Keyword & topic research** — see what ranks for a term and how it's framed.
- **Competitor & trend analysis** — track the top videos and channels in a niche.
- **Content discovery** — build watchlists and content ideas at scale.
- **Influencer sourcing** — find channels making videos on your topic.
- **Datasets** — build clean, structured result sets for analysis or model training.

***

### Frequently asked questions

**Do I need any login, account or key?** No. Just add keywords and run.

**How many results can I get?** Set **Max results** to whatever you need (0 = no limit) — the scraper pages deep into each search.

**Can I sort by newest or most viewed?** Yes — use the Sort option (relevance, upload date, view count, rating).

**Can I run several searches at once?** Yes — add multiple keywords and the results are combined.

**What format is the data?** A flat table you can export as JSON, CSV or Excel, or fetch from the Apify API.

***

### Related scrapers

Building a YouTube toolkit? Pair this with our YouTube channel scraper, YouTube comments scraper and YouTube video downloader — all with the same clean, one-row-per-item output.

# Actor input Schema

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

One or more search terms to run on YouTube — e.g. 'lofi hip hop', 'python tutorial', 'iphone 17 review'. Each keyword runs its own search and the results are combined.

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

Relevance (YouTube default), upload date, view count, or rating.

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

Maximum number of results to collect across all keywords (0 = no limit).

## Actor input object example

```json
{
  "searchQueries": [
    "lofi hip hop"
  ],
  "sort": "relevance",
  "maxItems": 100
}
```

# Actor output Schema

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

The results as dataset items.

# 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": [
        "lofi hip hop"
    ]
};

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

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

```

## MCP server setup

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