# YouTube — Data Extraction Field-tested against youtube.com on 2026-04-21. No authentication required for any approach documented here. --- ## Approach 1 (Fastest): oEmbed API — No Auth, No Browser `https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v={VIDEO_ID}&format=json` Returns JSON in ~0.3s. Works for any public video. Does **not** require login. ```python from helpers import http_get import json def youtube_oembed(video_id): """Fetch oEmbed metadata for a YouTube video. Returns title, author, thumbnail URL, and embed iframe HTML. """ url = f"https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v={video_id}&format=json" return json.loads(http_get(url)) data = youtube_oembed("dQw4w9WgXcQ") # { # "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)", # "author_name": "Rick Astley", # "author_url": "https://www.youtube.com/@RickAstleyYT", # "type": "video", # "thumbnail_url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg", # "thumbnail_width": 480, # "thumbnail_height": 360, # "width": 200, # "height": 113, # "version": "1.0", # "provider_name": "YouTube", # "html": '