# YouTube Search API (`data_minds/youtube-search-api`) Actor

Search YouTube for videos, channels and playlists. Get views, likes, comments, engagement rate, subscribers, contact email and a transcript snippet for each result. No login. Bulk queries, date filter, auto proxy fallback. Export JSON, CSV or Excel.

- **URL**: https://apify.com/data_minds/youtube-search-api.md
- **Developed by:** [Data Minds](https://apify.com/data_minds) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

### What is YouTube Search API?

**YouTube Search API** turns any YouTube keyword search into structured data for YouTube influencer research, YouTube competitor analysis and YouTube content research. Enter one or more search terms, choose videos, channels or playlists, and get titles, links, views, likes, comments, engagement rate, channel details and a transcript snippet as clean JSON, with no coding needed. Pay-per-result pricing starts at $0.70 per 1,000 results on the Gold plan. [🚀 Try it free](https://apify.com/data_minds/youtube-search-api)

Use it for:

- 🎯 **YouTube influencer research:** find creators in a niche and compare their subscriber counts and engagement.
- 📊 **YouTube competitor analysis:** see which videos and channels rank for the keywords you care about.
- 📝 **YouTube content research:** collect titles, tags, hashtags and chapters from videos that already perform.
- 📈 **YouTube trend monitoring:** run the same search on a schedule and compare results over time.
- 🧠 **Build a YouTube video dataset:** feed search results with transcript snippets into your analytics or AI workflow.

You can run it from the Apify Console, schedule it, call it through the Apify API and connect it to other tools.

#### What can YouTube Search API do?

- 🔍 **Search YouTube videos, channels or playlists** with the `searchType` input, one run per type.
- 📚 **Run a bulk YouTube search:** add several search terms and set the maximum number of results for each one.
- 📅 **Filter by upload date** (last hour, today, this week, this month, this year) and sort by relevance, upload date, view count or rating.
- 📈 **Add engagement data** such as likes, comments, engagement rate and a 0 to 100 quality score for videos.
- 👤 **Add YouTube channel data** such as subscriber count, country, contact email and social links when the channel lists them.
- 📦 **Export YouTube search results** to JSON, CSV, Excel, XML or HTML, or read them through the Apify API.

#### Why use YouTube Search API instead of the official YouTube API?

The Actor does not need a Google Cloud project, API key setup or quota planning from you. You enter search terms and pay per result. Each result already bundles search position, engagement fields, channel details and a transcript snippet in one row, so you do not combine several separate lookups yourself.

***

### What data can YouTube Search API extract?

Every row has the same set of fields. Fields that do not apply to a result type are `null` or empty.

| Group | Fields |
|---|---|
| 🆔 Identity | `type` (video, channel or playlist), `id`, `url`, `searchPosition` |
| 📝 Text | `title`, `description`, `thumbnailUrl` |
| 🕒 Video timing | `duration`, `durationSeconds`, `publishedAt`, `publishedTimeText` |
| 👀 Video stats | `viewCount`, `likes`, `commentsCount`, `engagementRate`, `qualityScore` |
| 🎬 Video flags | `isLive`, `isShort`, `wasLive`, `captionsAvailable` |
| 🔖 Video details | `videoCategory`, `keywords`, `hashtags`, `chapters`, `transcriptSnippet` |
| 📺 Channel identity | `channelId`, `channelName`, `channelUrl`, `channelUsername`, `channelAvatarUrl`, `channelBannerUrl`, `isVerifiedChannel` |
| 👥 Channel stats | `numberOfSubscribers`, `channelVideoCount`, `channelViewCount`, `channelCreatedAt` |
| 🌍 Channel profile | `channelCountry`, `channelNiche`, `channelContactEmail`, `channelSocialLinks` |
| 📚 Playlist | `videoCount` |

> **Note:** `likes`, `commentsCount`, `engagementRate`, `qualityScore`, `videoCategory`, `publishedAt`, `keywords`, `hashtags`, `chapters` and the channel profile fields are filled only when **Enrich results** (`enrich`) is on. `transcriptSnippet` also needs **Enrich transcript** (`enrichTranscript`) and a video that offers captions. Channel profile fields need **Enrich channel data** (`enrichChannel`) and appear only when the channel publishes them. `chapters` come from timestamps in the video description. `keywords` holds up to 30 entries and `hashtags` up to 10.

#### What data can't YouTube Search API extract?

- Full video transcripts: `transcriptSnippet` holds only the first 350 characters. For complete transcripts with timestamps, use [YouTube Transcript & Subtitles Scraper API](https://apify.com/data_minds/youtube-transcript-subtitles-scraper-api).
- Videos found under a hashtag: use [YouTube Hashtag Search Scraper](https://apify.com/data_minds/youtube-hashtag-search-scraper).
- Comment text, downloaded video files or private data.

***

### How to scrape YouTube search results

YouTube Search API is designed for an easy start, even if you have never extracted data from the web before.

1. [Create a free Apify account](https://console.apify.com/sign-up) with your email.
2. Open [YouTube Search API](https://apify.com/data_minds/youtube-search-api).
3. Add one or more search terms in **Search query** (`query`).
4. Choose **Search type** (`searchType`), **Max results per query** (`maxResults`) and, if you want, a date filter or sort order.
5. Click **Start** and wait for the run to finish.
6. Download your data in JSON, CSV, Excel, XML or HTML from the Output tab.

***

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

YouTube Search API uses a **pay-per-event** model. You pay for each result saved to the dataset, plus a small start event. Apify platform usage is billed in addition. The price per result depends on your Apify plan.

| Plan | Price per result | Price per 1,000 results |
|---|---|---|
| Free | $0.001 | $1.00 |
| Bronze | $0.0009 | $0.90 |
| Silver | $0.0008 | $0.80 |
| Gold | $0.0007 | $0.70 |

The start event costs $0.00005 per GB of memory, with a minimum of one event. The default memory is 1024 MB, so each run is charged one start event of $0.00005.

**Worked example:** 100 video results on the Free plan cost 100 x $0.001 = $0.10, plus one $0.00005 start event, plus platform usage.

See the [pricing tab](https://apify.com/data_minds/youtube-search-api/pricing) for the current prices.

#### Is scraping YouTube free?

You can start for free. The Apify Free plan includes $5 of monthly credit. At the Free price of $0.001 per result, that credit covers about 5,000 results before platform usage. If a run reaches your spend limit, it stops and keeps the results already saved.

***

### Input

The only required input is **Search query** (`query`), a list of one or more search terms. Everything else has a default. You can set the input in the Actor form or send it as JSON through the API.

This example searches two terms with the form's default settings:

```json
{
  "query": ["python tutorial", "javascript basics"],
  "proxyConfiguration": { "useApifyProxy": false }
}
```

See the [input tab](https://apify.com/data_minds/youtube-search-api/input-schema) for the full description of every field.

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `query` | array of strings | Yes | none | Search keywords, one term per entry. Avoid commas inside a term. |
| `maxResults` | integer | No | `10` in the form | Maximum results per query, from 1 to 50000. If the field is left out of an API call, the Actor uses 50. |
| `searchType` | string | No | `video` | `video`, `channel` or `playlist`. |
| `uploadDate` | string | No | `any` | `any`, `hour`, `today`, `week`, `month` or `year`. |
| `sortBy` | string | No | `relevance` | `relevance`, `date`, `viewCount` or `rating`. |
| `enrich` | boolean | No | `true` | Adds extended data such as category, keywords, hashtags, chapters and engagement metrics. |
| `enrichChannel` | boolean | No | `true` | Adds channel profile data. Used only when `enrich` is on. |
| `enrichTranscript` | boolean | No | `true` | Adds a short transcript snippet to each video. Used only when `enrich` is on. |
| `proxyConfiguration` | object | No | `{"useApifyProxy": false}` | Optional proxy settings. Leave the default to run without a proxy. |

#### maxResults

`maxResults` applies to each query separately. Two queries with `maxResults` set to 10 can return up to 20 results in total. A result that appears under more than one query is saved once.

- ✅ Good: `10` for a quick test, then raise it once the output looks right.
- ❌ Bad: `0` or a negative number. The minimum is 1.

> **Warning:** Every saved result is a billed event. A high `maxResults` with many queries can add up, so start small and set a spend limit on the run.

#### query

Add one search term per list entry, written the way you would type it into YouTube. The list is read as text and split on commas, so entries can pick up stray brackets or quotes and a comma inside a term splits it into two searches.

- ✅ Good: `"python tutorial"`
- ❌ Bad: `"python, basics"` as one entry, because the comma splits it. An empty list is also bad. The run stops with an error when no search term is given.

> **Warning:** The Actor returns the results YouTube shows for each term. A term with few matches can return fewer results than `maxResults`.

#### enrich, enrichChannel and enrichTranscript

`enrich` adds the engagement and detail fields. `enrichChannel` and `enrichTranscript` refine it. Turning `enrich` off makes the run faster but returns less data.

- ✅ Good: keep all three on when you need likes, comments and channel details.
- ❌ Bad: turning on `enrichTranscript` while `enrich` is off. It has no effect.

***

### Output

Results appear in the run's **Output** and **Storage** tabs. You can view them as a table or JSON, choose the fields you need and download them in JSON, CSV, Excel, XML or HTML. The Output tab links to separate Videos, Channels and Playlists tables, the full data, and a run summary.

#### JSON example

Results for the first search term, `python tutorial`, with `searchType` set to `video`:

```json
{
  "type": "video",
  "id": "abc123XYZ00",
  "url": "https://example.com/watch?v=abc123XYZ00",
  "title": "Python Tutorial for Beginners",
  "description": "Learn Python step by step...",
  "thumbnailUrl": "https://example.com/thumbnails/abc123XYZ00.jpg",
  "duration": "12:34",
  "durationSeconds": 754,
  "publishedAt": "2025-01-15",
  "publishedTimeText": "1 year ago",
  "viewCount": 1250000,
  "likes": 45000,
  "commentsCount": 1800,
  "engagementRate": 3.74,
  "qualityScore": 78,
  "isLive": false,
  "isShort": false,
  "wasLive": false,
  "captionsAvailable": true,
  "videoCategory": "Education",
  "keywords": ["python", "tutorial"],
  "hashtags": ["#python"],
  "chapters": [{ "timestamp": "0:00", "title": "Introduction" }],
  "transcriptSnippet": "Welcome to this Python course...",
  "channelId": "UCexample0000000000000000",
  "channelName": "Example Coding Channel",
  "channelUrl": "https://example.com/@examplecoding",
  "channelUsername": "@examplecoding",
  "channelAvatarUrl": "https://example.com/avatars/examplecoding.jpg",
  "channelBannerUrl": "https://example.com/banners/examplecoding.jpg",
  "isVerifiedChannel": true,
  "numberOfSubscribers": 980000,
  "channelVideoCount": 320,
  "channelViewCount": 150000000,
  "channelCreatedAt": "Mar 3, 2015",
  "channelCountry": "United States",
  "channelNiche": ["Education"],
  "channelContactEmail": "contact@example.com",
  "channelSocialLinks": { "Website": "https://example.com" },
  "searchPosition": 0
}
```

With `searchType` set to `channel` or `playlist`, rows use the same field names. Here they are shown without the empty fields:

```json
{
  "type": "channel",
  "id": "UCexample0000000000000000",
  "url": "https://example.com/@examplecoding",
  "title": "Example Coding Channel",
  "thumbnailUrl": "https://example.com/avatars/examplecoding.jpg",
  "channelName": "Example Coding Channel",
  "isVerifiedChannel": true,
  "numberOfSubscribers": 980000,
  "channelVideoCount": 320,
  "searchPosition": 0
}
```

```json
{
  "type": "playlist",
  "id": "PLexample000000000000",
  "url": "https://example.com/playlist?list=PLexample000000000000",
  "title": "Python Basics Playlist",
  "thumbnailUrl": "https://example.com/thumbnails/playlist.jpg",
  "videoCount": 24,
  "channelName": "Example Coding Channel",
  "searchPosition": 0
}
```

#### Run summary

At the end of every run a `RUN_SUMMARY` record is saved to the key-value store:

```json
{
  "totalResults": 20,
  "searchType": "videos",
  "query": ["python tutorial", "javascript basics"],
  "durationSecs": 42.5,
  "status": "ok",
  "spendLimitReached": false
}
```

#### Notes and limitations

- `searchPosition` counts the position of a result within its query, starting at 0.
- The number of results can be lower than `maxResults` when YouTube shows fewer matches for a term.
- `viewCount`, `likes`, `commentsCount` and subscriber counts are read from the abbreviated numbers YouTube displays, so large values can be rounded.
- `isShort` is `true` for videos of 60 seconds or less.
- The Actor reads publicly visible search results. It does not log in to a YouTube account.

***

### Tips and advanced usage

#### How many results can you scrape with YouTube Search API?

The number depends on how many results YouTube shows for your search terms and on your `maxResults` setting. The best way to know for your use case is a quick test run with a small `maxResults`.

#### How to get faster or cheaper results

- Lower `maxResults` to cap the number of billed results per query.
- Turn off `enrich` when you only need titles, links and basic view counts.
- Turn off `enrichTranscript` or `enrichChannel` if you do not need those fields.
- Use `uploadDate` and `sortBy` to narrow results to the videos you actually want.

#### What can you do with the extracted YouTube data?

- 📊 **YouTube data extraction:** collect search results at scale instead of copying them by hand.
- 🔖 **YouTube video metadata:** use `videoCategory`, `keywords` and `hashtags` to see how top videos are labelled.
- 🏆 **YouTube video stats:** compare views, likes and comments across a niche.
- ⭐ **YouTube quality score:** sort videos by `qualityScore`, a 0 to 100 score built from engagement, channel size and data richness.
- 🔎 **YouTube search position:** use `searchPosition` to see where a video ranks for a term.
- ✅ **YouTube verified channel:** filter on `isVerifiedChannel` to separate established creators.
- 🌟 **YouTube creator discovery:** combine subscriber counts and country to build a shortlist.
- 🎬 **YouTube video ranking:** sort by view count or rating to see which videos lead a topic.
- 📋 **YouTube search results table:** open the Videos, Channels and Playlists tables in the Output tab.
- 🪝 **YouTube search webhook:** trigger a webhook when a run finishes to send the data onward.
- 🔌 **YouTube data API alternative:** call the Actor through the Apify API to get search data without managing your own quota.
- 📅 **YouTube upload date filter:** narrow results to the last hour, day, week, month or year.
- 🔢 **YouTube search sorted by view count:** set `sortBy` to `viewCount` to put the most watched videos first.

#### Monitor a keyword over time

Schedule the Actor in the Apify Console to run daily or weekly with the same query and `sortBy` set to `date`. Compare each run's `viewCount` and `searchPosition` to track a topic.

***

### Integrations and API

#### Can I use YouTube Search API as an API?

Yes. The [Apify API](https://docs.apify.com/api/v2) lets you start runs, schedule them and fetch results programmatically. Use the `apify-client` package for Node.js or Python. The [API tab](https://apify.com/data_minds/youtube-search-api/api) has ready-to-use code for your input.

#### How to scrape YouTube search results with Python

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("data_minds/youtube-search-api").call(run_input={
    "query": ["python tutorial", "javascript basics"],
    "proxyConfiguration": {"useApifyProxy": False},
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### Can I integrate YouTube Search API with other apps?

Yes. Connect the Actor with Make, Zapier, Google Sheets, Slack and other tools through [Apify integrations](https://apify.com/integrations). Use [webhooks](https://docs.apify.com/integrations/webhooks) to trigger an action when a run finishes, and schedules to repeat a search automatically.

#### Can I use YouTube Search API with AI agents (MCP)?

Yes. Connect the Actor to Claude and other MCP clients through the Apify MCP server. Open the [MCP tab](https://apify.com/data_minds/youtube-search-api/api/mcp) for the setup steps.

***

### Other search and YouTube scrapers

| Actor | What it does |
|---|---|
| 🔎 [Google Search Results Scraper](https://apify.com/data_minds/google-search-results-scraper) | Scrape Google Search: organic results, AI Overview, People Also Ask, related searches, ads, videos and knowledge panel. Bulk keywords or Google URLs, no login. |
| 📈 [Google Trends Scraper](https://apify.com/data_minds/google-trends-scraper) | Scrape Google Trends: interest over time, regions, cities, related queries and Trending Now for keywords or Trends links. |
| 📌 [YouTube Hashtag Search Scraper](https://apify.com/data_minds/youtube-hashtag-search-scraper) | Collect videos and Shorts posted under any YouTube hashtag, with titles, views, channels, publish dates and descriptions. |
| 📝 [YouTube Transcript & Subtitles Scraper API](https://apify.com/data_minds/youtube-transcript-subtitles-scraper-api) | Get full YouTube transcripts with timestamps, chapters and SRT/VTT/TXT subtitle files for videos, Shorts, playlists, channels and searches. |
| 🔥 [YouTube Trending Shorts Scraper](https://apify.com/data_minds/youtube-trending-shorts-scraper) | Collect trending YouTube Shorts for any search, hashtag or topic, with views, likes, comments, channel, publish date and keywords. |

***

### FAQ

#### Is it legal to scrape YouTube?

Scraping publicly available data is generally legal, but you must respect personal data rules such as GDPR, intellectual property and YouTube's terms. Collect personal data, like channel contact emails, only with a legitimate reason. This is not legal advice, so read [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/) and consult a lawyer.

#### How does YouTube Search API work?

You enter one or more search terms and pick videos, channels or playlists, plus an optional date filter, sort order and maximum number of results. The Actor returns one row for each search result, with engagement, channel and transcript snippet fields when enrichment is on. Every row is saved to a dataset you can export.

#### Why scrape YouTube search results?

Search results show what YouTube surfaces for a topic. Teams use them for influencer research, competitor analysis, content ideas, trend monitoring and market research. Because each row includes views, likes, comments and channel size, you can rank videos and creators in a niche without opening every page by hand.

#### Why am I getting fewer results than expected?

A run returns fewer results than maxResults when YouTube shows fewer matches for a term, when a result repeats across queries and is saved only once, or when your spend limit is reached. Try broader search terms, remove the date filter, or check the run log for a spend limit message.

#### Is there a free YouTube search API?

You can try YouTube Search API for free. The Apify Free plan includes $5 of monthly credit, which covers about 5,000 results at $0.001 each, before platform usage. You only pay for saved results, so a small test run with a low maxResults costs very little.

#### How do I search YouTube channels or playlists instead of videos?

Set the searchType input to channel or playlist and keep the same search terms. The Actor then returns channel rows, with subscriber count and video count, or playlist rows, with video count and the owning channel name. Run one search type at a time, then combine the datasets if you need both.

#### Is YouTube Search API not working?

If a run fails or returns nothing unexpected, first check the run log and test with a single common search term and a low maxResults. If the problem continues, open a report on the Issues tab with your input and the run link, and the data_minds team will look into it.

***

### Support and feedback

Found a bug or have a feature request? Please create an issue on the [Issues tab](https://apify.com/data_minds/youtube-search-api/issues/open).

Need a custom solution or more data? Contact us at hello.dataminds@gmail.com.

Built and maintained by the [data_minds](https://apify.com/data_minds) team on Apify. This Actor is independent and is not affiliated with or endorsed by YouTube or Google. Use it only on publicly available data and follow the applicable laws and platform terms.

# Actor input Schema

## `query` (type: `array`):

Search keywords. Enter multiple queries — each runs as a separate search.

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

Maximum number of results to return per search query.

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

Type of YouTube content to search for.

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

Filter results by upload date.

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

Sort search results by this criterion.

## `enrich` (type: `boolean`):

Fetch extended data for each result (video category, keywords, hashtags, chapters, engagement metrics). Makes each run take longer.

## `enrichChannel` (type: `boolean`):

Fetch channel About page data (country, contact email, social links, subscriber count). Only used when Enrich results is enabled.

## `enrichTranscript` (type: `boolean`):

Fetch a short transcript snippet for each video. Only used when Enrich results is enabled.

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

Optional proxy settings. Leave the default to run without a proxy.

## Actor input object example

```json
{
  "query": [
    "python tutorial",
    "javascript basics"
  ],
  "maxResults": 10,
  "searchType": "video",
  "uploadDate": "any",
  "sortBy": "relevance",
  "enrich": true,
  "enrichChannel": true,
  "enrichTranscript": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Every search result (videos, channels, playlists) with key fields in search order.

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

Video results with views, likes, comments, engagement rate, quality score and channel info.

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

Channel results with subscribers, video count, country and verification status.

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

Playlist results with video count and owner channel.

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

All fields, including keywords, hashtags, chapters, transcript snippet, channel contact and social links.

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

Total results, search type, query, duration, status and spend-limit flag, written at the end of every run.

# 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 = {
    "query": [
        "python tutorial",
        "javascript basics"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("data_minds/youtube-search-api").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 = {
    "query": [
        "python tutorial",
        "javascript basics",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("data_minds/youtube-search-api").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 '{
  "query": [
    "python tutorial",
    "javascript basics"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call data_minds/youtube-search-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data_minds/youtube-search-api"
        }
    }
}
```

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/hlVUiV0s6ekNckqlH/builds/g1Kmnekj3Vp3zJDzq/openapi.json
