Use the YouTube CLI from KosmoKrator to call YouTube tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
YouTube can be configured headlessly with `kosmokrator integrations:configure youtube`.
# Install KosmoKrator first if it is not available on PATH.curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash# Configure and verify this integration.kosmokrator integrations:configure youtube --set api_key="$YOUTUBE_API_KEY" --enable --read allow --write ask --jsonkosmokrator integrations:doctor youtube --jsonkosmokrator integrations:status --json
Credentials
Authentication type: API keyapi_key. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
api_key
YOUTUBE_API_KEY
Secret secret
yes
API Key
Call YouTube Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to YouTube.
youtube.youtube_search_videos
Read read
Search for videos, channels, or playlists on YouTube using keywords, filters, and sorting options. Returns matching results with snippet metadata.
Get detailed information about one or more YouTube videos by ID, including title, description, thumbnails, duration, view count, likes, and channel info.
Get detailed information about a specific YouTube channel by ID, including snippet, statistics (subscribers, views, videos), content details, and branding settings.
Get detailed information about one or more YouTube videos by ID, including title, description, thumbnails, duration, view count, likes, and channel info.
Set to true to list the authenticated user's channel.
max_results
integer
no
Maximum results per page (1-50). Default: 5.
page_token
string
no
Token for the next page of results.
hl
string
no
Language code for localized text (e.g., "en", "es").
youtube.youtube_get_channel
Get detailed information about a specific YouTube channel by ID, including snippet, statistics (subscribers, views, videos), content details, and branding settings.
Headless calls still follow the integration read/write permission policy. Configure read/write defaults
with integrations:configure. Add --force only for trusted automation that should bypass that policy.