YouTube Search API
Pricing
from $0.35 / 1,000 results
YouTube Search API
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.
Pricing
from $0.35 / 1,000 results
Rating
0.0
(0)
Developer
Data Minds
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
11 hours ago
Last modified
Categories
Features
Share
๐ What is YouTube Search API?
โก Quick start ยท ๐ฌ Videos, Shorts, channels and playlists ยท ๐ฆ Export to JSON, CSV or Excel ยท ๐ค Works with AI agents
YouTube Search API turns any YouTube keyword search into a clean table of videos, Shorts, channels or playlists. Type one or more searches, press Start, and every result comes back as one row with views, likes, comments, hashtags and full channel details. It is made for marketers, creators, analysts and developers who want YouTube search data without a YouTube API key.
- ๐ Find what ranks: search YouTube videos by keyword and see the videos and channels in the order YouTube shows them.
- ๐ Compare performance: get views, likes, comments and an engagement rate for every video.
- ๐ค Discover creators: read subscriber counts, country, social links and the public contact email a channel shows.
- ๐ท Study titles and tags: see the keywords, hashtags and chapters creators use, plus full descriptions.
- ๐ See another market: search as a visitor from one of 30 countries, in one of 21 languages.
- ๐ค Keep it running: schedule searches and send the results to your sheet, your app or your AI agent.
๐ฆ What data can YouTube Search API extract?
Every row is one search result. The fields are grouped below, and the main ones are described in the Output section. Fields stay empty when YouTube does not show them for that result.
| Data | Fields |
|---|---|
| ๐ฌ Result | type, id, url, title, description, thumbnailUrl, searchQuery, searchPosition |
| ๐ Video | duration, durationSeconds, publishedAt, publishedTimeText, videoCategory, isLive, isUpcoming, isShort, wasLive, isMembersOnly, captionsAvailable |
| ๐ Engagement | viewCount, likes, commentsCount, commentsTurnedOff, engagementRate, qualityScore |
| ๐ Content | keywords, hashtags, chapters, transcriptSnippet |
| ๐ค Channel | channelId, channelName, channelUrl, channelUsername, channelAvatarUrl, channelBannerUrl, isVerifiedChannel |
| ๐ Channel statistics | numberOfSubscribers, hiddenSubscriberCount, channelVideoCount, channelViewCount, channelCreatedAt, channelCountry, channelNiche |
| ๐ง Channel contact | channelContactEmail, channelSocialLinks, channelDescription |
| ๐ Playlist | videoCount |
โ Note: YouTube rounds large numbers, for example 3.45M subscribers or 23K comments.
channelContactEmailis filled only when the channel shows an email in its public description.
โ What can't YouTube Search API extract?
- โ The text of individual comments. You get the comment count only.
- โ Full transcripts. You get a short YouTube transcript snippet (
transcriptSnippet) with the first part of the captions. - โ Email addresses that a channel does not show publicly.
For complete transcripts, try YouTube Transcript & Subtitles Scraper API.
๐ How to scrape YouTube search results
Here is how to scrape YouTube videos, Shorts, channels and playlists, even if you have never collected web data before.
- ๐ Create a free Apify account using your email.
- ๐ Open YouTube Search API and go to the Input tab.
- ๐ฅ Add one or more searches under Search queries, one per line.
- ๐ฏ Choose What to search for, set Max results per search and add any filters you like.
- ๐ Click Start and wait for the run to finish.
- ๐ค Open the Output tab to view the results as a table, or download them as JSON, CSV, Excel, XML or HTML.
๐ Quick start: the default input runs one search with 10 results, which is a quick way to see the data.
{"queries": ["python tutorial"],"maxItems": 10}
๐ฐ How much does it cost to scrape YouTube search results?
YouTube Search API pricing is pay per event, with prices from $0.0007 per result ($0.70 per 1,000 results) on the Gold plan. You pay for each result saved to the dataset. Apify platform usage is billed in addition.
| Apify 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 |
Each run also has one start event of $0.00005, which covers the default 1 GB of memory.
โ Good to know: a result is one row, whether it is a video, a Short, a channel or a playlist.
What a run costs (result price only, start event not included):
| Results | Free | Bronze | Silver | Gold |
|---|---|---|---|---|
| 100 | 100 x $0.001 = $0.10 | 100 x $0.0009 = $0.09 | 100 x $0.0008 = $0.08 | 100 x $0.0007 = $0.07 |
| 1,000 | 1,000 x $0.001 = $1.00 | 1,000 x $0.0009 = $0.90 | 1,000 x $0.0008 = $0.80 | 1,000 x $0.0007 = $0.70 |
| 10,000 | 10,000 x $0.001 = $10.00 | 10,000 x $0.0009 = $9.00 | 10,000 x $0.0008 = $8.00 | 10,000 x $0.0007 = $7.00 |
๐ Is scraping YouTube search results free?
You can start for free. The Apify Free plan includes $5 of monthly credit. At the Free price of $0.001 per result, $5 / $0.001 = about 5,000 results before platform usage. Paid plans lower the price per result, as the table shows.
๐ง Input
Add your searches, then narrow the results with optional filters. Set the input in the Input tab or send it as JSON through the API. Only queries is required.
| Field | Type | Default | What it does |
|---|---|---|---|
queries | array of strings | none (required) | The searches to run, one per line. Each search is collected on its own up to the limit below. |
maxItems | integer | 10 | Maximum results for each search, from 1 to 1000. Three searches with 50 give up to 150 results. YouTube serves about 1,000 results per search at most. |
searchType | string | videos | What to return: videos, shorts, channels or playlists. |
sortBy | string | relevance | relevance and viewCount are sorted by YouTube. date sorts the matched videos by publish date, newest first. |
uploadDate | string | any | Keep results uploaded in the last hour, today, week, month or year. |
duration | string | any | Video length: short (under 4 minutes), medium (4 to 20 minutes) or long (over 20 minutes). Videos only. |
features | array of strings | none | Keep only videos that have all the selected features: live, hd, four_k, subtitles, creative_commons, hdr, vr180, vr360, three_d, location, purchased. |
eventType | string | any | Live stream status: live, upcoming or completed. Videos only. |
publishedAfter | string | none | Keep videos published on or after this date. Use YYYY-MM-DD or a value like 30 days. |
publishedBefore | string | none | Keep videos published on or before this date. Use YYYY-MM-DD or a value like 6 months. |
region | string | US | The country whose YouTube results you want to see. 30 countries are available, for example GB, IN, DE, BR or JP. |
language | string | en | Language of YouTube's interface and results. 21 languages are available, for example es, fr, de, hi or ja. |
safeSearch | string | moderate | moderate or strict. Strict hides content YouTube marks as mature. |
enrich | boolean | true | Add description, likes, comments, keywords, hashtags, chapters and channel data to every result. Turn off for basic data only and a shorter run. |
enrichChannel | boolean | true | Add the channel's country, join date, totals, description, social links and public contact email. Needs enrich. |
enrichTranscript | boolean | true | Add the first part of the captions when the video has them. Needs enrich. |
proxyConfiguration | object | none | Optional network settings for the run. The default settings work for most runs. |
Minimal input:
{"queries": ["python tutorial"]}
Advanced input: the 50 most viewed medium-length videos with subtitles from the last year, for two searches, seen from the United States in English:
{"queries": ["python tutorial", "learn rust"],"maxItems": 50,"searchType": "videos","sortBy": "viewCount","uploadDate": "year","duration": "medium","features": ["subtitles"],"region": "US","language": "en","enrich": true,"enrichChannel": true,"enrichTranscript": false}
The limit counts per search. When a search has fewer matches than your limit, you get all of them. Newest first and the date range keep only matching videos from the results YouTube returns, so combine them with a larger limit. See the input tab for the full schema.
๐ก Tip: start with a small
maxItemsto check the data, then raise it for the full run.
๐ค Output
Results are stored in a dataset, which you can open in the Output or Storage tab. View them as a table or JSON, pick only the fields you need, and download them as JSON, CSV, Excel, XML or HTML. The table has ready-made views for overview, engagement, channel, details and status, and a YouTube search data export is one click away.
Through the API, read the rows from this URL pattern:
https://api.apify.com/v2/datasets/<DATASET_ID>/items?format=json
Add &view=engagement (or overview, channel, details, status) to get one of the views.
The main fields of each result row:
| Field | Type | Description |
|---|---|---|
type | string | Result type: video, channel or playlist. Shorts are returned as video with isShort set to true. |
id | string | YouTube ID of the video, channel or playlist. |
url | string | Link to the result. |
title | string | Title of the video or playlist, or the channel name. |
description | string | Full description. |
duration | string | Length as shown by YouTube, for example 12:34. |
durationSeconds | integer | Length in seconds. |
publishedAt | string | Exact publish time (ISO 8601) when full details are on. |
publishedTimeText | string | Publish time as shown by YouTube, for example 3 weeks ago. |
viewCount | integer | Views. |
likes | integer | Likes. |
commentsCount | integer | Comments. YouTube rounds large counts. |
engagementRate | number | Likes and comments as a percentage of views. |
qualityScore | integer | Score from 0 to 100 that combines engagement, reach and channel signals. |
isShort | boolean | True for a YouTube Short. |
isLive | boolean | True when the video is live right now. |
captionsAvailable | boolean | True when the video has captions. |
videoCategory | string | YouTube category of the video. |
keywords | array | Keywords set by the creator. |
hashtags | array | Hashtags used in the description. |
chapters | array | Chapters with titles and start times. |
transcriptSnippet | string | First part of the captions. |
channelId | string | Channel ID. |
channelName | string | Channel name. |
channelUrl | string | Channel link. |
channelUsername | string | Channel handle, for example @name. |
isVerifiedChannel | boolean | True for a verified channel. |
numberOfSubscribers | integer | Subscribers. YouTube rounds this number. |
channelCountry | string | Country of the channel. |
channelContactEmail | string | Contact email the channel shows publicly in its description. |
channelSocialLinks | object | Links the channel lists, such as its website and social profiles. |
videoCount | integer | Videos in the playlist. Only playlist rows have it. |
searchPosition | integer | Position in the results of its search, starting at 0. |
searchQuery | string | The search that found this result. |
An abridged example row for a video:
{"type": "video","id": "ix9cRaBkVe0","url": "https://www.youtube.com/watch?v=ix9cRaBkVe0","title": "Python Full Course for free","duration": "12:00:00","durationSeconds": 43200,"publishedAt": "2024-08-20T06:00:54-07:00","publishedTimeText": "2 years ago","viewCount": 13598336,"likes": 379952,"commentsCount": 23000,"engagementRate": 2.9632,"qualityScore": 83,"isShort": false,"captionsAvailable": true,"videoCategory": "Education","keywords": ["Python tutorial", "python course", "python programming"],"hashtags": ["#python", "#tutorial", "#beginners"],"transcriptSnippet": "What's up everybody? In this video, I'm going to teach you everything you need t...","channelId": "UC4SVo0Ue36XCfOyb5Lh1viQ","channelName": "Bro Code","channelUrl": "https://www.youtube.com/@BroCodez","channelUsername": "@BroCodez","isVerifiedChannel": true,"numberOfSubscribers": 3450000,"channelCountry": "United States","channelSocialLinks": {"TikTok": "https://www.tiktok.com/@truebrocode"},"searchPosition": 0,"searchQuery": "python tutorial"}
Fields that do not apply to a result type, such as likes on a channel or videoCount on a video or channel, are empty. A run summary with counts and the final status message is also saved in the run storage under the key RUN_SUMMARY.
๐ก Tips and advanced usage
โก How to get lighter or cheaper runs
- โก Turn off Add full video details when you only need titles, links, views and channel names.
- โก Turn off Add channel details or Add transcript snippet when you do not need them.
- โก Use Uploaded and Video length so only the results you need are returned.
- โก Start with a small Max results per search and raise it once the sample looks right.
๐ How many results can you get per search?
Up to about 1,000 results per search, which is the most YouTube serves. Use several related searches to cover more ground, and read searchQuery and searchPosition to see which search found each row and where it ranked.
๐ How to track YouTube search results over time
Run the same searches on a schedule and compare the rows. Watching viewCount, likes and searchPosition over days shows which videos and channels are rising for a topic, which helps with YouTube trend analysis and brand monitoring.
๐ฆ Exporting your results
Open the Output tab of the finished run, choose Export, select CSV or Excel and pick the fields you need. The same menu offers JSON, XML and HTML. For regular exports, use the API or an integration instead.
๐ฏ Why did I get fewer results than my limit?
The search may have fewer matches than your limit, or your date range, length, feature or live-stream filters may remove some. Widen the filters and run a small test again. If the run stopped at your spend limit, the status message says so.
โ Known issues
- โ YouTube rounds large comment and subscriber counts, for example 23K.
- โ Some videos have no transcript, hashtags or keywords. Those fields stay empty.
- โ Results can differ slightly between countries and over time, exactly like YouTube search.
๐ Integrations and API
๐ Can I use YouTube Search API as an API?
Yes. Start runs, read results and schedule jobs through the Apify API with your token from Settings > API & Integrations.
| Action | Method and URL |
|---|---|
| ๐ Start a run | POST https://api.apify.com/v2/actors/data_minds~youtube-search-api/runs |
| โก Run and get the results in one call | POST https://api.apify.com/v2/actors/data_minds~youtube-search-api/run-sync-get-dataset-items |
| ๐ฅ Read results of a run | GET https://api.apify.com/v2/datasets/<DATASET_ID>/items?format=json |
| ๐ OpenAPI definition | GET https://api.apify.com/v2/actors/data_minds~youtube-search-api/builds/default/openapi.json |
curl
curl -X POST "https://api.apify.com/v2/actors/data_minds~youtube-search-api/run-sync-get-dataset-items" \-H "Authorization: Bearer <YOUR_APIFY_TOKEN>" \-H "Content-Type: application/json" \-d '{"queries": ["python tutorial"], "maxItems": 20}'
Python
from apify_client import ApifyClientclient = ApifyClient("<YOUR_APIFY_TOKEN>")run = client.actor("data_minds/youtube-search-api").call(run_input={"queries": ["python tutorial"], "maxItems": 20})for item in client.dataset(run["defaultDatasetId"]).iterate_items():print(item["title"], item["viewCount"], item["channelName"])
JavaScript
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });const run = await client.actor('data_minds/youtube-search-api').call({queries: ['python tutorial'],maxItems: 20,});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
CLI
$echo '{"queries": ["python tutorial"], "maxItems": 20}' | apify call data_minds/youtube-search-api --silent --output-dataset
The one-call endpoint suits runs that finish in about five minutes. Use the start-a-run endpoint for longer jobs. More code is on the API tab.
๐งฉ Can I connect YouTube Search API to other apps?
Yes. Connect YouTube search with Make, Zapier, n8n, Slack, Google Sheets, Google Drive, Airbyte, GitHub and more through Apify integrations. Use webhooks to send new results to your team whenever a run finishes, and schedules to run your searches every day or week.
๐ค Can I use YouTube Search API with AI agents (MCP server)?
Yes. AI agents can call it directly through the hosted Apify MCP server. The Server tab of this Actor shows the same connection settings.
{"mcpServers": {"apify": {"type": "http","url": "https://mcp.apify.com?tools=data_minds/youtube-search-api"}}}
The hosted server signs you in with OAuth the first time you connect, so no API token belongs in this configuration. If your client cannot use OAuth, send the header Authorization: Bearer <YOUR_APIFY_TOKEN>.
๐ Other YouTube scrapers
| Scraper | What it does |
|---|---|
| ๐ Google Search Result Scraper | Searches Google in bulk and returns every result as a row: title, link, snippet, rank, date and related searches. |
| ๐ Google Trends Scraper | Collects Google Trends data: interest over time, regions, cities, related queries, keyword comparison and live Trending Now searches. |
| ๐ YouTube Hashtag Search Scraper | Collects videos and Shorts posted under any YouTube hashtag, with titles, views, likes, comments, channels, publish dates, tags and descriptions. |
| ๐ YouTube Transcript & Subtitles Scraper API | Gets the transcript of any YouTube video, Short, playlist, channel or search: timestamped captions, SRT, WebVTT and TXT, chapters and channel details. |
| ๐ YouTube Trending Shorts Scraper | Finds trending YouTube Shorts for any keyword or hashtag: views, likes, comments, views per day, viral score, engagement rate and channel. |
โ FAQ
๐ก Is it legal to scrape YouTube search results?
Web scraping is generally legal if you extract publicly available data. However, results can include personal data such as channel names and public contact emails, which laws like GDPR protect. Only collect personal data with a legitimate reason, and take YouTube's Terms of Service into account before you run it.
๐ง How does YouTube Search API work?
You add one or more searches, choose the result type and optional filters, and press Start. The Actor runs each search separately and returns the results as one row per video, Short, channel or playlist. Optional steps add full video details, channel details and a short transcript snippet to every row.
๐ฏ Why use YouTube Search API instead of the official YouTube API?
It needs no YouTube API key and no Google Cloud project: you type searches and get rows. Each row can combine video statistics, hashtags, engagement, channel subscribers, country, social links and a public contact email, so you do not have to join separate lists yourself.
๐ Can I use YouTube Search API as an API?
Yes. Start a run with the Apify API, pass your searches as JSON, and read the dataset items when it finishes. A one-call endpoint returns results directly for short runs, and an OpenAPI definition is available. Ready-made curl, Python, JavaScript and CLI examples are in the Integrations and API section above.
๐ค Can I use YouTube Search API with AI agents (MCP server)?
Yes. Add the hosted Apify MCP server URL with the tools parameter set to data_minds/youtube-search-api, and your AI assistant can run the Actor and read the results. The first connection signs you in with OAuth. The Server tab of the Actor shows the same connection settings.
๐งฉ Can I connect YouTube Search API to Google Sheets, Make or Zapier?
Yes. Apify integrations connect the Actor with Google Sheets, Make, Zapier, n8n, Slack and many other tools. Schedule a run, then use a webhook or an integration to send each new batch of results to your sheet, chat or workflow automatically when the run finishes.
๐ Why did I get fewer results than my limit?
The search may have fewer matches than your limit, or your filters may remove some. Date range, video length, features and live-stream status all narrow the list. Widen them, run a small test, and compare the counts. If the run reached your spend limit, the status message says so.
๐ Why do the numbers differ from what YouTube shows?
YouTube rounds large counts, such as 3.45M subscribers or 23K comments, and the Actor returns the same rounded values. Views and likes also change over time as people keep watching. Results can differ slightly between countries and languages, exactly like YouTube search itself.
โ Why is the Actor not working or returning no results?
The search may have no matches for your filters, or YouTube may be temporarily unreachable. Try a broader search and fewer filters, then run a small test again. If it still fails, report it on the Issues tab with your input.
๐ฌ Support and feedback
Found a bug or have a feature request? Please create an issue on the Issues tab.
Need a custom solution or more data? Contact us at hello.dataminds@gmail.com.
Built and maintained by data_minds. This Actor is an independent tool and is not affiliated with, endorsed by or sponsored by YouTube or Google.