Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/vsmutok/ytscrape/llms.txt

Use this file to discover all available pages before exploring further.

ytscrape is a free, open-source Python library that talks directly to YouTube’s internal InnerTube API. Search for videos, channels, and playlists, fetch detailed metadata, collect every comment and reply, and retrieve transcripts — all without registering for a YouTube Data API key or worrying about quota limits.

Quickstart

Make your first YouTube search in under five minutes with a working code example.

Installation

Install ytscrape from PyPI or from source. Requires Python 3.10+.

Guides

Explore in-depth guides for searching, comments, transcripts, pagination, and more.

API Reference

Full reference for the YouTube facade, all data models, filters, and exceptions.

Why ytscrape?

No API Key

Uses YouTube’s internal InnerTube endpoints — nothing to register, no billing project, no quota.

No Browser

Pure HTTP with requests. No Selenium, no Playwright, no headless Chrome.

Typed Models

Frozen dataclasses with full type hints. Ships py.typed for mypy and pyright.

Full Comments

Collect every comment and reply with transparent pagination and sort order control.

Transcripts

List and fetch caption tracks in any language, with auto-generated fallback.

CLI Included

ytscrape search, video, channel, comments, and transcript commands built in.

Get started in seconds

from ytscrape import YouTube, SearchFilter, CommentSort

with YouTube(language="en", region="US") as yt:
    # Search for videos
    for video in yt.search("python tutorial", filter=SearchFilter.VIDEOS, max_results=5):
        print(video.title, "-", video.url)

    # Fetch detailed video metadata
    details = yt.video("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
    print(details.title, details.views, details.length_seconds)

    # Collect every comment (newest order returns all)
    for comment in yt.comments("dQw4w9WgXcQ", sort=CommentSort.NEWEST, max_results=50):
        print(comment.author, "-", comment.text)
1

Install the library

pip install ytscrape
2

Import and create a client

from ytscrape import YouTube
yt = YouTube()
3

Search and iterate results

with YouTube() as yt:
    for video in yt.search("python", max_results=10):
        print(video.title, video.url)
4

Explore the guides

Head to the Guides for searching, comments, transcripts, pagination, and advanced configuration.
ytscrape accesses YouTube’s private InnerTube endpoints. Use it responsibly and at your own risk — endpoint parameters may change over time.

Build docs developers (and LLMs) love