{"openapi":"3.1.0","info":{"title":"VTX Music Player API","version":"1.0.0"},"paths":{"/api/health":{"get":{"summary":"Health Check","operationId":"health_check_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/home":{"get":{"summary":"Get Home Songs","description":"Fetch songs for the home page.\n- If genre is 'My Type': blends algorithmic recommendations from last played song and top visitor artists.\n- If genre is provided: queries top songs for that genre.\n- Otherwise: returns trending songs.\nSupports infinite scroll pagination via offset and limit.","operationId":"get_home_songs_api_home_get","parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":1,"default":6,"title":"Limit"}},{"name":"lastVideoId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lastvideoid"}},{"name":"genre","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Genre"}},{"name":"artist","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Artist"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/track/{video_id}":{"get":{"summary":"Get Track Endpoint","description":"Retrieve exact track information by video ID.","operationId":"get_track_endpoint_api_track__video_id__get","parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search":{"get":{"summary":"Search Songs","description":"Search for songs on YouTube Music in real time.\nIf query is or contains a YouTube / YouTube Music URL (or 11-char video ID),\nthe exact video/song is fetched and placed directly on top of the list!","operationId":"search_songs_api_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":1,"default":12,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/related":{"get":{"summary":"Get Related Songs","description":"Fetch algorithmic related tracks for continuous auto-play with robust multi-tier fallback.","operationId":"get_related_songs_api_related_get","parameters":[{"name":"videoId","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Videoid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stream-info/{video_id}":{"get":{"summary":"Get Stream Info","description":"Get metadata and raw direct stream URL.","operationId":"get_stream_info_api_stream_info__video_id__get","parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stream/{video_id}":{"get":{"summary":"Stream Audio","description":"Stream audio directly to browser audio element with Range Request support (HTTP 206 Partial Content).\nEnables instant backward and forward scrubbing.","operationId":"stream_audio_api_stream__video_id__get","parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"head":{"summary":"Stream Audio","description":"Stream audio directly to browser audio element with Range Request support (HTTP 206 Partial Content).\nEnables instant backward and forward scrubbing.","operationId":"stream_audio_api_stream__video_id__get","parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/download/{video_id}":{"get":{"summary":"Download Song","description":"High-speed audio download endpoint (always genuine MP3 format).\n1. Checks if Cloudflare R2 already has the song cached -> Redirects directly to R2 CDN (instant 0.1s download)!\n2. If not in R2, downloads via multi-tier system (yt-dlp, cookies, autonomous fallback).\n3. Uploads the MP3 to Cloudflare R2 in background so all future downloads are instant and permanent.\n4. Serves the MP3 file directly with attachment headers.","operationId":"download_song_api_download__video_id__get","parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}},{"name":"title","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}},{"name":"artist","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Artist"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cookies-info":{"get":{"summary":"Get Cookies Info","description":"Returns status of YouTube cookies authentication.","operationId":"get_cookies_info_api_cookies_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/r2-status":{"get":{"summary":"Get R2 Status","description":"Verify if Cloudflare R2 is configured and reachable.","operationId":"get_r2_status_api_r2_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/lyrics/{video_id}":{"get":{"summary":"Get Song Lyrics","description":"Retrieve synchronized live lyrics (with millisecond timestamps) or plain lyrics.\nTries LRCLIB first for word/line timestamps, falling back to YouTube Music lyrics.","operationId":"get_song_lyrics_api_lyrics__video_id__get","parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}},{"name":"title","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}},{"name":"artist","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Artist"}},{"name":"duration","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/{full_path}":{"get":{"summary":"Serve Spa Frontend","operationId":"serve_spa_frontend__full_path__get","parameters":[{"name":"full_path","in":"path","required":true,"schema":{"type":"string","title":"Full Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}