YouTube Search Results Scraper avatar

YouTube Search Results Scraper

Pricing

from $2.99 / 1,000 search results

Go to Apify Store
YouTube Search Results Scraper

YouTube Search Results Scraper

Collect current YouTube search results for videos, Shorts, channels, and playlists with paginated, deduplicated metadata and locale-aware source context.

Pricing

from $2.99 / 1,000 search results

Rating

0.0

(0)

Developer

w3crawler

w3crawler

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

1

Monthly active users

25 days ago

Last modified

Categories

Features

Limited permissions

Share

Collect current public YouTube search results for videos, Shorts, channels, and playlists. The Actor requests the ordinary rendered search page, parses its embedded ytInitialData, deduplicates results, and records rank, type, title, channel, duration, displayed views or live viewers, thumbnails, destination URL, and search provenance.

The 2026-10-25 saved run searched for NASA Artemis and saved five video results from the first page.

Get started

  1. Open the Actor Store page and select Try for free or open the Input tab.
  2. Enter a required query.
  3. Choose resultType and sortBy if you need a narrower search. Keep maxItems and maxPages small for the first run.
  4. Start the Actor, open the dataset, and export the rows as JSON, CSV, or Excel. Open Run summary (OUTPUT) to check counts and pagination.

Input

query is required. Other fields are optional; the defaults below are ready to use. Unsupported field names and out-of-range values are rejected before requests start.

FieldTypeRequired?DefaultMeaning
querystringRequiredNot supplied (prefill machine learning)Keyword or phrase to search on YouTube, 1–500 characters.
maxItemsintegerOptional50Maximum unique public results to save, 1–500.
maxPagesintegerOptional3Maximum rendered search pages to request, 1–30. Stops on duplicate pages.
resultTypestring enumOptionalallall, video, short, channel, or playlist. Type-specific searches must use relevance sorting.
sortBystring enumOptionalrelevancerelevance, upload_date, view_count, or rating.
languageCodestringOptionalenYouTube UI language, such as en or pt-BR.
countryCodestringOptionalUSTwo-letter country code for public search locale context.
requestDelayMsintegerOptional250Pacing delay between public page requests, 0–5000 ms.
requestTimeoutSecsintegerOptional60Timeout for each public search page, 15–180 seconds.
maxRequestRetriesintegerOptional2Accepted for Cloud input compatibility; the local public-page transport performs one bounded attempt and treats access boundaries as terminal.
requestDelayMillisintegerOptionalNot suppliedCloud alias for requestDelayMs, 0–5000 ms.
includeDiagnosticsbooleanOptionaltrueRecord bounded source diagnostics in the run summary when a page is blocked or fails.
proxyConfigurationobjectOptional{"useApifyProxy":false}Accepted for Cloud input compatibility only. The transport connects directly and never applies proxy routing or rotation.

Example input using the query prefill and every default:

{
"query": "machine learning",
"maxItems": 50,
"maxPages": 3,
"resultType": "all",
"sortBy": "relevance",
"languageCode": "en",
"countryCode": "US",
"requestDelayMs": 250,
"requestTimeoutSecs": 60,
"maxRequestRetries": 2,
"includeDiagnostics": true,
"proxyConfiguration": {
"useApifyProxy": false
}
}

The Actor reads one public search query and paginates with the ordinary page parameter. It does not use the private YouTube search API, rotate client fingerprints, use a browser fallback, or apply proxy routing. The proxyConfiguration field is accepted but ignored, and maxRequestRetries is a compatibility field.

Output

The dataset contains one row per unique public result. Optional values are omitted when the result type or source does not publish them; they are never inferred. No diagnostic or placeholder rows are written.

FieldTypeAvailabilityMeaning
recordTypestringAlwaysyoutube_search_result.
rankintegerAlwaysOne-based position in the collected result set after deduplication.
querystringAlwaysSearch query used.
pageintegerAlwaysPublic search page number.
resultTypestringAlwaysNormalized type: video, short, channel, or playlist.
titlestringAlwaysResult title.
descriptionstringWhen publishedDescription snippet exposed by the result.
descriptionLengthintegerWhen publishedCharacter count of description.
accessibilityTextstringWhen publishedAccessibility label from the card.
videoIdstringWhen applicable11-character video ID for video and Short results.
playlistIdstringWhen applicablePlaylist identifier for playlist results.
channelIdstringWhen applicableChannel identifier for channel results or channel-linked videos.
urlstringAlwaysPrimary destination URL for the result.
watchUrlstringWhen applicableCanonical YouTube watch URL for video results.
channelNamestringWhen publishedChannel name.
channelUrlstringWhen publishedChannel URL.
channelProfileUrlstringWhen publishedChannel profile URL when distinct from channelUrl.
verifiedbooleanWhen publishedVerified flag exposed by the card.
isVerifiedbooleanWhen publishedAlternate verified flag when exposed.
badgesstring arrayWhen publishedPublic card badges.
subscriberCountTextstringWhen applicableDisplayed subscriber label.
subscriberCountintegerWhen applicableParsed subscriber count.
videoCountTextstringWhen applicableDisplayed playlist or channel video count.
viewCountTextstringWhen publishedDisplayed view or live-viewer label.
viewCountintegerWhen publishedParsed view total.
publishedTimeTextstringWhen publishedRelative publication label.
durationstringWhen applicableDisplayed duration for video and Short results.
durationSecondsintegerWhen applicableParsed duration in seconds.
metadataLinesstring arrayWhen publishedAdditional card metadata lines.
videosobject arrayWhen applicablePreview videos for a playlist or channel result, with videoId and title.
previewVideoCountintegerWhen applicableNumber of preview videos exposed.
isShortbooleanWhen applicableWhether the result is a Short.
isLivebooleanWhen publishedWhether the result is live.
isUpcomingbooleanWhen publishedWhether the result is upcoming.
liveBroadcastDetailsobjectWhen publishedLive details with startTime when exposed.
thumbnailUrlstringWhen publishedPreferred thumbnail URL.
thumbnailsobject arrayWhen publishedThumbnails with url, width, and height.
thumbnailCountintegerWhen publishedNumber of retained thumbnails.
searchPageUrlstringCurrent code onlyPublic search page URL used for the row. Declared by the current dataset schema, but absent from the legacy saved rows shown below.
languageCodestringCurrent code onlyLanguage context used for the search.
countryCodestringCurrent code onlyCountry context used for the search.
requestedResultTypestringCurrent code onlyRequested resultType.
sortBystringCurrent code onlyRequested sort order.
paginationMethodstringCurrent code onlypublic-search-page-query.
resultSourcestringCurrent code onlyRenderer family that supplied the result.
metadataEnrichedbooleanCurrent code onlyAlways true for emitted rows.
metadataSourcestringCurrent code onlyyoutube-public-search-page.
extractionMethodstringCurrent code onlyEmbedded initial-data extraction method.
sourceTypestringCurrent code onlyyoutube-search.
sourcestringCurrent code onlyyoutube-public-search-page.
scrapedAtstringAlwaysTime the row was saved, in ISO UTC.

Real saved row and schema note

The stored rows in this workspace were produced by an earlier extraction build. They contain two fields that the current dataset schema does not declare, requestProfile and searchUrl, and they omit the current provenance fields marked Current code only above. The row below is a real saved row, not a sample of the current 51-field contract.

{
"recordType": "youtube_search_result",
"rank": 1,
"query": "NASA Artemis",
"page": 1,
"resultType": "video",
"title": "NASA Artemis update details lunar plans, but not where they are today or when they are going",
"channelName": "Philip Sloss",
"channelId": "UCh9esSNWQq1-IGVoOOUGx8Q",
"channelUrl": "https://www.youtube.com/@PhilipSloss",
"verified": false,
"badges": [
"New"
],
"thumbnailUrl": "https://i.ytimg.com/vi/YhqA1z018sQ/hq720.jpg",
"thumbnails": [
{
"url": "https://i.ytimg.com/vi/YhqA1z018sQ/hq720.jpg",
"width": 360,
"height": 202
},
{
"url": "https://i.ytimg.com/vi/YhqA1z018sQ/hq720.jpg",
"width": 720,
"height": 404
}
],
"thumbnailCount": 2,
"scrapedAt": "2026-10-25T21:21:33.962Z",
"requestProfile": "chrome-windows",
"searchUrl": "https://www.youtube.com/results?search_query=NASA+Artemis&hl=en&gl=US",
"videoId": "YhqA1z018sQ",
"url": "https://www.youtube.com/watch?v=YhqA1z018sQ",
"watchUrl": "https://www.youtube.com/watch?v=YhqA1z018sQ",
"duration": "32:26",
"durationSeconds": 1946,
"viewCountText": "4,314 views",
"viewCount": 4314,
"publishedTimeText": "9h ago",
"isLive": false,
"isUpcoming": false
}

Run summary

Run summary is stored separately from the dataset in the run key-value store under OUTPUT. The table describes the current 24-field summary written by the current code.

FieldMeaning
runTypeyoutube-public-search-run.
statusActor outcome: SUCCEEDED or FAILED.
dataStatusCOMPLETE, PARTIAL, NO_RESULTS, or FAILED.
dataAvailableWhether at least one row was saved.
requestedQueryQuery used for the run.
requestedResultTypeRequested result type.
sortByRequested sort order.
maxItemsResult cap.
maxPagesPage cap.
pagesFetchedSearch pages fetched.
pagesWithResultsPages that produced at least one result.
itemCountRows saved.
diagnosticCountBounded diagnostics recorded.
failedCountFailed request or extraction events.
blockedCountEvents classified as blocked.
proxyRequestedAlways false; the transport is direct-only.
proxyConfiguredAlways false.
includeDiagnosticsWhether diagnostics were enabled.
requestDelayMsPacing delay between pages.
requestTimeoutSecsPer-page timeout.
paginationMethodpublic-search-page-query.
durationMsActor runtime in milliseconds.
finishedAtTime the summary was written, in ISO UTC.
runStatusCanonical run status; matches status.
StatusData statusMeaning
SUCCEEDEDCOMPLETEResults were saved without a later extraction problem.
SUCCEEDEDPARTIALSome results were saved, but a later page or result failed.
SUCCEEDEDNO_RESULTSThe search completed cleanly and returned no matching results.
FAILEDFAILEDA fatal error occurred before any usable result was saved.

The OUTPUT file in this workspace is a real summary written by an earlier build and uses a different nine-field shape: status, errorCode, resultCount, recordsCollected, pagesProcessed, datasetWriteState, resultAvailability, startedAt, and finishedAt. It predates the current 24-field summary above, so it is not used as the contract example.

Example of the legacy saved OUTPUT:

{
"status": "SUCCEEDED",
"errorCode": null,
"resultCount": 5,
"recordsCollected": 5,
"pagesProcessed": 1,
"datasetWriteState": "succeeded",
"resultAvailability": "PRESENT",
"startedAt": "2026-10-25T21:21:33.768Z",
"finishedAt": "2026-10-25T21:21:38.044Z"
}

Coverage and limitations

The Actor searches one public query through ordinary rendered result pages. resultType filters the normalized cards, and type-specific searches require sortBy: "relevance". Pagination uses the ordinary page parameter and stops when a page repeats. maxItems caps unique results after deduplication.

The direct transport makes one bounded attempt per request and treats blocks, challenges, and redirects as terminal. maxRequestRetries and proxyConfiguration are accepted for input compatibility but do not add retries or proxy routing. There is no browser fallback.

Location and language are page-context hints, not proof that results are the same as those seen by a user in that country. Rankings, view counts, subscriber counts, and titles are point-in-time. The Actor does not sign in, use private APIs, bypass access controls, or download media. Blocked, empty, or partial pages are reported in OUTPUT and logs rather than written as dataset rows.

The saved dataset rows and saved OUTPUT in this workspace come from an earlier build, so current provenance fields such as searchPageUrl and the 24-field summary are not represented in those stored artifacts. The current source and dataset schema are authoritative for new runs.

Usage and support

Cost depends on Apify compute and the number of rendered search pages. There is no proxy or browser cost because the transport is direct-only. Start with one page and a small maxItems; raise maxPages only when you need more results. See the Actor's Pricing tab for current account rates.

Use the Actor Issues page to report a problem. Include the run ID, the input used, and the OUTPUT summary; do not include tokens, cookies, or private data. This Actor is not affiliated with, endorsed by, or sponsored by YouTube or Google. Use it only for public data and in accordance with the source's terms, robots guidance, and applicable law. Public pages can contain personal information; use the output only for lawful purposes.