For AI agents: a documentation index is available at /llms.txt
Skip to main content

Scrape YouTube video data

Extract title, channel, view count, likes, and upload date from a YouTube video URL.

Prerequisites

Steps

YouTube renders all video metadata via JavaScript after the initial page load. A plain HTTP fetch returns almost no data. The examples below wait for the page to settle before reading, and route through stealth mode because YouTube actively detects plain browser automation.

Selector stability

YouTube's DOM selectors change periodically. If any field returns null or an empty string, inspect the live page with browser DevTools to find the updated selector.

Use the Browserless MCP server to scrape video data from YouTube from any MCP-compatible AI agent (Claude Desktop, Cursor, Windsurf, ChatGPT, etc.).

1. Connect the MCP server

Send this prompt to your AI agent to install the Browserless MCP server:

Go to https://github.com/browserless/browserless-mcp/blob/main/install.md
and follow the instructions to install the Browserless MCP server
for my client.

2. Scrape YouTube

Use browserless_smartscraper. YouTube has bot detection and smartscraper handles it automatically.

Use the browserless_smartscraper tool to scrape video information
from https://www.youtube.com/watch?v=dQw4w9WgXcQ
and return the results as markdown

Next steps