# YouTube Search Scraper: Videos with Chapters (`farovin/youtube-search-scraper`) Actor

Scrape YouTube search results: videos, Shorts, channels and playlists with YouTube's filters, exact dates, likes, tags and the chapters of each video. $0.50 per 1,000 results, failed results free.

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

## Pricing

from $0.50 / 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.

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

### What you get

Type a search term and get the YouTube search results as data: videos, Shorts, channels or playlists, with YouTube's own filters, exact publish dates, likes, tags, and **the chapters of each video that has them** (title, start time and a link that opens the video at that point).

```json
{
  "position": 1,
  "title": "Learn Python in Less than 10 Minutes for Beginners",
  "channelName": "Indently",
  "viewCount": 1856215,
  "likeCount": 38898,
  "publishedAt": "2021-05-26T12:32:40.000Z",
  "chapters": [
    { "title": "Intro", "startTime": "0:00", "url": "https://www.youtube.com/watch?v=fWjsdhR3z3c&t=0s" },
    { "title": "Variables", "startTime": "0:25", "url": "https://www.youtube.com/watch?v=fWjsdhR3z3c&t=25s" }
  ]
}
```

### How to start

1. Type one or more search terms (or paste YouTube search links).
2. Optionally pick filters: type, upload date, duration, 4K, subtitles and more. Click **Start**.
3. Download as JSON, CSV or Excel. $0.50 per 1,000 results; failed results are not charged.

***

### Full documentation (optional)

Everything below is reference material. You do not need it to get started.

#### Why use this YouTube search scraper?

| Feature | |
|---|---|
| Many search queries in one run, or pasted YouTube search URLs (their filters are kept) | ✅ |
| Result type: videos, Shorts, channels, playlists, movies, or everything mixed | ✅ |
| Sort by relevance or popularity | ✅ |
| Upload date: last hour, today, this week, this month, this year | ✅ |
| Duration: under 3 min, 3–20 min, over 20 min (and the older 4-minute filters) | ✅ |
| Features: HD, 4K, HDR, subtitles, Creative Commons, live, 360°, VR180, 3D, location, purchased | ✅ |
| Country and language of the results | ✅ |
| Exact date range (published after / before), checked against the exact publish date | ✅ |
| Results outside the upload-date filter dropped before charging | ✅ |
| Full description, tags, hashtags, category, family-safe flag | ✅ |
| Exact view count, exact like count, exact publish date and time | ✅ |
| **Chapters on every video result that has them, with a link to each chapter** | ✅ |
| Need the full transcripts too? Use [farovin/youtube-transcripts](https://apify.com/farovin/youtube-transcripts) | ✅ |
| Position of each result in YouTube's ranking | ✅ |
| Channel name, id, handle, link, verified badge, avatar | ✅ |
| No API key, no login, no cookies | ✅ |
| Failed results free, pay only for delivered results | ✅ |

#### Use cases

##### SEO and keyword research

See which videos rank for a search term, in which position, with their titles, tags and chapter titles. Chapter titles show how top creators structure a topic.

##### Competitor and trend monitoring

Schedule a daily run with **Upload date: Today** to catch every new video on your topic, sorted by popularity.

##### Influencer and channel discovery

Search with **Result type: Channels** to get channel names, handles, subscriber counts and verified badges for a niche.

##### Content planning

Collect the chapters of the 50 top videos for a query and see which subtopics they all cover, and which they skip.

##### AI and datasets

Feed titles, descriptions and chapters into an LLM, or build a labelled dataset of videos for a topic. Combine with our [YouTube Transcript Scraper](https://apify.com/farovin/youtube-transcripts) to get the spoken text split by the same chapters.

#### What data can it extract?

| Field | Description |
|---|---|
| `position` | Rank in YouTube's results for the query (1 = top) |
| `searchQuery` | The query that found the result |
| `type` | `video`, `short`, `channel` or `playlist` |
| `videoId`, `url` | Video id and link |
| `title` | Title |
| `channelName`, `channelId`, `channelHandle`, `channelUrl`, `channelIsVerified`, `channelThumbnailUrl` | Channel |
| `descriptionSnippet` | Snippet shown on the search page |
| `description` | Full description |
| `tags`, `hashtags` | Creator tags and hashtags from title and description |
| `viewCount`, `viewCountText` | Views (exact with video details on) |
| `likeCount` | Exact likes; empty when the creator hides them |
| `publishedAt`, `publishedText` | Exact publish time (UTC) and "3 weeks ago" text |
| `durationSeconds`, `durationText` | Length |
| `isLiveNow`, `isLiveContent`, `badges` | Live flags and badges such as 4K, CC, New |
| `category`, `isFamilySafe` | YouTube category and family-safe flag |
| `thumbnailUrl` | Largest thumbnail |
| `chapters` | `[{ title, startSeconds, startTime, url }]` |
| `chaptersSource` | `creator-description`, `youtube-key-moments`, `youtube-auto-generated` or `none` |
| `subscriberCount`, `videoCount` | For channel and playlist results |
| `status`, `charged`, `errorCode`, `error` | Result status; failed items have `charged: false` |
| `scrapedAt` | When the result was scraped |

#### How to scrape YouTube search results

1. Open the Actor and type your search terms in **Search queries**, one per line.
2. Set **Max results per query**.
3. Choose filters if you need them, then click **Start**.
4. Open the **Results** or **Chapters** view, or export to JSON, CSV, Excel or HTML.

#### Input examples

##### Top 100 videos for two queries

```json
{ "searchQueries": ["python tutorial", "learn javascript"], "maxResults": 100 }
```

##### New videos this week, most popular first

```json
{ "searchQueries": ["iphone review"], "uploadDate": "week", "sortBy": "popularity", "maxResults": 50 }
```

##### Exact date range

```json
{ "searchQueries": ["world cup highlights"], "publishedAfter": "2026-06-01", "publishedBefore": "2026-07-31" }
```

##### Long 4K videos with subtitles

```json
{ "searchQueries": ["drone footage"], "duration": "over20", "features": ["4k", "subtitles"] }
```

##### Shorts only, in Greece, in Greek

```json
{ "searchQueries": ["συνταγές"], "type": "shorts", "country": "GR", "language": "el" }
```

##### Channels for a niche

```json
{ "searchQueries": ["home workout"], "type": "channel", "maxResults": 200 }
```

##### A pasted YouTube search link

```json
{ "startUrls": ["https://www.youtube.com/results?search_query=lofi+music&sp=EgIQAg%253D%253D"] }
```

##### Fastest run, search-page data only

```json
{ "searchQueries": ["news"], "includeDetails": false, "maxResults": 500 }
```

#### Output

```json
{
  "status": "ok",
  "charged": true,
  "type": "video",
  "searchQuery": "python tutorial",
  "position": 1,
  "videoId": "fWjsdhR3z3c",
  "url": "https://www.youtube.com/watch?v=fWjsdhR3z3c",
  "title": "Learn Python in Less than 10 Minutes for Beginners (Fast & Easy)",
  "channelName": "Indently",
  "channelId": "UCuudpdbKmQWq2PPzYgVCWlA",
  "channelHandle": "@Indently",
  "channelUrl": "https://www.youtube.com/@Indently",
  "channelIsVerified": true,
  "viewCount": 1856215,
  "likeCount": 38898,
  "publishedText": "5 years ago",
  "publishedAt": "2021-05-26T12:32:40.000Z",
  "durationText": "10:30",
  "durationSeconds": 630,
  "category": "Education",
  "isFamilySafe": true,
  "tags": ["code palace"],
  "hashtags": [],
  "thumbnailUrl": "https://i.ytimg.com/vi/fWjsdhR3z3c/hq720.jpg",
  "chaptersSource": "youtube-auto-generated",
  "chapters": [
    { "title": "Intro", "startSeconds": 0, "startTime": "0:00", "url": "https://www.youtube.com/watch?v=fWjsdhR3z3c&t=0s" },
    { "title": "Variables", "startSeconds": 25, "startTime": "0:25", "url": "https://www.youtube.com/watch?v=fWjsdhR3z3c&t=25s" }
  ],
  "scrapedAt": "2026-10-22T18:47:42.441Z"
}
```

##### A channel result

```json
{ "type": "channel", "title": "Lofi Girl", "channelHandle": "@LofiGirl", "subscriberCount": 15800000, "url": "https://www.youtube.com/@LofiGirl" }
```

#### How to get the chapters of YouTube videos from a search

Leave **Video chapters** on (default). For each video the Actor first reads the creator's chapters from the description, using YouTube's rules (first chapter at 0:00, at least 3 chapters, each at least 10 seconds). If there are none, it uses the chapters YouTube shows under the result in search, which can be the creator's or generated by YouTube; `chaptersSource` tells you which. Every chapter has a `url` that opens the video at that moment.

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

| What | Price |
|---|---|
| Search result delivered | **$0.50 per 1,000** ($0.0005 each) |
| Run start | $0.05 per 1,000 runs ($0.00005 per run), covers server start-up |
| Failed result, video outside your date range | **Free** |

| Run | Cost |
|---|---|
| 100 results | about $0.05 |
| 1,000 results | about $0.50 |
| 10,000 results | about $5.00 |

Apify's free $5 monthly credit covers about 10,000 results a month. Popular alternatives charge $1 to $5 per 1,000 results on the Free plan (Apify Store, 22 Oct 2026). **Max results per query** caps the cost of any run.

#### Use with AI agents: Claude, ChatGPT, Cursor (MCP)

Every Apify Actor can be used by AI agents through the [Apify MCP server](https://mcp.apify.com).

1. Get your Apify API token in [Settings > API & Integrations](https://console.apify.com/settings/integrations).
2. Add the Apify MCP server to your client and enable the Actor `farovin/youtube-search-scraper`.
3. Ask your agent, for example: *"Find the 30 most popular videos about home espresso from this month and list the chapter titles they have in common."*

#### Use in n8n, Make, Zapier and Google Sheets

Use the **Apify** node or app, choose **Run Actor**, select `farovin/youtube-search-scraper` and pass the JSON input. Export every run to Google Sheets, or trigger a webhook when a run finishes.

#### Use from code

##### Python

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("farovin/youtube-search-scraper").call(run_input={
    "searchQueries": ["python tutorial"],
    "maxResults": 50,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["position"], item["title"], len(item.get("chapters", [])))
```

##### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('farovin/youtube-search-scraper').call({
    searchQueries: ['python tutorial'],
    uploadDate: 'month',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((i) => i.title));
```

#### Tips

- **Lower cost per result**: put many queries in one run (the start fee is paid once per run).
- **Faster runs**: turn off **Video details** if you only need search-page data; chapters then come only from what YouTube shows in search.
- **Spreadsheets**: use the **Results** view for flat columns; `chapters` is easier in JSON.
- **Monitoring**: schedule a daily run with **Upload date: Today**.

#### Limitations

- YouTube decides how many results a query has; it usually stops after a few hundred.
- YouTube currently offers only two sort orders (relevance and popularity); use the upload-date filter or the date range for the newest videos.
- Without video details, the date range uses the approximate "3 weeks ago" text.
- Not every video has chapters (in our test run 31 of 60 videos had them); the others have `chaptersSource: "none"`.
- Subscriber counts of channel results are rounded as YouTube shows them (e.g. 286K).
- Comment counts are not included.

#### Troubleshooting

| Symptom | Likely cause | What to do |
|---|---|---|
| `NO_RESULTS` | No result matches the query and filters | Relax the filters. Not charged. |
| Fewer results than **Max results** | YouTube ran out of results, or your date range filtered many out | Use several related queries. Skipped results are not charged. |
| `INVALID_INPUT` | A link that is not a YouTube search link | Paste a `youtube.com/results?search_query=...` link. Not charged. |
| `BLOCKED` | YouTube refused a request after several retries | Run again. Not charged. If it repeats, open an issue. |
| `likeCount` empty | The creator hides likes | Nothing to fix. |

#### Responsible use

Use this Actor only for lawful purposes. It reads public search results and public video information; it does not log in and does not collect comments or viewer data. Respect YouTube's terms and the laws that apply to you.

> Our Actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our Actors, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

#### Our other Actors

- [YouTube Transcript Scraper](https://apify.com/farovin/youtube-transcripts): transcripts and subtitles of videos, channels and playlists, split into chapters.

#### FAQ

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

No. The Actor works without any key, login or cookies.

##### Is there a free tier?

Yes. Apify gives every account $5 of free usage per month, which covers about 10,000 results.

##### Does the date filter really work?

YouTube's own upload-date filter sometimes lets older videos through. With video details on, the Actor checks each result's exact publish date and drops those outside the period before charging.

##### Can I get Shorts, channels or playlists?

Yes, with **Result type**.

##### Can I use YouTube search operators?

Yes. Quotes, `-word` and other operators are passed to YouTube as typed.

##### Am I charged for failed results?

No. Every item shows `charged: true` or `false`.

##### Can I run it on a schedule or via API?

Yes. Use Apify schedules, the API, webhooks, or n8n, Make and Zapier.

##### How do I report a problem?

Open an issue in the **Issues** tab with your input.

##### Did it help you?

If this Actor saved you time, a short review on Apify Store helps other people find it. Thank you!

# Actor input Schema

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

What you would type into the YouTube search box, one per line, e.g. "python tutorial". Search operators such as quotes and -word are passed to YouTube as typed.

## `startUrls` (type: `array`):

Optional: full YouTube search links (youtube.com/results?search_query=...). The filters already in the link (sp=) are kept unless you set filters below.

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

How many results to deliver for each query. YouTube usually stops after a few hundred results for one query.

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

Which kind of results to collect. Uses YouTube's own Type filter.

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

YouTube's sort order. YouTube currently offers only these two; for the newest videos use "Upload date" or "Published after".

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

YouTube's upload-date filter. With video details on, results YouTube lets through from outside the period are dropped and not charged.

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

YouTube's duration filter.

## `features` (type: `array`):

YouTube's feature filters; all selected must match.

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

Keep only videos published on or after this date (YYYY-MM-DD). Checked against the exact publish date when video details are on; skipped videos are not charged.

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

Keep only videos published on or before this date (YYYY-MM-DD). Skipped videos are not charged.

## `includeChapters` (type: `boolean`):

Add each video's chapters (title, start time and a link that opens the video at that point). Read from the creator's description, or from the chapters YouTube shows in search.

## `includeDetails` (type: `boolean`):

Add the full description, tags, hashtags, exact view count, exact publish date, category and family-safe flag (one small extra request per video). Turn off for the fastest run with search-page data only.

## `includeLikes` (type: `boolean`):

Add the exact like count (needs video details on). Empty when the creator hides likes.

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

Two-letter country code YouTube localises results for, e.g. US, GB, DE, GR.

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

Interface language code, e.g. en, de, el. Affects texts like "3 weeks ago" and can change ranking.

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

How many videos are enriched at the same time.

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

Leave empty: on Apify the Actor uses residential proxy automatically, included in the price.

## Actor input object example

```json
{
  "searchQueries": [
    "python tutorial"
  ],
  "maxResults": 10,
  "type": "video",
  "sortBy": "relevance",
  "uploadDate": "any",
  "duration": "any",
  "includeChapters": true,
  "includeDetails": true,
  "includeLikes": true,
  "country": "US",
  "language": "en",
  "maxConcurrency": 5
}
```

# Actor output Schema

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

All results of the run as JSON. Add ?format=csv or ?format=xlsx for other formats.

# 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": [
        "python tutorial"
    ],
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("farovin/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": ["python tutorial"],
    "maxResults": 10,
}

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

```

## MCP server setup

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