YouTube Search API: Videos, Views & Channels as JSON avatar

YouTube Search API: Videos, Views & Channels as JSON

Pricing

from $1.00 / 1,000 videos

Go to Apify Store
YouTube Search API: Videos, Views & Channels as JSON

YouTube Search API: Videos, Views & Channels as JSON

YouTube Search API: search results as JSON for any keyword, with video title, URL, views, channel, duration, upload date and position. Date, length, Shorts and live filters. No API key, no quota. Pay per video plus a small start fee; only-new-videos mode adds a fee per 20 results checked.

Pricing

from $1.00 / 1,000 videos

Rating

0.0

(0)

Developer

PlainRows

PlainRows

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

8 hours ago

Last modified

Share

A YouTube Search API that returns the YouTube search results for any keyword as clean JSON: video title, URL, views, channel, duration, upload date, badges (4K, CC, New, LIVE), Shorts and live flags, and position in the results. Up to about 200 videos per search, in 20 countries. One HTTP call, results in seconds.

A YouTube Data API alternative: no API key, no Google Cloud project, no quota. It calls a commercial search data API instead of driving a browser, so there are no proxies to manage either. You pay per video returned, plus a small start fee per run (and a small check fee with Only new videos): searches with no result, channels, playlists, repeated videos and videos removed by your filters are free.

Typical uses

  • Search YouTube from your app or backend: send keywords, get videos with views, channel, duration and date as JSON, without the default quota of the official API (about 100 searches a day).
  • YouTube SEO and rank tracking: schedule the same queries daily or weekly and track the position of your videos and your competitors'.
  • Monitoring new videos: turn on Only new videos and schedule the run to get (and pay for) each new upload about a brand, product or topic once.
  • Influencer and channel discovery: find the channels that publish on a topic, with their channel ID and URL.
  • Datasets for analysis and AI agents: titles, descriptions, durations and view counts as JSON for spreadsheets, BI tools or LLM pipelines.

Call the API

One call, results returned directly:

curl -X POST "https://api.apify.com/v2/acts/plainrows~youtube-search-api/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchQueries": ["how to make sourdough bread"], "maxResultsPerQuery": 20}'

The response is a JSON array, one object per video (fields below). You only need an Apify token: no YouTube API key.

What you get for each video

FieldDescription
videoId, title, urlVideo ID, title and clean link (youtube.com/watch?v=... or youtube.com/shorts/...)
channelName, channelId, channelUrlThe channel that published it
viewsCountTotal views (null for a stream that is live now)
liveViewersPeople watching now, for a stream that is live now
publishedRelativeUpload age as YouTube shows it, e.g. "2 years ago" (in the search language)
publishedDateApproxApproximate upload date (YYYY-MM-DD) computed from that age; English results only, otherwise null
durationText, durationSecondsDuration, e.g. "11:53" and 713
isShort, isLive, isMovieYouTube Short, live now, YouTube movie
badgesBadges shown in the results: 4K, CC, New, LIVE, 5 products... (in the search language)
descriptionDescription snippet shown in the results (not the full description)
thumbnailUrlThumbnail image
positionPosition among the videos on the results page (1 = first video; channels, playlists and repeats not counted)
shelfNameResults shelf the video was in, e.g. "Latest from MrBeast"; null in the main list
searchQuery, searchCountry, languageCode, observedAtThe query, country, language and fetch time (UTC)

Missing values are always null, never guessed. Each video appears once per query, even when YouTube shows it twice.

Channels and playlists that appear in the results are skipped (they are counted in the run summary, not billed): this Actor returns one clean row per video.

Input

{
"searchQueries": ["how to make sourdough bread", "sourdough starter"],
"maxResultsPerQuery": 50,
"country": "US",
"sortBy": "relevance",
"uploadDate": "any",
"duration": "any",
"includeShorts": true,
"includeLive": true
}
  • searchQueries: up to 1,000 per run, exactly what you would type in YouTube.
  • maxResultsPerQuery: 1 to 200 (default 50). YouTube itself shows about 200 videos per search at most.
  • country: US, GB, CA, AU, IE, IN, DE, AT, CH, FR, BE, ES, MX, IT, NL, PT, BR, PL, SE, JP. languageCode (optional) sets the interface language of the results.
  • YouTube filters: sortBy (relevance, popularity), uploadDate (any, today, week, month, year), duration (any, short under about 4 min, medium about 4-20 min, long over 20 min). They are applied by YouTube itself, like in the search page filters.
  • includeShorts / includeLive: set to false to skip Shorts or live streams. Skipped videos are never billed.
  • onlyNewVideos (optional, monitoring): return only videos never delivered to you before for the same query, country and language. See below.
  • monitorName (optional): name of the key-value store in your account that remembers delivered videos (default plainrows-youtube-monitor).

Monitor a topic: get only new videos

Turn on Only new videos ("onlyNewVideos": true) and add an Apify schedule (daily, for example). The first run returns every video it finds and remembers their IDs in a key-value store of your own Apify account; each later run returns and bills only videos it has never delivered. A query with nothing new gets a free row with notFoundReason: "no-new-videos".

Check fee in this mode: each block of 20 YouTube results checked costs one small page-checked event (about what the data source charges us), even when nothing new is found. It is never charged for a search the data source answered in an unexpected format (no results list): the run warns about it in the log and in its summary. Keep maxResultsPerQuery close to the number of new videos you expect per run. Runs without Only new videos never pay it.

  • Combine it with uploadDate: "week" (or "today") so the search focuses on recent uploads. Videos left out by maxResultsPerQuery or your run budget stay new for the next run.
  • History is kept per query, country and language (sort and filters are ignored). Use a different monitorName per monitoring task to keep separate histories, or a new name to start over. Leave the option off for rank tracking, which needs the full list every time.

Output example

Real row from a run on 2026-10-07 (query how to make sourdough bread, US):

{
"searchQuery": "how to make sourdough bread",
"found": true,
"position": 1,
"videoId": "4gEoh3sk2AE",
"title": "Bake the Perfect Sourdough Bread: A Step-by-Step Guide",
"url": "https://www.youtube.com/watch?v=4gEoh3sk2AE",
"channelName": "Natashas Kitchen",
"channelId": "UC-pC1xsFPzcrL09DaW4jlBA",
"channelUrl": "https://www.youtube.com/@Natashaskitchen",
"viewsCount": 3339945,
"liveViewers": null,
"publishedRelative": "2 years ago",
"publishedDateApprox": "2024-10-07",
"durationText": "11:53",
"durationSeconds": 713,
"isShort": false,
"isLive": false,
"isMovie": false,
"badges": [
"5 products",
"Earns commission"
],
"description": "Learn how to bake sourdough bread with the perfect rise, ear, and texture—just like you've always dreamed of! This step-by-step ...",
"thumbnailUrl": "https://i.ytimg.com/vi/4gEoh3sk2AE/hq720.jpg?sqp=-oaymwEnCNAFEJQDSFryq4qpAxkIARUAAIhCGAHYAQHiAQoIGBACGAY4AUAB&rs=AOn4CLASw7ts_TryRzlFrKiW0X28z04f7Q",
"shelfName": null,
"searchCountry": "US",
"languageCode": "en",
"observedAt": "2026-10-07T13:14:10.701Z",
"schemaVersion": "1.0"
}

Pricing

Pay per video returned, no subscription, no proxy costs. See the Pricing tab for current prices: one event per video found, cheaper on higher Apify plans, plus a small Actor start fee of $0.003 per run (one event per GB of memory; the Actor uses at most 1 GB). With Only new videos, each block of 20 results checked also costs a small page-checked event. All fields and all filters are included in that price (no add-ons).

Searches with no result, channels, playlists, repeated videos, videos removed by your filters and input mistakes cost nothing beyond the start fee. The run never spends more than the maximum cost you set. If many searches in a row return nothing billable (about $0.01 of data-provider calls), the run stops early and says so in its status; the searches not run are not charged.

Free Apify plan: each run returns up to 20 videos for up to 2 queries, so you can check the output. A paid Apify plan removes these limits.

Use it from code, automations or AI agents

API: see Call the API above; the Apify API clients for JavaScript and Python work too (plainrows/youtube-search-api).

n8n, Make, Zapier: use the Apify integration, pick plainrows/youtube-search-api, and send the dataset items to Google Sheets, Airtable, Notion or your database.

AI agents (MCP): add https://mcp.apify.com?tools=plainrows/youtube-search-api to Claude, Cursor or any MCP client. The agent gets a typed YouTube search tool and pays per result.

What this is not

  • No comments, no likes, no subscriber counts, no transcripts, no video downloads. It returns what the YouTube search results page shows.
  • The description is the snippet shown in search, not the full description.
  • publishedDateApprox is derived from YouTube's rounded age ("2 years ago"), so it can be off by months for old videos.
  • Not affiliated with YouTube or Google.

Run summary

Each run stores a summary in the key-value store (OUTPUT): queries run, queries with no result, videos billed, videos removed by filters, repeated videos, channels and playlists skipped, duplicate and invalid queries, and anything skipped because of the free-plan or budget limit.

FAQ

How do I search YouTube through an API? Send your keywords to the endpoint above (or enter them one per line in the console) and get one JSON object per video with title, URL, views, upload date, duration, channel and position.

How many videos per search? 1 to 200 (maxResultsPerQuery); YouTube itself shows about 200 videos per search at most.

Can I filter by upload date or duration? Yes: uploadDate (today, week, month, year), duration (short, medium, long) and sortBy (relevance, popularity) are YouTube's own filters. Set includeShorts or includeLive to false to skip them for free.

Does it return comments, likes or transcripts? No: it returns what the YouTube search results page shows. No comments, likes, subscriber counts, transcripts or downloads.

Do I need a YouTube API key or a Google Cloud project? No. Unlike the YouTube Data API, there is no key to create and no daily quota: you pay per video returned, plus a small start fee per run.

Is this the official YouTube Data API? No. It returns what the YouTube search results page shows, as JSON. It is not affiliated with YouTube or Google.

More PlainRows tools

Same pay-per-result pricing, same clean JSON, built to chain together in n8n, Make, Zapier or AI agents.

Support

Missing a field or found a bug? Open an issue on this page. Issues are read and answered.