YouTube Video Metadata & Direct Stream Extractor avatar

YouTube Video Metadata & Direct Stream Extractor

Pricing

from $2.00 / 1,000 extracted youtube video results

Go to Apify Store
YouTube Video Metadata & Direct Stream Extractor

YouTube Video Metadata & Direct Stream Extractor

extracts video titles, direct video links, thumbnails, uploader names, durations, and view counts from YouTube URLs. Supports bulk URL processing, playlist filtering, fast extraction, and Apify Proxy fallback. Ideal for video research, content analysis, and automated data collection.

Pricing

from $2.00 / 1,000 extracted youtube video results

Rating

0.0

(0)

Developer

Data Pilot

Data Pilot

Maintained by Community

Actor stats

0

Bookmarked

27

Total users

0

Monthly active users

3 days ago

Last modified

Categories

Features

Limited permissions

Share

🎬 YouTube Video Metadata & Direct Stream Extractor is an Apify Actor designed to read public YouTube video links and return their details together with a direct media stream link. This YouTube Video Metadata extractor provides the video title, ID, uploader, duration, view count, thumbnail, and a direct stream URL for each video you submit. Whether you're building a media catalog, checking video details in bulk, or feeding links into a media workflow you are authorized to use, the YouTube Video Metadata & Direct Stream Extractor delivers structured results efficiently.

With flexible link input, automatic cleanup of playlist parameters, three fallback extraction profiles, parallel processing, optional proxy fallback, and reliable Apify Dataset delivery, this YouTube Video Metadata actor returns one record for every link, including a clear failure record when a video cannot be read. It uses the open-source ` library and never downloads or stores the video itself.

ℹ️ About direct stream links: The direct_link value is a temporary link to a stream hosted on YouTube's servers. It usually expires after some hours, and it may only work from the IP address that requested it. Use it only for content you own, have permission to use, or are licensed to use. See Important Notes.


📋 Table of Contents


🔥 Features

  • Video Metadata – Title, video ID, uploader, duration, view count, and thumbnail. This is the core of the YouTube Video Metadata extractor.
  • Direct Stream Link – A temporary link to a media stream, with a preference for a stream that has both video and audio.
  • Multiple Videos per Run – Process a list of links, 5 at a time.
  • Link Cleanup – Converts watch, youtu.be, Shorts, embed, and live links into a clean single-video link and removes playlist and mix parameters.
  • Three Extraction Profiles – If one YouTube client profile fails, the Actor tries two others before giving up.
  • Direct-First Proxy Fallback – Tries a direct connection first, then retries through Apify Proxy if you configured one.
  • Failure Records – A failed link produces a record with status: "failed" and the error message.
  • Duplicate Removal – Identical links in your input are processed once.
  • No Downloads – The Actor never downloads or stores the video or audio files.
  • Status Summary – Sets a final run status message such as "Successfully extracted 5/6 video link(s)".
  • Detailed Logging – Logs progress for every YouTube Video Metadata run.

📊 Data Source

YouTube (via )

  • Source: Public YouTube video pages
  • Access Method: The open-source library in metadata-only mode (skip_download`), without logging in
  • Coverage: Public YouTube videos that `` can read from your run's IP address
  • Data: Video details and stream information exposed by YouTube
  • Access: No login or API key used
  • Update Frequency: Reflects YouTube at time of run

This Actor is not affiliated with or endorsed by YouTube or Google.


⚙️ How It Works

For each video link, the Actor cleans the link, asks ` for the video's details, and picks a stream link from the available formats. If the first attempt fails, it tries other YouTube client profiles and, if configured, a proxy. Each link produces one record, saved to the Apify Dataset right away.

Key Processing Steps:

  1. Input Parsing – Read the list of links (or use the built-in test video if none are given)
  2. Deduplication – Remove repeated links
  3. Link Cleanup – Turn video links into https://www.youtube.com/watch?v=<id>
  4. Extraction – Try three client profiles in turn (android/web, ios/mweb, tv_embedded/web)
  5. Stream Selection – Use the stream link YouTube returns, or the best format with both video and audio, or any format with a link
  6. Proxy Fallback – If the direct attempt fails and a proxy is configured, retry through the proxy
  7. Record Saving – Save a success record or a failure record for each link
  8. Status Message – Report how many links succeeded

📥 Input

FieldTypeDefaultDescription
urlsarray or stringbuilt-in test videoYouTube video links. Items can be text or objects with a url field. A string may be separated by commas or new lines. startUrls and url are also accepted as the field name.
proxyConfigurationobject(none: direct connection)Apify Proxy configuration, used as a fallback after a failed direct attempt.
useApifyProxybooleanfalseAlternative way to enable Apify Proxy when proxyConfiguration is not given.
apifyProxyGroupsarray["RESIDENTIAL"]Proxy groups used together with useApifyProxy.

If no link is provided, the Actor processes a built-in test video (https://www.youtube.com/watch?v=jNQXAC9IVRw).

Example Input:

{
"urls": [
"https://www.youtube.com/watch?v=jNQXAC9IVRw",
"https://youtu.be/dQw4w9WgXcQ"
]
}

With Proxy Fallback:

{
"urls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"]
}
}

📤 Output

Success record

FieldTypeDescription
urlstringThe cleaned video link
original_urlstringThe link exactly as you entered it
idstringYouTube video ID
titlestringVideo title, or "Untitled Video" if none is available
direct_linkstringTemporary direct stream link (can be empty)
thumbnailstringThumbnail image URL (can be empty)
uploaderstringUploader or channel name, or "Unknown" if not available
durationintegerDuration in seconds, or 0 if not available
view_countintegerView count, or 0 if not available
statusstring"success"
scraped_atstringISO 8601 UTC timestamp

Failure record

FieldTypeDescription
urlstringThe link as entered
statusstring"failed"
errorstringFirst line of the error message
scraped_atstringISO 8601 UTC timestamp

Example Success Record:

{
"url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
"original_url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
"id": "jNQXAC9IVRw",
"title": "Example video title",
"direct_link": "https://rr1---sn-example.googlevideo.com/videoplayback?...",
"thumbnail": "https://i.ytimg.com/vi/jNQXAC9IVRw/maxresdefault.jpg",
"uploader": "Example Channel",
"duration": 19,
"view_count": 300000000,
"status": "success",
"scraped_at": "2026-10-30T09:00:00Z"
}

🧰 Technical Stack

  • Extraction: in metadata-only mode with three client profiles and a 12-second socket timeout
  • Concurrency: asyncio with a limit of 5 links at a time, and blocking extraction run in worker threads
  • Proxy: Apify Proxy as an optional fallback after a direct attempt
  • Logging: Apify Actor logging system
  • Platform: Apify Actor serverless environment

📊 Data Fields Explained

  • url / original_url / id: Which video the record belongs to
  • title / uploader / thumbnail: Descriptive details
  • duration / view_count: Length and popularity as reported by YouTube
  • direct_link: A temporary stream link (see notes)
  • status / error: Whether extraction worked, and why not if it failed

🎯 Use Cases

  • Media Catalogs – Collect titles, durations, and thumbnails for a list of videos
  • Bulk Video Checks – Check whether video links are still available and see their basic details
  • Authorized Media Workflows – Pass stream links to your own tools for content you own or are licensed to use
  • Link Enrichment – Turn a list of video links into structured data

🚀 Quick Start

1. Prepare Input

Go to Apify Console and enter:

{
"urls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"]
}

2. Run the Actor

Click Start. The Actor will:

  • Clean each link
  • Extract the video details and a stream link
  • Save one record per link, including failures

3. Monitor Progress

Console shows:

🌐 Running with direct connection.
🎬 Processing 1 video URL(s)...
🔎 Extracting stream: https://www.youtube.com/watch?v=jNQXAC9IVRw
✅ Video #1 saved: Example video title
🎉 Complete! Successfully extracted 1/1 video link(s).

4. View & Download Results

  • Results Tab: One record per link
  • Export: JSON, CSV, Excel, or HTML
  • API Access: Available via the Apify API

⚙️ Configuration

Several videos:

{
"urls": "https://youtu.be/dQw4w9WgXcQ, https://www.youtube.com/shorts/abc123XYZ_-"
}

Using the legacy proxy fields:

{
"urls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"]
}

📈 Performance

Processing Speed

  • Up to 5 links are processed at the same time
  • Each attempt times out after about 12 seconds, and a link can take up to three profile attempts, plus a proxy retry if configured
  • Cleaned single-video links are much faster than playlist links

Resource Usage

  • Memory: Low, since no browser is launched and nothing is downloaded
  • Network: Lightweight metadata requests
  • Proxy: Optional Apify Proxy, used only after a failed direct attempt

⚠️ Important Notes

  • Temporary: direct_link is a signed link that usually expires after some hours. Do not store it as a permanent address.
  • May Be IP-Bound: The link may only work from the IP address that requested it. If you used a proxy, it may not work from your own machine.
  • Which Stream You Get: The Actor prefers a stream with both video and audio. If none exists, it falls back to any stream with a link, which can be video-only or audio-only. It can also be empty if no stream link was returned.
  • No Downloading: The Actor only returns links. It does not download, store, or convert any media.
  • YouTube Terms: YouTube's Terms of Service restrict downloading and accessing content except through features YouTube provides, and restrict automated access. Review them before use.
  • Copyright: Videos are protected by copyright. Use stream links only for content you own, have permission to use, or that is licensed to allow it. Do not use them to copy or redistribute others' content without permission.
  • Affiliation: Not affiliated with or endorsed by YouTube or Google
  • Legal: Not legal advice

Data Quality

  • Default Values: If YouTube does not return a field, the Actor fills in "Untitled Video", "Unknown", or 0 (for duration and view count). A value of 0 can mean "not available", for example for live streams.
  • Playlist and Channel Links: Only single-video links are cleaned and supported. A playlist link is limited to its first item, and other link types may fail.
  • Failures: Private, age-restricted, region-blocked, and removed videos usually fail, as do links blocked by YouTube. YouTube may also rate-limit or block data-center IPs, and proxy fallback is only used if you configured one.
  • Library Changes: ` depends on YouTube's internals, which change often. Results can vary between runs and versions.
  • Freshness: View counts and details reflect YouTube at the time of the run.

Best Practices

  • Use clean single-video links
  • Configure a residential proxy fallback for larger batches
  • Fetch and use direct_link quickly, since it expires
  • Check status and error before using a record

Terms of Use:

  • Use only for content you own or are authorized to use
  • Respect YouTube's Terms of Service and creators' rights
  • Do not use for unlawful copying or redistribution of copyrighted content
  • Use data responsibly and in compliance with applicable laws

Disclaimer: YouTube Video Metadata & Direct Stream Extractor is provided as-is for lawful, authorized purposes. It is not affiliated with or endorsed by YouTube or Google. Users are responsible for compliance with all applicable laws, copyright rules, and the terms of the data source. This is not legal advice.