# YouTube Search Scraper: Videos, Shorts, Channels, Playlists (`themineworks/youtube-search-scraper`) Actor

Scrape YouTube search results by keyword: one row per video, Short, channel or playlist with views, upload date, duration, channel, thumbnail, description snippet and badges (live, 4K, CC). Filter by type, upload date, duration, features, country and language. Batch keywords. No login, no API key.

- **URL**: https://apify.com/themineworks/youtube-search-scraper.md
- **Developed by:** [The Mine Works](https://apify.com/themineworks) (community)
- **Categories:** Videos, Social media, Lead generation
- **Security:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.36 / 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.
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: Videos, Shorts, Channels, Playlists

[![2,000 YouTube search results with views, upload date, length and channel in 131 seconds](https://api.apify.com/v2/key-value-stores/cUXz95yxflDho41nn/records/youtube-search-scraper-hero.png)](https://console.apify.com/actors/lohYrScG415QWgNWg/input?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

From **The Mine Works**, makers of [YouTube Comments Scraper](https://apify.com/themineworks/youtube-comments-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral) and [YouTube Email Finder](https://apify.com/themineworks/youtube-creator-email-finder?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral), with over 290,000 runs across 310+ public actors.

Updated 31 Oct 2026: first release. Keyword search with YouTube's own filters (type, upload date, duration, features, country, language), relevance, popularity or newest first, a batch of keywords per run, pasted search links, and one flat row per video, Short, channel or playlist. Bookmark this Actor on its Store page so it is one click away next time.

### Why choose this actor?

- **Every number in its own column.** `views` as a whole number (the exact count YouTube shows, not 1.1M), `duration_seconds`, `published_text` as shown ("2 months ago") and `published_at_estimate` as a date you can sort on, with `published_precision` saying how close it is. Badges come as flags: `is_live`, `is_upcoming`, `is_4k`, `has_captions`, `is_new`, `is_short`.
- **Videos, Shorts, channels and playlists from one actor.** Shorts rows carry the channel, upload age and length, which YouTube's Shorts shelf cards leave out. Channel rows carry the @handle and subscribers; playlist rows the video count and the owner. Collaboration videos list every channel in `collaborators`.
- **Built for batches and pipelines.** Up to 500 keywords per run, read 4 at a time, each with its rank (`position`) and the youtube.com link of the same search (`search_url`). One keyword per call from Clay, n8n or an AI agent works just as well.
- **Pay per result, nothing for errors.** The summary and error rows, duplicates found by two keywords and rows outside your upload window are never charged. No YouTube account, cookies or API key, and no quota to manage.

[![Run it on Apify](https://api.apify.com/v2/key-value-stores/cUXz95yxflDho41nn/records/button-run.png)](https://console.apify.com/actors/lohYrScG415QWgNWg/input?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Part of The Mine Works Social media and video family:** [Threads Scraper](https://apify.com/themineworks/threads-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral), [Reddit Scraper](https://apify.com/themineworks/reddit-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral), [Threads Search Scraper](https://apify.com/themineworks/threads-search-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral), [Instagram Profile Scraper](https://apify.com/themineworks/instagram-profile-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral), [Instagram Followers & Following](https://apify.com/themineworks/instagram-followers-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral), [Reddit Search Scraper](https://apify.com/themineworks/reddit-search-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral).

### Try it in one minute

Paste this into the input (JSON view) and press Start. It returns the first 20 videos YouTube shows for "lab grown diamonds". It took 4 seconds in our test run:

```json
{
  "searchQueries": ["lab grown diamonds"],
  "maxResultsPerKeyword": 20
}
```

Put several keywords on separate lines to run several searches at once, or paste a search link from your browser. A result that two of your keywords find is delivered once.

Apify's free plan includes $5 of credit every month, which covers about 5,400 results at this actor's price.

#### Copy to your AI assistant

```text
themineworks/youtube-search-scraper on Apify. Searches YouTube by keyword and returns one flat row per result (video, Short, channel or playlist) with views, upload date as shown and as an estimated date, length, channel, thumbnail, description snippet and badges, with no login and no API key. It never downloads video or audio. Call ApifyClient("TOKEN").actor("themineworks/youtube-search-scraper").call(run_input={"searchQueries": ["lab grown diamonds"], "maxResultsPerKeyword": 50}), then client.dataset(run["defaultDatasetId"]).list_items().items. Inputs: searchQueries (list of keywords or youtube.com/results links, up to 500), maxResultsPerKeyword (default 50, 1 to 1000), type (video, shorts, channel, playlist, all; default video), uploadDate (any, hour, today, week, month, year), duration (any, under3, 3to20, over20), sortBy (relevance, popularity, date), features (list of live, 4k, hd, subtitles, creative_commons, 360, vr180, 3d, hdr, location), country (two letters, default US), language (default en), excludeShorts (bool), deduplicate (default true). Result rows have no _type field and carry result_type, position, keyword, video_id, playlist_id, title, url, channel_name, channel_id, channel_handle, channel_url, channel_is_verified, channel_is_artist, channel_avatar_url, collaborators, subscribers, subscribers_text, views, views_text, views_are_rounded, watching_now, published_text, published_at_estimate, published_precision, duration_text, duration_seconds, thumbnail_url, description_snippet, badges, is_live, is_upcoming, scheduled_start_at, is_4k, has_captions, is_new, is_short, from_shorts_shelf, chapters, playlist_kind, video_count, video_count_text, first_video_id, sample_video_titles, page, search_type, sort_by, country, language, search_url, scraped_at. Each run also writes one row with _type "summary", one with _type "info" when results were delivered, and a row with _type "error" for each input that could not be read; none of these is charged. Full spec: GET https://api.apify.com/v2/acts/themineworks~youtube-search-scraper/builds/default (Bearer TOKEN), which returns inputSchema and readme. Token: https://console.apify.com/account/integrations?fpr=ymnoit&utm_source=apify-readme&utm_medium=referral
```

### Key features

- **YouTube's own filters.** Result type (videos, Shorts, channels, playlists or the All tab), upload date (last hour, today, this week, this month, this year), duration (under 3 minutes, 3 to 20, over 20) and features (live, 4K, HD, subtitles, Creative Commons, 360°, VR180, 3D, HDR, location), the same codes the filter menu on youtube.com sends.
- **Three orders.** Relevance and Popularity are YouTube's own. Newest first is built by the actor, because YouTube removed its upload date sort in 2025: it reads every page YouTube serves for the keyword (up to 25) and returns the newest results first.
- **Country and language.** `country` sets the market YouTube ranks for; `language` sets the interface language, which changes the ranking a lot (in our tests only 8 to 12 of the top 20 stayed the same between English and the local language). Upload dates are converted to estimated dates in about 20 languages.
- **Strict upload windows.** YouTube's "last hour" filter lets older videos through. Every row is checked against the window you chose, and rows outside it are dropped and not charged.
- **Pasted search links.** Copy a youtube.com/results link with filters set in your browser; its words, filters and type are used as they are.
- **Stops cleanly.** The first request goes alone, so a run YouTube refuses ends after one request. Six failed pages in a row end the run, two pages with nothing new end a keyword, and the run stops before its time limit and keeps every row. The summary row says why.

### How to use it

#### Basic: the videos for a keyword

```json
{
  "searchQueries": ["crm software", "project management software"],
  "maxResultsPerKeyword": 100
}
```

Each keyword is its own search, labelled in `keyword`, in YouTube's relevance order, with `position` 1 for the top result.

#### What is new this week, newest first

```json
{
  "searchQueries": ["iphone 17 review"],
  "uploadDate": "week",
  "sortBy": "date",
  "maxResultsPerKeyword": 50
}
```

In our test the actor read 25 pages (393 videos from this week) and returned the 50 newest, the first uploaded 2 hours before the run. Schedule it daily to see new videos on a topic as they appear.

#### The most viewed long videos of the month in 4K

```json
{
  "searchQueries": ["travel vlog japan"],
  "sortBy": "popularity",
  "uploadDate": "month",
  "duration": "over20",
  "features": ["4k"],
  "maxResultsPerKeyword": 50
}
```

#### Find channels for creator outreach

```json
{
  "searchQueries": ["lab grown diamonds", "engagement rings"],
  "type": "channel",
  "maxResultsPerKeyword": 200
}
```

Channel rows carry `channel_handle`, `subscribers`, `channel_is_verified` and the description snippet. For their business emails, pass the channel links to [YouTube Email Finder](https://apify.com/themineworks/youtube-creator-email-finder?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral).

#### Shorts on a topic, in another market

```json
{
  "searchQueries": ["diamantes de laboratorio"],
  "type": "shorts",
  "country": "ES",
  "language": "es",
  "maxResultsPerKeyword": 100
}
```

#### Rank tracking: the same video under several keywords

```json
{
  "searchQueries": ["lab grown diamonds", "lab diamonds", "cvd diamonds"],
  "deduplicate": false,
  "excludeShorts": true,
  "maxResultsPerKeyword": 100
}
```

With `deduplicate` off a video found by three keywords comes back three times, each with its `position` for that keyword. Run it on a schedule and compare `position` by `video_id` to follow rankings.

### Input parameters

| Parameter | Type | Default | What it does |
|---|---|---|---|
| `searchQueries` | array of strings | empty | Keywords, one search each, or youtube.com/results links. Up to 500. |
| `maxResultsPerKeyword` | integer | `50` | Most rows per keyword, 1 to 1,000. |
| `type` | string | `video` | `video`, `shorts`, `channel`, `playlist` or `all`. |
| `uploadDate` | string | `any` | `hour`, `today`, `week`, `month` or `year`. |
| `duration` | string | `any` | `under3`, `3to20` or `over20` (minutes). |
| `sortBy` | string | `relevance` | `relevance`, `popularity` (most viewed) or `date` (newest first). |
| `features` | array of strings | empty | `live`, `4k`, `hd`, `subtitles`, `creative_commons`, `360`, `vr180`, `3d`, `hdr`, `location`; all must match. |
| `country` | string | `US` | Two letter country code YouTube ranks for. |
| `language` | string | `en` | Interface language, for example `es`, `de`, `hi`, `ja`. |
| `excludeShorts` | boolean | `false` | Drops Shorts from video results (not charged). |
| `deduplicate` | boolean | `true` | A result found by two keywords is returned once. Off: once per keyword. |
| `proxyConfiguration` | object | Apify Proxy | Datacenter proxy, included in the price. |

### What data do you get?

One row per result. `result_type` says which kind it is: `video`, `short`, `channel` or `playlist`. Result rows have no `_type` field; the summary, info and error rows do, so a filter on `_type` separates them.

| Field | What it is |
|---|---|
| `result_type` | `video`, `short`, `channel` or `playlist` |
| `position` | Rank in YouTube's results for this keyword, 1 = first |
| `keyword` | The keyword that found the result |
| `video_id`, `title`, `url` | Video or Short id, title and link |
| `playlist_id` | Playlist id (playlist rows) |
| `channel_name`, `channel_id`, `channel_handle`, `channel_url` | The channel, e.g. `@OsirisDiamonds` |
| `channel_is_verified`, `channel_is_artist` | Verified check and official artist badge |
| `channel_avatar_url` | Channel picture |
| `collaborators` | Every channel of a collaboration video: `name`, `id`, `handle` |
| `subscribers`, `subscribers_text` | Channel rows: subscribers as a number and as shown |
| `views`, `views_text` | View count as a number, and as shown |
| `views_are_rounded` | True when the count came from a rounded figure such as 757K |
| `watching_now` | Viewers of a live stream |
| `published_text` | Upload age as shown, e.g. `2 months ago`, `Streamed 1 day ago` |
| `published_at_estimate`, `published_precision` | Estimated upload time (ISO 8601) and its precision: minute, hour, day, week, month or year |
| `duration_text`, `duration_seconds` | Length, e.g. `15:20` and `920` |
| `thumbnail_url` | Largest thumbnail on the results page |
| `description_snippet` | The description lines YouTube shows under the result |
| `badges` | Badges as shown: `4K`, `CC`, `New`, `LIVE` and so on |
| `is_live`, `is_upcoming`, `scheduled_start_at` | Live now, or a scheduled premiere or stream and its start time |
| `is_4k`, `has_captions`, `is_new`, `is_short` | Badge flags |
| `from_shorts_shelf` | The Short came from a Shorts shelf card (All tab), which shows no channel, date or length |
| `chapters` | Chapters YouTube lists under the video: `time`, `seconds`, `title` |
| `playlist_kind`, `video_count`, `video_count_text`, `first_video_id`, `sample_video_titles` | Playlist rows |
| `page`, `search_type`, `sort_by`, `country`, `language`, `search_url` | How the result was found |
| `scraped_at` | When the row was read |

**Summary row** (`_type: "summary"`, never charged): `keywords_requested`, `keywords_read`, `keywords_failed`, `keywords_with_no_results`, `pages_read`, `results_found`, `results_delivered`, `charged_for`, `duplicates_skipped`, `outside_upload_window`, `shorts_excluded`, `http_requests`, `http_wire_megabytes`, `ended_on_deadline`, `stopped_by_max_cost`, `stopped_by_block_guard`, `shortfall_reason` when fewer results came back than asked, and `per_keyword`, one entry per keyword with `pages`, `results_found`, `results_delivered`, YouTube's `estimated_results`, a `corrected_query` when YouTube searched a corrected spelling, and why it `stopped`. The same summary is saved as the `OUTPUT` record of the run.

**Error rows** (`_type: "error"`, never charged): one per input that could not be read, with `error_type` (`invalid_url`, `blocked`, `fetch_error`), `identifier`, `reason` and `http_status`.

#### Stable fields for automations

These were present in every row of our 2,000 row test run (20 keywords, 100 videos each), and their names will not change:

| Field | What it is |
|---|---|
| `result_type` | Kind of result |
| `video_id` | The key to store and join on |
| `title` | Video title |
| `url` | Link to the video |
| `channel_name` | Channel |
| `channel_id` | Channel id |
| `thumbnail_url` | Thumbnail |
| `description_snippet` | Description lines |
| `is_short` | Short or not |
| `keyword` | Search that found it |
| `position` | Rank in that search |

Nearly always there: `views` and `duration_seconds` on every row except live streams (1,984 of 2,000), `published_text` and `published_at_estimate` on 1,981 (not on live streams, and 3 videos YouTube showed without an age), `channel_handle` on 1,956. Optional, present only when YouTube shows them: `chapters` (746 of 2,000), `badges` with at least one badge (1,189), `collaborators` (27), `watching_now` (live streams), `scheduled_start_at` (premieres). Channel rows have no `video_id`; playlist rows have `playlist_id` instead.

#### Output examples

One video from the "solar panels" search (test run, 31 Oct 2026, trimmed to two chapters):

```json
{
  "result_type": "video",
  "position": 1,
  "keyword": "solar panels",
  "video_id": "XJRwv740e8Q",
  "title": "Start Buying THESE Solar Panels",
  "url": "https://www.youtube.com/watch?v=XJRwv740e8Q",
  "channel_name": "The Solar Lab Plus",
  "channel_id": "UCDEUipZ8ejNl6oQ086So7OQ",
  "channel_handle": "@TheSolarLabPlus",
  "channel_url": "https://www.youtube.com/@TheSolarLabPlus",
  "channel_is_verified": false,
  "views": 156904,
  "views_text": "156,904 views",
  "published_text": "3 months ago",
  "published_at_estimate": "2026-07-30T19:55:06.694Z",
  "published_precision": "month",
  "duration_text": "7:16",
  "duration_seconds": 436,
  "thumbnail_url": "https://i.ytimg.com/vi/XJRwv740e8Q/hq720.jpg",
  "description_snippet": "Solar Panels at Signature Solar* ➡ https://signaturesolar.com/all-products/solar-panels/?ref=thesolarlab ➡ Get $50 Off with ...",
  "badges": ["4K", "CC"],
  "is_live": false,
  "is_4k": true,
  "has_captions": true,
  "is_short": false,
  "chapters": [
    { "time": "0:00", "seconds": 0, "title": "Why We Never Recommend Brand Name Solar Panels" },
    { "time": "1:06", "seconds": 66, "title": "You're Paying For The Logo" }
  ],
  "page": 1,
  "search_type": "video",
  "country": "US",
  "language": "en",
  "search_url": "https://www.youtube.com/results?search_query=solar+panels&sp=EgIQAQ%3D%3D"
}
```

A Short from `type: "shorts"` (same day, trimmed):

```json
{
  "result_type": "short",
  "position": 3,
  "keyword": "iphone 17",
  "video_id": "N8_s-9pIihk",
  "title": "Haven Unboxes her BRAND NEW iPhone 17!! #unboxing #iphone17",
  "url": "https://www.youtube.com/shorts/N8_s-9pIihk",
  "channel_name": "Garza Crew",
  "channel_handle": "@garzacrew",
  "views": 10313384,
  "views_text": "10M views",
  "published_text": "9 months ago",
  "published_at_estimate": "2026-01-30T19:49:40.536Z",
  "duration_seconds": 29,
  "is_short": true
}
```

A channel from `type: "channel"` and a playlist from `type: "playlist"` (trimmed):

```json
{
  "result_type": "channel",
  "position": 1,
  "keyword": "lab grown diamonds",
  "title": "Lab Grown Diamonds By Quinn's Goldsmith",
  "url": "https://www.youtube.com/@LabGrownDiamondInfo",
  "channel_id": "UCJPb2Xc8pDSEbUcYcZdabIQ",
  "channel_handle": "@LabGrownDiamondInfo",
  "channel_is_verified": false,
  "subscribers": 19600,
  "subscribers_text": "19.6K subscribers",
  "description_snippet": "Buying a diamond shouldn't be confusing. Lab Grown Diamonds by Quinn's Goldsmith is dedicated to helping you understand lab ..."
}
```

```json
{
  "result_type": "playlist",
  "position": 1,
  "keyword": "lab grown diamonds",
  "playlist_id": "PLd52xuTSbxmd92F3v_1C9U3RQ3dsY58YH",
  "title": "Lab created Diamonds",
  "url": "https://www.youtube.com/playlist?list=PLd52xuTSbxmd92F3v_1C9U3RQ3dsY58YH",
  "channel_name": "The Chainary Inc.",
  "video_count": 7,
  "first_video_id": "kkQLmnY9aUI",
  "sample_video_titles": ["Thollot and Fox News Denver Report on Lab Created Diamonds"]
}
```

The summary row of the 20 keyword run, trimmed:

```json
{
  "_type": "summary",
  "keywords_requested": 20,
  "keywords_read": 20,
  "pages_read": 121,
  "results_found": 2141,
  "results_delivered": 2000,
  "http_requests": 121,
  "http_wire_megabytes": 4.35,
  "per_keyword": [
    { "keyword": "crm software", "pages": 6, "results_found": 107, "results_delivered": 100, "estimated_results": 6440988, "stopped": "max_results_reached" }
  ]
}
```

An error row for a link that is not a YouTube search (nothing charged):

```json
{ "_type": "error", "error_type": "invalid_url", "identifier": "https://www.youtube.com/watch?v=abc", "reason": "Not a YouTube search link. Paste a link that starts with https://www.youtube.com/results?search_query=, or type the words themselves." }
```

### Pricing

Pay per event: you pay for the results you receive, plus a flat $0.001 per run, whatever memory you choose. Every result type costs the same.

| Event | When it is charged | Free plan | Bronze (Starter) | Silver (Scale) | Gold (Business) |
|---|---|---|---|---|---|
| `result-scraped` | Once per result row stored in your dataset | $0.90 per 1,000 | $0.54 per 1,000 | $0.45 per 1,000 | $0.36 per 1,000 |
| `run-start` | Once per run, after the first result row is stored | $0.001 | $0.001 | $0.001 | $0.001 |

The price of one result is the price per 1,000 divided by 1,000.

Never charged:

- inputs that are neither keywords nor YouTube search links (each gets an error row);
- a result that a second keyword of the same run finds again, while `deduplicate` is on;
- rows outside your upload date window, and Shorts left out by `excludeShorts`;
- results past your `maxResultsPerKeyword`, and the extra pages read for newest first;
- the summary, info and error rows;
- a run that delivers no result: the start fee is charged only after the first result row is stored;
- anything past your "Max cost per run". The actor checks the budget before each batch of rows and stops while the total is still below your limit, so the run ends SUCCEEDED with a partial result and a status message saying so.

### Run it on a schedule

1. Open the actor in Apify Console, set your input and click **Save as a new task**.
2. In the task, open **Schedules**, click **Add schedule** and pick how often (every day, every Monday at 08:00 and so on).
3. For new uploads on a topic, use `uploadDate: "today"` and `sortBy: "date"` on a daily schedule. For rank tracking, keep the same keywords and compare `position` by `video_id` between runs.
4. Optional: add an integration (Google Sheets, Slack, a webhook) so each run lands where your team works.

### FAQ

#### What does this actor read?

YouTube's public search results, as anyone sees them on youtube.com without logging in, through the same call the results page makes. It does not log in, does not use the YouTube Data API and has no quota. It never downloads video or audio; thumbnails are links.

#### How many results can I get per keyword?

Up to 1,000, but YouTube itself stops serving a search after a while: in our tests a video search ended between 330 and 390 results (about 20 pages), a Shorts search near 180. The summary says when YouTube ran out before your limit. A keyword ends when YouTube has no next page, two pages in a row bring nothing new, or `maxResultsPerKeyword` is reached. More keywords give more results.

#### Why is "Newest first" not a YouTube setting?

YouTube removed sorting search by upload date (and by rating) in 2025. The old codes are still accepted and ignored: we compared them with relevance on four keywords and got the same order. So the actor sorts itself: it reads every page YouTube serves for the keyword (up to 25) and returns the newest first by the upload age on each video. With an upload date filter (today, this week) that is the full list of recent uploads YouTube will show for the keyword.

#### How exact is the upload date?

YouTube's results page shows only an age ("3 hours ago", "2 years ago"). `published_at_estimate` is the time of the run minus that age, and `published_precision` says how close it is: within an hour for "3 hours ago", within a year for "2 years ago". `published_text` keeps the text as shown.

#### Why do some Shorts have no channel or date?

On the All tab, YouTube shows Shorts as shelf cards with only a title, views and a thumbnail; those rows have `from_shorts_shelf: true`. With `type: "shorts"` the actor reads YouTube's Shorts results from the mobile site instead, where every Short carries its channel, upload age, length and exact views.

#### What do country and language change?

`country` is the market YouTube ranks for. `language` is the interface language: it changes the ranking (results in that language come first) and the language of texts such as "hace 2 meses". Views and lengths are read in any language; estimated dates work in about 20 major languages, and `published_text` is always kept.

#### How long does a run take?

In our tests from a laptop: 4 seconds for the "Try it" input, 44 seconds for 5 keywords of 100 videos, 131 seconds for 20 keywords of 100 (2,000 rows), and 93 seconds for a newest first search that read 25 pages. Runs on Apify are usually faster. The default time limit is 3,600 seconds; the actor stops before it and keeps every row.

#### Do I need an account, cookies, an API key or a proxy?

No. The actor reads public pages over Apify Proxy, which is included. YouTube answered every one of our test requests.

#### Which formats can I download?

JSON, CSV, Excel, XML, RSS and HTML from the run's Storage tab or through the API. The dataset has three ready views: Results, Channels and Upload dates. In CSV and Excel, `chapters` and `collaborators` are flattened into columns such as `chapters/0/title`.

#### Can I use it from Claude, ChatGPT or Cursor (MCP)?

Yes, through Apify's MCP server. Connector URL: https://mcp.apify.com/?tools=themineworks/youtube-search-scraper

- Claude: Settings > Connectors > Add custom connector, paste the URL, sign in with Apify.
- ChatGPT: turn on developer mode, add an MCP connector with the URL, sign in with Apify.
- Cursor or VS Code: add it as an HTTP MCP server with that URL.
- Claude Code: `claude mcp add -t http youtube-search-scraper "https://mcp.apify.com/?tools=themineworks/youtube-search-scraper"`

#### Is it legal to scrape YouTube search results?

The actor reads public search results that YouTube shows to anyone without logging in, and only the public facts on them: titles, channel names, counts and dates. It uses `/youtubei/`, the call the results page itself makes. You are responsible for how you use the data and for following YouTube's terms and the law, including data protection law such as GDPR and CCPA. This is general information, not legal advice. YouTube is a trademark of Google LLC; this actor is independent and not affiliated with it.

### Integrations

- **Google Sheets**: send each run's results to a sheet with Apify's Google Sheets integration; one row per result fits a sheet as is.
- **Make, Zapier and n8n**: start a run and read its dataset with the Apify apps and nodes, for example "new videos on our keywords every morning to Slack".
- **Webhooks**: have Apify call your URL when a run succeeds, then fetch the dataset.
- **API and SDKs**: run it from Python or JavaScript with the Apify client, or with a plain HTTP call (see "Copy to your AI assistant" above).
- **MCP clients**: Claude, ChatGPT, Cursor and VS Code can run it as a tool through the connector URL in the FAQ.

### More from The Mine Works

**Social media and video**

- [Threads Scraper](https://apify.com/themineworks/threads-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Reddit Scraper](https://apify.com/themineworks/reddit-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Threads Search Scraper](https://apify.com/themineworks/threads-search-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Instagram Profile Scraper](https://apify.com/themineworks/instagram-profile-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Instagram Followers & Following](https://apify.com/themineworks/instagram-followers-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Reddit Search Scraper](https://apify.com/themineworks/reddit-search-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Twitter / X Scraper](https://apify.com/themineworks/twitter-x-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [YouTube Transcript](https://apify.com/themineworks/youtube-transcript-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Xiaohongshu (RED) Scraper](https://apify.com/themineworks/xiaohongshu-explore-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Telegram Channel Scraper](https://apify.com/themineworks/telegram-channel-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Telegram Channel Finder](https://apify.com/themineworks/telegram-channel-finder?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Pinterest Profile Scraper](https://apify.com/themineworks/pinterest-profile-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Leads and business directories**

- [B2B Leads Finder](https://apify.com/themineworks/b2b-leads-finder?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Skip Trace Lookup](https://apify.com/themineworks/skip-trace-lookup?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Google Maps Email Scraper](https://apify.com/themineworks/maps-leads?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [2GIS Places Scraper](https://apify.com/themineworks/2gis-places-search?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Marketing, SEO and reviews**

- [Facebook Ad Library Scraper](https://apify.com/themineworks/meta-ad-library-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Google Ads Transparency Scraper](https://apify.com/themineworks/google-ads-transparency?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Similarweb Scraper](https://apify.com/themineworks/similarweb-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Google News Scraper](https://apify.com/themineworks/google-news?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**LinkedIn**

- [LinkedIn Company Scraper](https://apify.com/themineworks/linkedin-company-details?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [LinkedIn Post Scraper](https://apify.com/themineworks/linkedin-post-search?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [LinkedIn Employees Scraper](https://apify.com/themineworks/linkedin-employees?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [LinkedIn Profile Scraper](https://apify.com/themineworks/linkedin-profile-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Real estate**

- [Zillow Rentals Scraper](https://apify.com/themineworks/zillow-rental-listings?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Zillow Sold Comps Scraper](https://apify.com/themineworks/zillow-recently-sold?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [India Real Estate MCP](https://apify.com/themineworks/india-real-estate-mcp?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Housing.com Scraper](https://apify.com/themineworks/housing-com-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Science, health and government data**

- [Academic Research MCP](https://apify.com/themineworks/academic-research-mcp?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [CourtListener Scraper](https://apify.com/themineworks/courtlistener-court-records?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Socrata Open Data Scraper](https://apify.com/themineworks/socrata-open-data?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [OpenAlex Scraper](https://apify.com/themineworks/openalex-scholarly-works?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Jobs and hiring**

- [Foundit Monster India Jobs](https://apify.com/themineworks/foundit-jobs-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Hirist Jobs Scraper](https://apify.com/themineworks/hirist-jobs-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [India Jobs MCP](https://apify.com/themineworks/india-jobs-mcp?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Naukri Jobs Scraper](https://apify.com/themineworks/naukri-jobs?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Company and business data**

- [Company Domain Finder](https://apify.com/themineworks/company-domain-finder?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [GST Taxpayer Lookup](https://apify.com/themineworks/gst-taxpayer-lookup?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Company KYB Resolver](https://apify.com/themineworks/company-identity-resolver?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [SEC EDGAR Filings Scraper](https://apify.com/themineworks/sec-edgar-filings?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**E-commerce and marketplaces**

- [Ozon.ru Scraper](https://apify.com/themineworks/ozon-product-search?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [⭐ Amazon Reviews Scraper](https://apify.com/themineworks/amazon-reviews?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Amazon Product Scraper](https://apify.com/themineworks/amazon-products?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Etsy Listings Scraper](https://apify.com/themineworks/etsy-search-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Food and local services**

- [NoBroker Scraper](https://apify.com/themineworks/nobroker-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Swiggy Restaurant Scraper](https://apify.com/themineworks/swiggy-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Zomato Scraper](https://apify.com/themineworks/zomato-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Developer and AI tools**

- [Website to Markdown Crawler](https://apify.com/themineworks/rag-crawler?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [GitHub Skill Finder](https://apify.com/themineworks/github-skill-discovery?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [GitHub Repo Scraper](https://apify.com/themineworks/github-repo-intelligence?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [GitHub Trending Scraper](https://apify.com/themineworks/github-trending-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**More tools**

- [G2 Reviews Scraper](https://apify.com/themineworks/g2-reviews-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Naver Blog Scraper](https://apify.com/themineworks/naver-blog-posts-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [WeChat Article Scraper 微信公众号文章](https://apify.com/themineworks/wechat-article-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Taobao Products Scraper 淘宝 天猫](https://apify.com/themineworks/taobao-products-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

### Support

Found a keyword that returns fewer results than youtube.com, or a field that comes back empty? Open an issue in the Issues tab with the input and the run ID, and we will look at it. For a field you need or a new source, email dmineworks@gmail.com.

*Search YouTube by keyword and get every video, Short, channel or playlist back as one row, with views, upload date, length, channel, thumbnail and badges, no login and no API key.*

# Actor input Schema

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

What you would type in the YouTube search box, one keyword per line. Each keyword is one search. You can also paste a youtube.com/results link copied from your browser: its own filters are used for that line. Up to 500 keywords per run.

## `maxResultsPerKeyword` (type: `integer`):

The most rows to return for each keyword, 1 to 1,000. YouTube serves about 20 results a page and a video search usually ends near 380 results.

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

Videos (Shorts that YouTube lists among the videos are included and marked is_short), Shorts only, channels, playlists, or everything YouTube shows on its All tab.

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

Only results uploaded inside this window. Rows are also checked against the window, so results YouTube lets through from outside it are dropped and never charged.

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

Video length, as YouTube's own duration filter.

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

Relevance and Popularity (most viewed first) are YouTube's own orders. Newest first: YouTube no longer sorts search by upload date, so the actor reads every page YouTube serves for the keyword and returns the newest results first, by the upload age shown on each video. Pair it with an upload date filter for a complete list of recent uploads.

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

YouTube's feature filters. Several together must all match.

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

Two letter country code YouTube ranks the results for, for example US, GB, IN, DE or BR.

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

YouTube interface language, for example en, es, de, pt, hi or ja. It changes the ranking (results in that language come first) and the language of the upload date and view texts. Estimated upload dates are worked out for about 20 major languages.

## `excludeShorts` (type: `boolean`):

On: Shorts that YouTube mixes into video results are dropped and not charged, so you get long form videos only.

## `deduplicate` (type: `boolean`):

On: a video, channel or playlist that two of your keywords find is delivered and charged once, under the first keyword. Off: it is returned for every keyword that finds it, with its rank in each, which suits rank tracking.

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

Apify Proxy (datacenter) is used by default and is included in the price. Change it only if you know you need to.

## Actor input object example

```json
{
  "searchQueries": [
    "lab grown diamonds"
  ],
  "maxResultsPerKeyword": 20,
  "type": "video",
  "uploadDate": "any",
  "duration": "any",
  "sortBy": "relevance",
  "features": [],
  "country": "US",
  "language": "en",
  "excludeShorts": false,
  "deduplicate": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (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": [
        "lab grown diamonds"
    ],
    "maxResultsPerKeyword": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("themineworks/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": ["lab grown diamonds"],
    "maxResultsPerKeyword": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("themineworks/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": [
    "lab grown diamonds"
  ],
  "maxResultsPerKeyword": 20
}' |
apify call themineworks/youtube-search-scraper --silent --output-dataset

```

## MCP server setup

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