JSON OUTPUT
Use YTSearch CLI in automation pipelines.
The --json flag switches supported commands from formatted terminal output to raw JSON, making results easier to consume in scripts and tooling.
Search JSON
$
ytsearch video "javascript" --jsonPlaylist JSON
$
ytsearch playlist-videos PLxxxxxxxx --jsonWhy use it?
- Pipe machine-readable results into other programs.
- Avoid parsing human-oriented tables.
- Keep CLI workflows reproducible for scripts and automation.
The package contract defines JSON as JSON.stringify(results, null, 2) for search and the corresponding playlist page object for playlist-videos.