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 pure-Python library published on PyPI under the MIT license. It has a minimal footprint — three small runtime dependencies — and works on every major operating system. This page covers everything you need to get it running in your environment.

Requirements

  • Python 3.10 or newer. ytscrape uses modern type annotations and structural pattern features that require Python 3.10+. It is tested against CPython 3.10, 3.11, 3.12, 3.13, and 3.14.
  • Runtime dependencies — installed automatically by pip or uv:
PackagePurpose
requests >=2.28All HTTP communication with YouTube’s InnerTube endpoints.
pycountry >=22.3.5Validates ISO 639-1 language codes and ISO 3166-1 country codes passed to language= and region=.
defusedxml >=0.7.1Safe XML parsing for transcript/caption track responses.
No browser, no driver, and no external binaries are required.

Install the Package

pip install ytscrape
The package name on PyPI is ytscrape — install it exactly as shown above. After installation a ytscrape console script is also registered, so you can run ytscrape search "python" --max 10 directly from your terminal.

Verify the Installation

Open a Python interpreter or create a small script and confirm the package imports correctly:
import ytscrape

print(ytscrape.__version__)  # e.g. 0.1.4
You can also run the built-in CLI to confirm end-to-end connectivity:
ytscrape search "python" --filter videos --max 3
If the command prints video titles and URLs, ytscrape is installed and communicating with YouTube successfully.

Optional: Development Dependencies

If you want to contribute to ytscrape or run its test suite locally, sync the full development environment using uv:
git clone https://github.com/vsmutok/ytscrape
cd ytscrape
uv sync --dev
The dev dependency group includes:
PackagePurpose
pytest >=9.1.1Test runner — execute with uv run pytest.
ruff >=0.14.5Linting and code formatting.
bandit >=1.9.4Static security analysis.
pre-commit >=4.3.0Git hook runner that executes ruff and bandit before every commit.
twine >=6.2.0Package upload tooling (maintainers only).
Run the full check suite with:
uv run pytest                            # run the test suite
uv run pre-commit run --all-files        # ruff + format + bandit

Next Steps

With ytscrape installed, follow the Quickstart to write your first search, metadata fetch, and comment collection in minutes.

Build docs developers (and LLMs) love