Product Updates

New updates and improvements

v2.0.0

Transcript API

  • transcribeVideo(id, options?) — fetch captions for a single video without an API key
  • transcribePlaylist(id, options?) — batch fetch transcripts for every video in a playlist
  • listCaptionTracks(id) — discover available language tracks before downloading
  • Output formatters: toSRT(), toVTT(), toPlainText()
  • TranscriptClient — reusable client with shared config

Batch Transcript

  • Configurable concurrency (1–20 workers) for parallel transcript fetching
  • from / to range filtering to process a subset of the playlist
  • onProgress callback for real-time progress tracking
  • Partial failure handling — individual video failures are caught and recorded, not thrown
  • Returns per-video results with status: "success" | "failed"

Caching

  • InMemoryCache — process-only cache with TTL and size limits (~0.03ms hits)
  • FsCache — filesystem persistence with JSON storage (~0.3ms hits)
  • CacheStore interface for custom backends (Redis, etc.)
  • Automatic cache key generation per video ID, language, and metadata flag

Retry & Resilience

  • Exponential backoff retry for transient HTTP failures (429, 5xx)
  • retries and retryDelay options on all transcript requests
  • AbortSignal support to cancel in-flight retry loops

Comments API

  • comments(videoId, opts?) — fetch all comment threads with auto-pagination
  • topComments(videoId, limit?) — top comments sorted by relevance
  • commentReplies(commentId) — fetch all replies to a specific comment
  • commentsWithReplies(videoId) — threads + all replies in one call
  • searchComments(videoId, query) — keyword search within comments
  • commentStats(videoId, threads) — aggregate stats (unique authors, reply ratio, most liked)
  • commentQuery(videoId) — fluent builder for filtering and slicing comments

Internationalization (i18n)

  • regions(hl?) — list all supported YouTube regions (110+)
  • languages(hl?) — list all supported languages (80+)
  • videoCategoriesByRegion(regionCode, hl?) — fetch region-specific video categories
  • Localized names via hl parameter (e.g., ja for Japanese)

REST API

  • New endpoints: /api/comments/{videoId}, /api/comments/{videoId}/top, /api/comment-replies/{id}
  • New endpoint: /api/transcript/{id} — single video transcript (no API key)
  • New endpoint: /api/playlist/{id}/transcript — batch playlist transcript
  • Removed URL utility endpoints (moved to standalone lyra-sdk/url subpath)

Framework Examples

  • Added Hono, NestJS, and Next.js API server examples alongside Express
  • API Reference now shows framework-specific code samples (Express, Hono, Next.js)
v1.1.0

Playlist Query

  • Added POST /api/playlist/{id}/query endpoint for filtering, sorting, and slicing playlist videos
  • Filter by duration, views, and likes with min/max ranges
  • Sort by views, likes, or duration in ascending or descending order
  • Range parameter to paginate results (1-indexed start/end)
v1.0.0

Video API

  • getVideo(id) — fetch full video details by ID or URL
  • getVideos(ids) — batch fetch multiple videos
  • getVideoTitle(id) — lightweight title-only lookup (1 quota unit)

Channel API

  • getChannel(id) — fetch channel metadata by ID, @username, or URL
  • getChannelVideos(id, limit) — fetch recent uploads for a channel

Playlist API

  • getPlaylist(id) — fetch complete playlist with all videos and total duration
  • getPlaylistInfo(id) — playlist metadata only (1 quota unit)
  • getPlaylistIds(id) — fetch all video IDs with auto-pagination

URL Utilities

  • parseUrl(url) — parse a YouTube URL into a structured result
  • extractUrl(url, type?) — extract video, playlist, or channel IDs from a URL

Express REST API

  • Full REST API wrapper around all SDK functions
  • Interactive OpenAPI documentation at /docs/api-reference
  • Local development server via npm run dev:express

On this page