YouTube Posts (Videos) Search Scraper avatar

YouTube Posts (Videos) Search Scraper

Pricing

from $5.00 / 1,000 results

Go to Apify Store
YouTube Posts (Videos) Search Scraper

YouTube Posts (Videos) Search Scraper

Search YouTube videos by keyword. Multiple keywords, sort by upload date/relevance/views/rating, upload-date and date-range filters, auto-pagination. Returns title, description, channel, views, duration and thumbnails. No login needed.

Pricing

from $5.00 / 1,000 results

Rating

0.0

(0)

Developer

code craker

code craker

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

2

Monthly active users

5 days ago

Last modified

Share

Apify actor that searches YouTube videos by keyword and exports them as structured data — no login, no cookies, no YouTube API quota.

It parses the ytInitialData JSON embedded in the search results page and paginates through YouTube's own InnerTube /youtubei/v1/search continuation API. Requests go over plain HTTP first (fast and cheap); if YouTube blocks that (captcha/"unusual traffic" on flagged IPs), the actor automatically escalates to a real Chrome browser for the rest of the run — continuation requests then run inside the page as same-origin fetches.

Features

  • One keyword (query) or many (queries) — each searched separately, results combined and de-duplicated by video.
  • Sort by date (newest first), relevance, views or rating — encoded into YouTube's sp filter parameter, results restricted to videos (no channels, playlists or shorts shelves).
  • YouTube's own upload-date window (uploadDate: hour/today/week/month/year) plus approximate timeSince / timeUntil bounds enforced actor-side.
  • Auto-pagination until numberOfVideos per keyword is reached or the feed dries up (YouTube stops serving search results after roughly 500-600 per query).
  • Results are pushed page by page, so an abort or timeout keeps everything collected so far.
  • Automatic block recovery: fresh proxy IP on each retry, plain HTTP → real Chrome escalation, EU consent interstitial bypassed via cookies.
  • When a run ends with 0 results, the last page fetched is saved as DEBUG_HTML in the run's key-value store.

Input

{
"queries": ["econet", "delta corporation"],
"sort": "date",
"numberOfVideos": 100,
"uploadDate": "month",
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"],
"apifyProxyCountry": "US"
}
}

numberOfVideos applies per keyword.

Output

One dataset item per video:

{
"id": "XXaUd0fGpOs",
"url": "https://www.youtube.com/watch?v=XXaUd0fGpOs",
"title": "Artificial Intelligence: Complete path to 2030",
"description": "Search snippet of the video description...",
"channelName": "Future Business Tech",
"channelId": "UCGBO6EahCqQSyXIws1MQdDg",
"channelUrl": "https://www.youtube.com/@FutureBusinessTech",
"publishedTimeText": "1 day ago",
"created_at": "2026-07-08T09:15:00.000Z",
"viewCount": 29547,
"viewCountText": "29,547 views",
"duration": "2:02:04",
"durationSeconds": 7324,
"thumbnail": "https://i.ytimg.com/vi/XXaUd0fGpOs/hq720.jpg",
"isLive": false,
"searchQuery": "artificial intelligence",
"sort": "date",
"uploadDate": "all"
}
  • created_at is APPROXIMATE: YouTube search only exposes relative publish times ("3 weeks ago"), which we convert against the scrape time. publishedTimeText keeps the raw value. Live/upcoming items have created_at: null.
  • description is the search snippet, not the full video description.

Integration (scraping-tool)

Call it like the other outspoken_strategy/* search actors:

const res = await this.scrapingService.scrape({
url: `https://www.youtube.com/results?search_query=${encodeURIComponent(keyword)}`,
resultsLimit: requestCount,
actor: 'outspoken_strategy/youtube-post-search-scraper',
timeout,
additionalInput: {
query: keyword,
numberOfVideos: requestCount,
sort: 'date',
proxyConfiguration: { useApifyProxy: true, apifyProxyGroups: ['RESIDENTIAL'], apifyProxyCountry: 'US' }
},
scrapeType: 'youtube-keyword-search'
});

Normalization hints: url and id are ready to use; index title + description for relevance matching; viewsCountviewCount, createdTimecreated_at (approximate), author fields are channelName / channelId / channelUrl.

Local development

npm install
echo '{ "query": "artificial intelligence", "numberOfVideos": 50, "proxyConfiguration": { "useApifyProxy": false } }' > storage/key_value_stores/default/INPUT.json
npm start

Deploy with apify push.