# YouTube Search API & Scraper - Videos, Shorts & Channels (`rocketyard/youtube-search-scraper`) Actor

YouTube Search API: returns the results of YouTube searches (rank, title, channel and more) over REST. Filter by type (videos, Shorts, channels, playlists, live), upload date and length, or sort by views, with YouTube's own filters. JSON, CSV or Excel. $1.00 per 1,000 results, no subscription.

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

## Pricing

from $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 API & Scraper - Videos, Shorts & Channels

**YouTube Search API & Scraper** is a REST API on the Apify platform: one request returns the results of any YouTube search: videos, Shorts, channels and playlists, ranked as YouTube lists them, as JSON, CSV or Excel. You can also run it from a form in the Apify Console, without code.

### What does YouTube Search API & Scraper do?

YouTube Search API & Scraper returns the results of YouTube searches: one clean record per search result, with typed values (numbers, booleans, ISO dates) ready for spreadsheets, databases and AI pipelines.

- YouTube's own filters: type (videos, Shorts, channels, playlists, live now), upload date (last hour to this year), length and popularity
- Up to 1,000 results per search, page after page, each with its rank in the search
- Videos, Shorts, channels and playlists in one typed record shape: IDs, URLs, titles, channel with handle and verified badge, views as numbers, length in seconds, live and Shorts flags
- A result listed twice (on two pages, or in a Shorts shelf) is stored and charged once
- An error item with a clear code for every search that yields nothing, never charged
- Plain HTTP, no browser, no login, no API key or quota. Pay only per result: no monthly rental, no minimums

### Use cases

- **Track where your videos and your competitors' videos rank for the keywords you care about**
- **Research a topic: what gets made, by whom, how long it runs and how many views it gets**
- **Find creators and channels for a niche or a campaign by keyword**
- **Collect fresh videos on a topic every hour or every day for monitoring, dashboards or an LLM**

### How it compares

| YouTube search result scraper | Users (last 30 days) | Successful runs (last 30 days) | Price per 1,000 results |
| --- | --- | --- | --- |
| Youtube Search Api | 963 | 99.4% | $1.00 |
| YouTube Search Scraper ($0.5/1000 results) | 927 | 99.9% | $5.00 |
| YouTube Search Scraper - Videos & Shorts by Keyword | 856 | 98.6% | $1.20 |
| **This Actor** | new | every release is tested on live pages first | **$1.00** |

Apify Store data from 2026-11-12, free-plan prices. Prices and stats change; check each listing before you compare.

### YouTube Search API

Every Apify Actor is also a REST endpoint, so YouTube Search API & Scraper works as a YouTube Search API, a YouTube search results API or a YouTube keyword search API, without a server of your own. One `POST` starts a run, waits for it and returns the results:

```text
POST https://api.apify.com/v2/acts/rocketyard~youtube-search-scraper/run-sync-get-dataset-items
```

Send your [Apify API token](https://console.apify.com/settings/integrations) in the `Authorization` header and the [input](#input-example) as the JSON body. Add `?format=csv` or `?format=xlsx` to get CSV or Excel instead of JSON. The request waits up to 300 seconds; for a longer run, start it with `POST /v2/acts/rocketyard~youtube-search-scraper/runs` and read the dataset when it finishes.

### How it works

A YouTube search page loads its results from YouTube's search endpoint as JSON, 20 or so at a time, and asks for the next ones with a continuation token as you scroll. The Actor sends the same logged-out requests over plain HTTP, with no browser, login or cookies: your query with the `params` value YouTube's own filter menu builds for the type, upload date, length and sort you pick, then the continuation token of each answer, with a random pause of 300 to 800 ms between requests. The web client version the endpoint expects is read once per run from a 3 KB answer YouTube serves to every logged-out visitor, and checked before use. Each result becomes one typed record: its type and rank, the video, Short, channel or playlist ID and URL, the title, the channel with its handle and verified badge, the view count as a number and as shown, the age, the length in seconds, live and Shorts flags, the thumbnail, the description snippet and the badges. A result listed twice, on two pages or in a shelf, is stored and charged once. It does not check robots.txt, and YouTube's robots.txt disallows the /results and /youtubei/ paths of the search page and its endpoint.

### How to use it

1. Click **Try for free**.
2. Add what you are looking for to **Search queries**, or paste YouTube search URLs.
3. Pick a **Type**, **Upload date**, **Length** or **Sort by** if you need them, and set **Max results per search** (up to 1,000).
4. Click **Start**, then download results as JSON, CSV, Excel or via the API.

### Input

| Field | JSON key | What it does |
|---|---|---|
| Search queries | `queries` | What to search for, as you would type it into YouTube. Each query is one search with the filters below. |
| YouTube search URLs | `startUrls` | Search pages copied from youtube.com (https://www.youtube.com/results?search_query=...). Each keeps the filters picked on YouTube (the sp= part of the URL); the filter inputs below apply to Search queries only. |
| Max results per search | `maxResultsPerQuery` | Stop each search after this many results. YouTube lists about 20 per page, so the Actor reads one page per 20 results. A search with fewer results stops at its last page. |
| Type | `type` | What to search for. Everything: what the search page lists, in its order, including the Shorts shelves it mixes in (`shelf` names them). Live now: streams that are live at the moment. |
| Upload date | `uploadDate` | Only results uploaded in this period. YouTube offers it for videos, Shorts and live streams, not for channels and playlists. |
| Length | `duration` | Only videos of this length. YouTube offers it for videos and live streams, not for Shorts, channels and playlists. |
| Sort by | `sortBy` | Relevance, or popularity (most viewed first). YouTube no longer sorts search results by upload date or rating; use Upload date to keep recent results only. |
| Max results in total | `maxItems` | Stop the run after this many results, over all searches. Empty means no limit beyond Max results per search. |
| Max concurrency | `maxConcurrency` | Searches run in parallel. A pause of 300 to 800 ms between requests to YouTube always applies, over all of them. |
| Proxy configuration | `proxyConfiguration` | Optional proxy. YouTube ranks results partly by where a request comes from, so a proxy in another country can return other results. |

### Input example

```json
{
  "queries": [
    "lofi hip hop",
    "how to cook rice"
  ],
  "type": "video",
  "uploadDate": "year",
  "sortBy": "relevance",
  "maxResultsPerQuery": 300
}
```

### Output example

A real record from the latest test run (youtube.com) on 2026-11-12. Fields the page didn't publish are left out here; the Actor returns them as `null`.

```json
{
  "url": "https://www.youtube.com/watch?v=CLeZyIID9Bo",
  "type": "video",
  "position": 6,
  "query": "lofi hip hop",
  "searchUrl": "https://www.youtube.com/results?search_query=lofi+hip+hop&sp=EgIQAQ%253D%253D",
  "videoId": "CLeZyIID9Bo",
  "title": "Chill Lofi Mix [chill lo-fi hip hop beats]",
  "channelId": "UCkKT4qf-TcPFOmpqhTawrGA",
  "channelName": "Settle",
  "channelHandle": "@settlefm",
  "channelUrl": "https://www.youtube.com/@settlefm",
  "channelVerified": false,
  "viewCount": 35278018,
  "viewCountText": "35,278,018 views",
  "publishedText": "4 years ago",
  "durationSeconds": 6292,
  "durationText": "1:44:52",
  "isShort": false,
  "isLive": false,
  "isUpcoming": false,
  "thumbnailUrl": "https://i.ytimg.com/vi/CLeZyIID9Bo/hq720.jpg?sqp=-oaymwExCNAFEJQDSFryq4qpAyMIARUAAIhCGAHwAQH4Af4JgALQBYoCDAgAEAEYQyBkKGUwDw==&rs=AOn4CLAX5tHBXfw7XY8bX2GjPk4Jw9lIEg",
  "descriptionSnippet": "YouTube Playlists: http://listen.settle.fm/youtube Listen on Spotify, Apple Music & more: https://listen.settle.fm/playlists Tracklist ...",
  "badges": [
    "4K"
  ],
  "scrapedAt": "2026-11-12T07:02:36.153Z"
}
```

#### Output fields

| Field | Description |
|---|---|
| `url` | Watch URL of a video, /shorts/ URL of a Short, channel URL or playlist URL |
| `type` | `video`, `short`, `channel` or `playlist` |
| `position` | Rank in the search, from 1, in the order YouTube lists the results (each result once) |
| `query` | The search query |
| `searchUrl` | The YouTube search page with the same query and filters |
| `shelf` | Shelf the result is listed in ("Shorts", "Latest from BBC News"); `null` for the main list |
| `videoId` | 11-character video ID of a video or Short |
| `playlistId` | Playlist ID of a playlist or course |
| `title` | Title of the video, Short or playlist, or the channel name |
| `channelId` | Channel ID (UC...) of the channel, or of the channel that published the video or playlist |
| `channelName` | Channel name |
| `channelHandle` | Channel handle (@name), when YouTube shows it |
| `channelUrl` | Channel URL |
| `channelVerified` | `true` when the channel has a verified or official artist badge |
| `viewCount` | Views as a number: exact for videos, rounded for Shorts |
| `viewCountText` | Views as YouTube shows them ("58,674,451 views", "846K views") |
| `watchingCount` | People watching a stream that is live now (instead of views) |
| `publishedText` | Age as YouTube shows it ("4 years ago", "Streamed 2 years ago") |
| `durationSeconds` | Length in seconds |
| `durationText` | Length as YouTube shows it ("6:10:58") |
| `isShort` | `true` for Shorts |
| `isLive` | `true` for a stream that is live now |
| `isUpcoming` | `true` for a scheduled premiere or stream |
| `scheduledStartTime` | Start of a scheduled premiere or stream (ISO 8601) |
| `thumbnailUrl` | Largest thumbnail (the avatar for a channel) |
| `descriptionSnippet` | Start of the description, as the search shows it |
| `badges` | Badges YouTube shows on the result ("New", "4K", "CC", "LIVE"; "Course" or "Playlist" on playlists) |
| `subscriberCount` | Channel results: subscribers as a number, from the rounded count YouTube shows |
| `subscriberCountText` | Channel results: subscribers as YouTube shows them ("12.5M subscribers") |
| `videoCount` | Playlists, and channels when YouTube shows it: the number of videos (or lessons, episodes) |
| `videoCountText` | The same as YouTube shows it ("54 videos", "124 lessons") |
| `scrapedAt` | ISO timestamp of the extraction |

### Error items

When an input produces no data, the dataset gets one **error item** for it, so nothing is skipped silently. Error items are **free**: only result records are charged.

```json
{
  "url": "https://www.youtube.com/results?search_query=xqzvbnmlkjhgfdsa+qpwoeiruty&sp=EgIIAQ%253D%253D",
  "input": "https://www.youtube.com/results?search_query=xqzvbnmlkjhgfdsa+qpwoeiruty&sp=EgIIAQ%253D%253D",
  "error": {
    "type": "https://rocketyard.dev/errors#empty",
    "title": "Nothing published",
    "detail": "YouTube has no results for \"xqzvbnmlkjhgfdsa qpwoeiruty\" with these filters right now.",
    "instance": "https://www.youtube.com/results?search_query=xqzvbnmlkjhgfdsa+qpwoeiruty&sp=EgIIAQ%253D%253D",
    "code": "EMPTY"
  }
}
```

The `error` object follows [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) (Problem Details). Its `type` links to the [explanation of the code](https://rocketyard.dev/errors), and `status` is the site's HTTP status when there was one. Filter on `error.code` to separate failures from data; it has its own column in CSV and Excel exports.

| Code | Meaning | Retry? |
|---|---|---|
| [`PRIVATE_ADDRESS`](https://rocketyard.dev/errors#private-address) | The URL, or a redirect from it, points to a private or local network address. Only public websites are fetched. | no |
| [`NOT_FOUND`](https://rocketyard.dev/errors#not-found) | The page or source does not exist (HTTP 404 or 410). | no |
| [`BLOCKED`](https://rocketyard.dev/errors#blocked) | The site refused access (HTTP 401, 403 or 429) or answered with a bot-check or consent page instead of the content. | sometimes |
| [`HTTP_ERROR`](https://rocketyard.dev/errors#http-error) | The site answered with another HTTP error: a server error (5xx) that persisted after retries, or an unexpected 4xx status. | sometimes |
| [`TIMEOUT`](https://rocketyard.dev/errors#timeout) | The site did not answer in time, even after retries. | yes |
| [`NETWORK_ERROR`](https://rocketyard.dev/errors#network-error) | The connection failed (DNS, TLS or a reset connection), even after retries. | yes |
| [`WRONG_CONTENT_TYPE`](https://rocketyard.dev/errors#wrong-content-type) | The URL returned something the Actor doesn't read, such as a PDF or image instead of an HTML page, or a web page where an API response was expected. | no |
| [`TOO_LARGE`](https://rocketyard.dev/errors#too-large) | The response exceeded the size limit (10 MiB for web pages, 48 MiB for API responses). | no |
| [`PARSE_ERROR`](https://rocketyard.dev/errors#parse-error) | The response could not be read (malformed HTML or JSON). | sometimes |
| [`EMPTY`](https://rocketyard.dev/errors#empty) | The source has nothing to return right now: a list with no open items, a store or collection with no products, a search with no results, or a web page whose HTML has no readable text (often a page built only by JavaScript in the browser). | no |

### Limits

- YouTube decides how deep a search goes: about 20 results per page, until it answers "No more results". In our test on 2026-11-12, a video search for "lofi hip hop" ended after 474 results, a Shorts search for "minecraft" after about 100, and "how to cook rice" uploaded this year after 17. A search that ends before **Max results per search** stops at its last page, and you pay for the results it had.
- Shorts in a Shorts search or a Shorts shelf come with their title, views and thumbnail only: YouTube lists them without their channel and length, so those fields are empty on them. Other searches often list Shorts as videos, with their channel and length.
- View counts are exact for videos and rounded for Shorts (846K), as YouTube shows them. A stream that is live now has `watchingCount` instead, the people watching it. Channel subscriber counts are rounded (12.5M), and empty for channels that hide them and for Topic channels (40% of 300 channels for "cooking" on 2026-11-12).
- Ages are what YouTube shows ("4 years ago"), not dates: the search lists no upload date. For exact dates and likes, give the video IDs to a YouTube video scraper.
- YouTube ranks results partly by where a request comes from (its IP address), so the same search through a proxy in another country can return other results.
- YouTube no longer sorts search results by upload date or rating, so neither is offered. Its filter menu no longer shows **Last hour** either, but YouTube still honours it (tested 2026-11-12).
- YouTube may answer an IP address with a bot check or a consent page, or refuse it with HTTP 401, 403 or 429. The Actor then stores one free `BLOCKED` error item and stops the run, keeping the results stored so far. It never tries to get past a block. Run it again later.

### Pricing

Pay per result: **$1.00 per 1,000 results**, plus a tiny per-run start fee. Searches without results produce an error item, which is not charged, and a result listed twice is charged once. There is no monthly rental, and you can cap spend per run with **Max results** or **Maximum cost per run**.

### Integrations and API

Run it from the [Apify API](https://docs.apify.com/api/v2), the JavaScript/Python clients, Make, Zapier, n8n, LangChain or any MCP-compatible AI agent, and send results to Google Sheets, webhooks, S3 and more. Schedule it to track changes over time.

### FAQ

**Which searches does it run?** Any YouTube search a logged-out visitor can run, by keyword, with YouTube's own filters: type, upload date, length and popularity. Search URLs copied from youtube.com work too, with the filters picked there.

**Is this the official YouTube Data API?** No. It is an independent Actor that reads the public search results YouTube shows logged-out visitors, and is not affiliated with YouTube or Google. It needs no API key and no quota: a search of 1,000 results costs no Data API units.

**How many results can one search return?** Up to 1,000 with **Max results per search**, as far as YouTube goes: it lists about 20 results per page, and most searches end after some hundreds. Split a broad topic into several queries or upload-date periods for more.

**What does `position` mean?** The rank of the result in its search, from 1, in the order YouTube lists them, counting each result once. With **Type** set to Everything, the Shorts in a shelf count too; set **Type** to Videos for a ranking of videos only.

**Can I sort by upload date?** No: YouTube removed sorting by upload date and by rating from its search. Use **Upload date** (last hour, today, this week, this month or this year) to keep recent results only, and **Sort by** Popularity for the most viewed first.

**Does it return comments, transcripts or emails?** No. It returns what the search results show. It never reads comments, viewers or contact details.

**How much does it cost?** You pay per result: $1.00 per 1,000 results, plus a start fee of $0.00005 per run, with no subscription. Cap any run with **Maximum cost per run**.

**How do I call it from the API?** One request starts a run and returns its results, using your [Apify API token](https://console.apify.com/settings/integrations):

```bash
curl -X POST "https://api.apify.com/v2/acts/rocketyard~youtube-search-scraper/run-sync-get-dataset-items" -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" -d '{"queries":["lofi hip hop","how to cook rice"],"type":"video","uploadDate":"year","sortBy":"relevance","maxResultsPerQuery":300}'
```

**How do I use it with AI agents?** Connect Apify's MCP server at `https://mcp.apify.com?tools=rocketyard/youtube-search-scraper`, and the agent can call this Actor as a tool.

**Is it legal to scrape YouTube data?** The Actor reads the search results YouTube shows any logged-out visitor, without logging in, without cookies and without bypassing consent or bot checks. It does not check robots.txt, and YouTube's robots.txt disallows the /results and /youtubei/ paths of the search page and its endpoint. It returns no comments and no data about commenters or viewers. You are responsible for how you use the data under YouTube's terms and the law (for example copyright and GDPR).

**What happens when an input fails?** A search that yields nothing gets one [error item](#error-items) with a code and the reason, and is not charged, and the other searches still run. A block is different: when YouTube answers with a bot check or a consent page, or refuses the request, the Actor stores one free `BLOCKED` item and stops the whole run, keeping the results already stored.

**I need a field that is not supported.** Open an issue on the Actor's Issues tab. Requests are reviewed regularly and drive new features.

### You might also like

- [YouTube Channel Scraper - Subscribers, Views & Links](https://apify.com/rocketyard/youtube-channel-scraper): returns the public profile of YouTube channels with their latest uploads
- [App Store Reviews API & Scraper - Ratings, Text & Versions](https://apify.com/rocketyard/app-store-reviews-scraper): returns the public reviews of any App Store app, with star ratings, text, app versions and dates
- [Article Scraper - Any Website (Schema.org)](https://apify.com/rocketyard/article-schema-scraper): article data from any website with schema.org markup
- [Ashby Jobs API & Scraper](https://apify.com/rocketyard/ashby-jobs-scraper): every open job from Ashby job boards
- [Events Scraper - Any Event Site to Structured Data](https://apify.com/rocketyard/event-schema-scraper): event data from any website with schema.org markup

### Made by Rocketyard

[Rocketyard](https://rocketyard.dev) builds pay-per-result scrapers for public web data, and every release is tested on live pages before it ships. Guides for this Actor: [overview](https://rocketyard.dev/youtube-search-scraper), [REST API](https://rocketyard.dev/youtube-search-scraper#api), [MCP for AI agents](https://rocketyard.dev/youtube-search-scraper#mcp) and [n8n, Make and Zapier](https://rocketyard.dev/youtube-search-scraper#automation).

# Actor input Schema

## `queries` (type: `array`):

What to search for, as you would type it into YouTube. Each query is one search with the filters below.

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

Search pages copied from youtube.com (https://www.youtube.com/results?search_query=...). Each keeps the filters picked on YouTube (the sp= part of the URL); the filter inputs below apply to Search queries only.

## `maxResultsPerQuery` (type: `integer`):

Stop each search after this many results. YouTube lists about 20 per page, so the Actor reads one page per 20 results. A search with fewer results stops at its last page.

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

What to search for. Everything: what the search page lists, in its order, including the Shorts shelves it mixes in (`shelf` names them). Live now: streams that are live at the moment.

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

Only results uploaded in this period. YouTube offers it for videos, Shorts and live streams, not for channels and playlists.

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

Only videos of this length. YouTube offers it for videos and live streams, not for Shorts, channels and playlists.

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

Relevance, or popularity (most viewed first). YouTube no longer sorts search results by upload date or rating; use Upload date to keep recent results only.

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

Stop the run after this many results, over all searches. Empty means no limit beyond Max results per search.

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

Searches run in parallel. A pause of 300 to 800 ms between requests to YouTube always applies, over all of them.

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

Optional proxy. YouTube ranks results partly by where a request comes from, so a proxy in another country can return other results.

## Actor input object example

```json
{
  "queries": [
    "lofi hip hop"
  ],
  "maxResultsPerQuery": 100,
  "type": "all",
  "uploadDate": "any",
  "duration": "any",
  "sortBy": "relevance",
  "maxConcurrency": 3
}
```

# Actor output Schema

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

One record per YouTube search result, plus a free error item for each input that yielded no data, as JSON, CSV or Excel.

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

Searches read, results read, stored and left out as duplicates, pages and requests, the web client version used, error items, why the run stopped and how long it took.

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

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

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

```

## MCP server setup

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