YouTube channels and playlists
Channels and playlists from YTAPI: profiles, uploads and playlist contents.
Setup
If YTAPI_API_KEY is not set, read references/auth-setup.md
and follow it: the user either pastes a key or you create a free account
with their email (200 credits, no card). Send the key as
Authorization: Bearer $YTAPI_API_KEY and never print it.
Channels (1 credit each)
CHANNEL is an @handle or a UC... ID.
# Profile: title, handle, description, subscriber and video counts
curl -s "https://api.ytapi.dev/v1/channels/CHANNEL" -H "Authorization: Bearer $YTAPI_API_KEY"
# Latest uploads
curl -s "https://api.ytapi.dev/v1/channels/CHANNEL/latest" -H "Authorization: Bearer $YTAPI_API_KEY"
# All uploads, paged; sort_by: newest (default), popular, oldest
curl -s "https://api.ytapi.dev/v1/channels/CHANNEL/videos?sort_by=popular" -H "Authorization: Bearer $YTAPI_API_KEY"
# The channel's playlists
curl -s "https://api.ytapi.dev/v1/channels/CHANNEL/playlists" -H "Authorization: Bearer $YTAPI_API_KEY"
Playlists (1 credit per page)
curl -s "https://api.ytapi.dev/v1/playlists/PLAYLIST_ID" -H "Authorization: Bearer $YTAPI_API_KEY"
Paging
Paged responses carry has_more and next_cursor. Pass
cursor=NEXT_CURSOR to get the next page. Stop when you have enough: every
page costs a credit.
Transcripts of the videos (1 credit each)
curl -s "https://api.ytapi.dev/v1/transcripts?video_id=VIDEO_ID&format=text" \
-H "Authorization: Bearer $YTAPI_API_KEY"
For more than a handful of videos, use one batch (up to 100 tasks, 1 credit
per successful task): POST /v1/batch, then poll GET /v1/batch/{id}.
See https://docs.ytapi.dev/batch/run.
Credits and errors
Only successful responses use credits; errors are free. New accounts get 200
free credits. Until a credit pack is bought, a key can make 1 request per
second and 100 per day (UTC); 429 daily_limit_exceeded means that day's
limit is used up (it resets at 00:00 UTC; any pack removes it).
402 insufficient_credits means the balance is empty: packs from $9 at
https://ytapi.dev/?utm_source=skill#pricing. 401 means the key is missing or wrong.
For video details, search, channels, playlists and batches in one skill,
install ytapi. Full reference: https://docs.ytapi.dev
