sfoln/youtube-search · Social media, Videos, Automation On request
Search YouTube by keyword with upload date, sort, type, duration and country filters: title, URL, channel, views, duration, publish date and Shorts or live flags, one JSON record per result. $0.40 per 1,000 results + $0.003 per page of ~20. No API key needed.
YouTube Search Scraper searches YouTube by keyword and returns one clean dataset record per video result: video ID, URL, title, channel (name, ID, handle, URL), views, duration, publish date, thumbnail and Short / live flags. You can filter by upload date, sort by relevance or popularity, limit results to videos or Shorts, filter by duration and search from a specific country. It's built for content research, SEO and keyword tracking, trend monitoring, influencer discovery and AI agents that need YouTube search results as JSON.
Price
Price per delivered record
Event
Price
Per 1,000
Charged for
YouTube search result youtube-search-result
$0.0004
$0.40 / 1,000
Charged once per video result (video, Short or live stream) delivered as a dataset record. Query summary records are never charged.
YouTube search page youtube-search-query
$0.003
$3 / 1,000
Charged once per page of search results fetched for a query (about 20 results per page) that delivered at least one result, or that the provider billed although it had no new results (e.g. a query with no results). Covers the per-request upstream fee.
Apify free plan: up to 10 items per run. Paid plans have no per-run cap; set maxTotalChargeUsd to cap spend.
Run
Call it from code, an agent or the Console
This API is private on Apify for now. Email us and we will publish it for you, usually within two working days. The calls below work once it is public. contact@sfoln.com
curl · synchronous run, rows in the response
curl -X POST "https://api.apify.com/v2/actors/sfoln~youtube-search/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"queries":["lofi hip hop"],"maxResultsPerQuery":10}'
POST https://api.apify.com/v2/actors/sfoln~youtube-search/runs?maxTotalChargeUsd=1
GET https://api.apify.com/v2/actor-runs/{runId} # until status is SUCCEEDED
GET https://api.apify.com/v2/datasets/{defaultDatasetId}/items?format=json
Authenticate with an Apify API token. MCP clients can instead sign in with OAuth when prompted. Example prompt for an agent: Search YouTube for "lofi hip hop" videos uploaded this week, sorted by popularity, and list the top 10 with their channels and views.
Input
Input fields
Enter one or more search queries. Each query returns one dataset record per video result (videos, Shorts, live streams) plus one summary record per query.
Field
Type
Default
Meaning
queries *
array
required
Search queries One query per line, exactly as you would type it into YouTube search. YouTube operators such as intitle:"…" work. Duplicates are removed. Accounts on the Apify free plan can process up to 10 queries per run.
maxResultsPerQuery
integer
20
Max results per query How many video results to return per query (1–200). Results are fetched in pages of about 20; each delivered result is one charged event, plus one page event per page. Range 1–200.
uploadDate
string
"any"
Upload date Only return videos uploaded within this period. One of "any", "today", "this_week", "this_month", "this_year".
sortBy
string
"relevance"
Sort by relevance (YouTube's default ranking) or popular (most viewed). One of "relevance", "popular".
type
string
"all"
Result type all = videos, Shorts and live streams as YouTube mixes them; videos = regular videos only; shorts = Shorts only. One of "all", "videos", "shorts".
duration
string
"any"
Duration Filter regular videos by length (does not apply to Shorts). One of "any", "under_3_min", "between_3_and_20_min", "over_20_min".
region
string
—
Region Optional 2-letter country code (e.g. US, GB, DE) to search as a viewer from that country.
maxQueries
integer
100
Max queries Safety cap on the number of queries processed in this run. Range 1–1000.
concurrency
integer
4
Concurrency How many queries are searched in parallel (1–8). Range 1–8.
itemTimeoutSecs
integer
600
Time limit per input (seconds) Pagination for one query stops cleanly shortly before this limit (60–3600). Raise it for very large per-input limits. Range 60–3600.
includeRaw
boolean
false
Include raw upstream response Attach the unmodified provider result object to each result record.
Example input
{
"queries": [
"lofi hip hop"
],
"maxResultsPerQuery": 10
}
Output
One record per input item
Records land in the run's dataset; a synchronous call returns them directly. Each has a status (ok is charged; everything else is free) and a charged flag. The run's OUTPUT record totals items and charges.
Field
Type
Meaning
input
string | object
Input The search query as provided.
recordType
string
Record type result (one per video result, charged) | query (one summary per query, never charged) e.g. "result"
query
string
Query
position
integer
Position 1-based position in the delivered results for the query (videos, then live, then Shorts within each page).
videoId
string | null
Video ID
url
string | null
URL
type
string | null
Type video | short | live
title
string | null
Title
description
string | null
Description snippet Usually null (YouTube search does not return descriptions).
channelName
string | null
Channel name
channelId
string | null
Channel ID
channelHandle
string | null
Channel handle
channelUrl
string | null
Channel URL
publishedAt
string | null
Published at ISO 8601, approximate (derived from YouTube's relative time).
publishedTimeText
string | null
Published (relative) e.g. "2 years ago".
durationSecs
number | null
Duration (s)
durationText
string | null
Duration
viewCount
number | null
Views
viewCountText
string | null
Views (text)
likeCount
number | null
Likes Usually null in search results.
commentCount
number | null
Comments Usually null in search results.
thumbnailUrl
string | null
Thumbnail URL
isShort
boolean | null
Is Short
isLive
boolean | null
Is live
badges
array
Badges
filters
object
Filters query records only: the filters applied.
resultsDelivered
integer
Results delivered query records only.
pagesFetched
integer
Pages fetched query records only.
pagesCharged
integer
Pages charged query records only: number of youtube-search-query events.
reachedEnd
boolean
Reached end query records only.
stopReason
string
Stop reason query records only: limit | end | budget | deadline | max_pages | empty_pages | error
status
string
Status ok | not_found | error | skipped_invalid | skipped_budget | skipped_free_plan e.g. "ok"
charged
boolean
Charged Result records: charged youtube-search-result. query summary records are never charged themselves: the youtube-search-query page fees charged for the input (including empty pages the provider billed) are counted in pagesCharged.