SFOLN

Catalogue / Social media data

YouTube Search Scraper

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.

About

What it does

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

EventPricePer 1,000Charged for
YouTube search result
youtube-search-result
$0.0004$0.40 / 1,000Charged 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,000Charged 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}'
mcp.json · hosted Apify MCP server
{
  "mcpServers": {
    "apify": {
      "type": "http",
      "url": "https://mcp.apify.com?tools=sfoln/youtube-search"
    }
  }
}
asynchronous run · for large batches
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.

FieldTypeDefaultMeaning
queries *arrayrequiredSearch 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.
maxResultsPerQueryinteger20Max 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.
uploadDatestring"any"Upload date
Only return videos uploaded within this period. One of "any", "today", "this_week", "this_month", "this_year".
sortBystring"relevance"Sort by
relevance (YouTube's default ranking) or popular (most viewed). One of "relevance", "popular".
typestring"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".
durationstring"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".
regionstring—Region
Optional 2-letter country code (e.g. US, GB, DE) to search as a viewer from that country.
maxQueriesinteger100Max queries
Safety cap on the number of queries processed in this run. Range 1–1000.
concurrencyinteger4Concurrency
How many queries are searched in parallel (1–8). Range 1–8.
itemTimeoutSecsinteger600Time 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.
includeRawbooleanfalseInclude 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.

FieldTypeMeaning
inputstring | objectInput
The search query as provided.
recordTypestringRecord type
result (one per video result, charged) | query (one summary per query, never charged) e.g. "result"
querystringQuery
positionintegerPosition
1-based position in the delivered results for the query (videos, then live, then Shorts within each page).
videoIdstring | nullVideo ID
urlstring | nullURL
typestring | nullType
video | short | live
titlestring | nullTitle
descriptionstring | nullDescription snippet
Usually null (YouTube search does not return descriptions).
channelNamestring | nullChannel name
channelIdstring | nullChannel ID
channelHandlestring | nullChannel handle
channelUrlstring | nullChannel URL
publishedAtstring | nullPublished at
ISO 8601, approximate (derived from YouTube's relative time).
publishedTimeTextstring | nullPublished (relative)
e.g. "2 years ago".
durationSecsnumber | nullDuration (s)
durationTextstring | nullDuration
viewCountnumber | nullViews
viewCountTextstring | nullViews (text)
likeCountnumber | nullLikes
Usually null in search results.
commentCountnumber | nullComments
Usually null in search results.
thumbnailUrlstring | nullThumbnail URL
isShortboolean | nullIs Short
isLiveboolean | nullIs live
badgesarrayBadges
filtersobjectFilters
query records only: the filters applied.
resultsDeliveredintegerResults delivered
query records only.
pagesFetchedintegerPages fetched
query records only.
pagesChargedintegerPages charged
query records only: number of youtube-search-query events.
reachedEndbooleanReached end
query records only.
stopReasonstringStop reason
query records only: limit | end | budget | deadline | max_pages | empty_pages | error
statusstringStatus
ok | not_found | error | skipped_invalid | skipped_budget | skipped_free_plan e.g. "ok"
chargedbooleanCharged
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.
chargedEventstringCharged event
errorobjectError
warningsarrayWarnings
sourcestringSource
fetchedAtstringFetched at
Example record
{
  "input": "lofi hip hop",
  "recordType": "result",
  "query": "lofi hip hop",
  "position": 1,
  "videoId": "BzSzwqb-OEE",
  "url": "https://www.youtube.com/watch?v=BzSzwqb-OEE",
  "type": "video",
  "title": "NF - RUNNING (Audio)",
  "description": null,
  "channelName": "NFrealmusic",
  "channelId": "UCoRR6OLuIZ2-5VxtnQIaN2w",
  "channelHandle": null,
  "channelUrl": "https://www.youtube.com/channel/UCoRR6OLuIZ2-5VxtnQIaN2w",
  "publishedAt": "2023-05-28T17:08:46.499Z",
  "publishedTimeText": "2 years ago",
  "durationSecs": 254,
  "durationText": "4:14",
  "viewCount": 14860541,
  "viewCountText": "14,860,541 views",
  "likeCount": null,
  "commentCount": null,
  "thumbnailUrl": "https://i.ytimg.com/vi/BzSzwqb-OEE/hq720.jpg",
  "isShort": false,
  "isLive": false,
  "badges": [],
  "status": "ok",
  "charged": true,
  "chargedEvent": "youtube-search-result",
  "source": "scrapecreators",
  "fetchedAt": "2026-10-14T10:00:00.000Z"
}

Machine-readable

This page for agents