YouTube Search Results Scraper
Pricing
from $2.99 / 1,000 search results
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
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
1
Monthly active users
25 days ago
Last modified
Categories
Features
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
- Open the Actor Store page and select Try for free or open the Input tab.
- Enter a required
query. - Choose
resultTypeandsortByif you need a narrower search. KeepmaxItemsandmaxPagessmall for the first run. - 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.
| Field | Type | Required? | Default | Meaning |
|---|---|---|---|---|
query | string | Required | Not supplied (prefill machine learning) | Keyword or phrase to search on YouTube, 1–500 characters. |
maxItems | integer | Optional | 50 | Maximum unique public results to save, 1–500. |
maxPages | integer | Optional | 3 | Maximum rendered search pages to request, 1–30. Stops on duplicate pages. |
resultType | string enum | Optional | all | all, video, short, channel, or playlist. Type-specific searches must use relevance sorting. |
sortBy | string enum | Optional | relevance | relevance, upload_date, view_count, or rating. |
languageCode | string | Optional | en | YouTube UI language, such as en or pt-BR. |
countryCode | string | Optional | US | Two-letter country code for public search locale context. |
requestDelayMs | integer | Optional | 250 | Pacing delay between public page requests, 0–5000 ms. |
requestTimeoutSecs | integer | Optional | 60 | Timeout for each public search page, 15–180 seconds. |
maxRequestRetries | integer | Optional | 2 | Accepted for Cloud input compatibility; the local public-page transport performs one bounded attempt and treats access boundaries as terminal. |
requestDelayMillis | integer | Optional | Not supplied | Cloud alias for requestDelayMs, 0–5000 ms. |
includeDiagnostics | boolean | Optional | true | Record bounded source diagnostics in the run summary when a page is blocked or fails. |
proxyConfiguration | object | Optional | {"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.
| Field | Type | Availability | Meaning |
|---|---|---|---|
recordType | string | Always | youtube_search_result. |
rank | integer | Always | One-based position in the collected result set after deduplication. |
query | string | Always | Search query used. |
page | integer | Always | Public search page number. |
resultType | string | Always | Normalized type: video, short, channel, or playlist. |
title | string | Always | Result title. |
description | string | When published | Description snippet exposed by the result. |
descriptionLength | integer | When published | Character count of description. |
accessibilityText | string | When published | Accessibility label from the card. |
videoId | string | When applicable | 11-character video ID for video and Short results. |
playlistId | string | When applicable | Playlist identifier for playlist results. |
channelId | string | When applicable | Channel identifier for channel results or channel-linked videos. |
url | string | Always | Primary destination URL for the result. |
watchUrl | string | When applicable | Canonical YouTube watch URL for video results. |
channelName | string | When published | Channel name. |
channelUrl | string | When published | Channel URL. |
channelProfileUrl | string | When published | Channel profile URL when distinct from channelUrl. |
verified | boolean | When published | Verified flag exposed by the card. |
isVerified | boolean | When published | Alternate verified flag when exposed. |
badges | string array | When published | Public card badges. |
subscriberCountText | string | When applicable | Displayed subscriber label. |
subscriberCount | integer | When applicable | Parsed subscriber count. |
videoCountText | string | When applicable | Displayed playlist or channel video count. |
viewCountText | string | When published | Displayed view or live-viewer label. |
viewCount | integer | When published | Parsed view total. |
publishedTimeText | string | When published | Relative publication label. |
duration | string | When applicable | Displayed duration for video and Short results. |
durationSeconds | integer | When applicable | Parsed duration in seconds. |
metadataLines | string array | When published | Additional card metadata lines. |
videos | object array | When applicable | Preview videos for a playlist or channel result, with videoId and title. |
previewVideoCount | integer | When applicable | Number of preview videos exposed. |
isShort | boolean | When applicable | Whether the result is a Short. |
isLive | boolean | When published | Whether the result is live. |
isUpcoming | boolean | When published | Whether the result is upcoming. |
liveBroadcastDetails | object | When published | Live details with startTime when exposed. |
thumbnailUrl | string | When published | Preferred thumbnail URL. |
thumbnails | object array | When published | Thumbnails with url, width, and height. |
thumbnailCount | integer | When published | Number of retained thumbnails. |
searchPageUrl | string | Current code only | Public search page URL used for the row. Declared by the current dataset schema, but absent from the legacy saved rows shown below. |
languageCode | string | Current code only | Language context used for the search. |
countryCode | string | Current code only | Country context used for the search. |
requestedResultType | string | Current code only | Requested resultType. |
sortBy | string | Current code only | Requested sort order. |
paginationMethod | string | Current code only | public-search-page-query. |
resultSource | string | Current code only | Renderer family that supplied the result. |
metadataEnriched | boolean | Current code only | Always true for emitted rows. |
metadataSource | string | Current code only | youtube-public-search-page. |
extractionMethod | string | Current code only | Embedded initial-data extraction method. |
sourceType | string | Current code only | youtube-search. |
source | string | Current code only | youtube-public-search-page. |
scrapedAt | string | Always | Time 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.
| Field | Meaning |
|---|---|
runType | youtube-public-search-run. |
status | Actor outcome: SUCCEEDED or FAILED. |
dataStatus | COMPLETE, PARTIAL, NO_RESULTS, or FAILED. |
dataAvailable | Whether at least one row was saved. |
requestedQuery | Query used for the run. |
requestedResultType | Requested result type. |
sortBy | Requested sort order. |
maxItems | Result cap. |
maxPages | Page cap. |
pagesFetched | Search pages fetched. |
pagesWithResults | Pages that produced at least one result. |
itemCount | Rows saved. |
diagnosticCount | Bounded diagnostics recorded. |
failedCount | Failed request or extraction events. |
blockedCount | Events classified as blocked. |
proxyRequested | Always false; the transport is direct-only. |
proxyConfigured | Always false. |
includeDiagnostics | Whether diagnostics were enabled. |
requestDelayMs | Pacing delay between pages. |
requestTimeoutSecs | Per-page timeout. |
paginationMethod | public-search-page-query. |
durationMs | Actor runtime in milliseconds. |
finishedAt | Time the summary was written, in ISO UTC. |
runStatus | Canonical run status; matches status. |
| Status | Data status | Meaning |
|---|---|---|
SUCCEEDED | COMPLETE | Results were saved without a later extraction problem. |
SUCCEEDED | PARTIAL | Some results were saved, but a later page or result failed. |
SUCCEEDED | NO_RESULTS | The search completed cleanly and returned no matching results. |
FAILED | FAILED | A 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.