YouTube Scraper avatar

YouTube Scraper

Pricing

from $0.35 / 1,000 videos

Go to Apify Store
YouTube Scraper

YouTube Scraper

Scrape YouTube videos from search results, channels (videos, Shorts, streams) or video URLs with full details: exact views, likes, comment count, publish date, subscribers, description and hashtags. No API key.

Pricing

from $0.35 / 1,000 videos

Rating

0.0

(0)

Developer

Solar G

Solar G

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

2

Monthly active users

12 days ago

Last modified

Security

Limited permissions

Share

Scrapes YouTube videos from search results, channels and individual video URLs, with details for every video: exact views and likes, comment count, publish date, duration, channel and subscribers, collaborators, description and hashtags. Tags, category and the exact publish time are included when YouTube serves its player data, which it often withholds from cloud servers (see the field notes). No YouTube API key or quota is needed.

For a quick one-off check without an Apify account, a free web version with a small daily limit is available at purfled.com/youtube-video-stats.

Input

Use any combination of the three sources:

FieldDescription
searchQueriesKeywords to search.
channels@handle, channel URL or channel ID. A tab in the URL (/@name/shorts, /@name/streams) is respected.
videoUrlsVideo, Shorts or live URLs, or 11-character video IDs. Several URLs on one line separated by spaces are split.
maxResultsLimit per search query and per channel tab. Default 50. Video URLs are always processed in full.
includeDetailsFull details for every video. Default true. Turn it off for a faster, cheaper listing.
channelTabsvideos, shorts, streams. Default ["videos"].
sortBySearch order: relevance or views.
uploadDateSearch filter: any, hour, today, week, month, year.
durationSearch filter: any, short (under 4 min), medium (4-20 min), long (over 20 min).
country / languageRegion and language for search and channel listings. Default US / en. Video details are always read in English, so numbers and dates parse the same way in every language.
{
"searchQueries": ["home espresso machine review"],
"channels": ["@veritasium"],
"videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
"maxResults": 100,
"uploadDate": "month"
}

Output

Every record has the same keys; a value is null when YouTube does not show it. Example from a real run (description shortened):

{
"videoId": "dQw4w9WgXcQ",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
"channel": "Rick Astley",
"channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
"channelUrl": "https://www.youtube.com/@RickAstleyYT",
"channelHandle": "@RickAstleyYT",
"channelSubscribers": 4550000,
"channelVerified": true,
"collaborators": [],
"views": 1829827344,
"concurrentViewers": null,
"likes": 19493596,
"commentCount": 2460393,
"commentCountIsExact": true,
"duration": "3:33",
"durationSec": 213,
"publishDate": "2009-10-24",
"publishedAt": "2009-10-25T06:57:33.000Z",
"isShort": false,
"isLive": false,
"isAgeRestricted": false,
"isMembersOnly": false,
"commentsTurnedOff": false,
"tags": ["rick astley", "Never Gonna Give You Up", "nggyu", "..."],
"category": "Music",
"thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
"description": "The official video for “Never Gonna Give You Up” by Rick Astley. ...",
"hashtags": ["#RickAstley", "#NeverGonnaGiveYouUp", "#OfficialMusicVideo"],
"source": "url",
"sourceValue": "dQw4w9WgXcQ",
"input": "dQw4w9WgXcQ",
"position": null,
"publishedTimeText": null,
"publishedAtApprox": null,
"dateText": "Oct 24, 2009"
}

Field notes:

  • views and likes are exact. likes is null when the creator hides it. channelSubscribers is rounded by YouTube (for example 4.55M).
  • commentCount is exact when commentCountIsExact is true. If the exact count cannot be read, the rounded figure YouTube shows (for example 5.7K) is returned with commentCountIsExact: false.
  • Videos published by several channels have every channel in collaborators; the channel fields hold the first one.
  • publishDate is the date YouTube displays, which is in US Pacific time. publishedAt is the exact timestamp in UTC, so it can fall on the next day (as in the example above).
  • Live streams have isLive: true and concurrentViewers instead of views.
  • Age-restricted videos have isAgeRestricted: true. YouTube does not show their comments to logged-out visitors, so commentCount is null.
  • YouTube often withholds player data from data-centre IP addresses, including Apify's servers, so on many runs most records lack it. On those records tags, category, publishedAt and isMembersOnly are null (unknown), and duration is taken from the search or channel listing or estimated from the replay heatmap (it can then differ by one second). durationSec is null for a video requested by URL that has no heatmap yet, such as a new Short. tags: [] means the video has no tags; tags: null means they could not be read.
  • source / sourceValue say where a video was found (search, channel or url). position is the rank in search results.
  • A video found by more than one source is returned once.

Errors:

  • An input that is not a YouTube URL, ID, channel or valid search gives an item with input and error (for example "Not a YouTube video URL or ID"). Video URLs that are private or removed give "Video not found, private or removed". Error items are not charged.
  • A search or channel tab with no videos gives an error item explaining that.
  • If details fail for a video found by search or on a channel, the listing data is kept and detailsError explains why. That record is charged as a listing only.

API usage

curl -X POST "https://api.apify.com/v2/acts/solarg~youtube-scraper/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchQueries": ["home espresso machine review"], "maxResults": 50}'
from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("solarg/youtube-scraper").call(run_input={"channels": ["@veritasium"], "maxResults": 100})
items = client.dataset(run["defaultDatasetId"]).list_items().items

Pricing

  • $0.50 per 1,000 videos (listing)
  • $0.50 per 1,000 videos for full details (charged only when includeDetails is on and the details were retrieved)

That is $1.00 per 1,000 fully detailed videos. Error items are free. Apify paid plans get lower prices: 10% off on Bronze, 20% on Silver and 30% on Gold and above. Platform usage is included in the price.

Limitations

  • Only public data that YouTube shows to logged-out visitors is collected. Private, members-only and removed videos cannot be read.
  • Dislike counts are not public and are not returned.

Report problems in the Issues tab.