
What is Vyla API?
Vyla API is a Node.js streaming API hosted on Hugging Face Spaces. It fans out to multiple streaming providers simultaneously, verifies every stream live, and streams results back to your client in real time via Server-Sent Events (SSE) — so your player can start as soon as the first source is ready, without waiting for all providers to finish. Pass a TMDB ID. Get back a live stream of working sources, multi-language subtitles, and TMDB metadata — one event at a time.Multi-Provider Fanout
All configured providers are queried in parallel with per-source jitter, retries, and timeouts. Dead sources are silently dropped from the stream.
Real-Time SSE Streaming
Results are pushed as Server-Sent Events the moment each provider resolves. No waiting for the slowest provider — your UI can render the first source immediately.
Built-in HLS Proxy
Stream URLs are wrapped in a server-hosted proxy that rewrites M3U8 segment and key paths. CORS issues in the browser are gone by design.
Subtitles Included
VTT and SRT subtitle tracks in multiple languages are streamed as the first event (
meta) in every movie and TV response.Download Links
A dedicated endpoint returns direct download links for movies and TV episodes with quality labels and file sizes.
Health Monitoring
A dedicated health endpoint probes every provider in real time and reports per-source latency and status.
Try the Player
Test a live stream directly in your browser — no setup needed. Enter any TMDB ID and hit play.
Base URL
Access-Control-Allow-Origin: *. No authentication required.
How It Works
Meta event fires immediately
The server emits a
meta event with TMDB metadata and all available subtitle tracks — before any provider has finished.Parallel provider fanout
All active providers are queried simultaneously. Each source applies random jitter to stagger upstream requests, then retries on failure up to its configured limit.
Source events stream in
As each provider resolves and passes live verification, a
source event is emitted. Your player can begin immediately on the first one.Endpoint Overview
| Endpoint | Method | Description |
|---|---|---|
/movie?id=:id | GET | SSE stream of sources + meta for a movie |
/tv?id=:id&season=:s&episode=:e | GET | SSE stream of sources + meta for a TV episode |
/subtitles | GET | Subtitle tracks (standalone) |
/downloads | GET | Download links for movies or TV episodes |
/health | GET | Per-provider health check with latency |
/test | GET | Debug a single provider in isolation |
SSE Event Types
All/movie and /tv responses are Server-Sent Events. Each event is a JSON-encoded line prefixed with data: .
meta — First event
Emitted immediately, before any provider resolves. Contains TMDB metadata and all subtitle tracks for the title.
source — One per working provider
Emitted each time a provider passes live verification. Your player should start on the first one and fall back to subsequent ones on error.
done — Final event
Signals the stream is complete. The total field is the number of working sources that were emitted.
Data Models
Source Object
Returned insidesource events on movie and TV streams.
Internal provider key. Matches the keys shown in
/health.Human-readable provider name to display in your UI.
Fully-qualified, proxied, CORS-safe stream URL. For HLS sources, pass directly to
hls.loadSource() — all M3U8 segment and key URIs are pre-rewritten to flow through the proxy. For MP4 sources, set as video.src directly. No base URL prepending needed in either case.Subtitle Object
Returned inside thesubtitles array of the meta event, and as the top-level array on the /subtitles endpoint.
Language name of the subtitle track, e.g.
English, Spanish, Arabic.Direct URL to a WebVTT (
.vtt) or SRT subtitle file. Use as a <track> element src, or pass to any player’s subtitle API.Format of the subtitle file —
vtt or srt.Internal subtitle source identifier. Informational only.
Download Object
Returned insidedownloads[] on the /downloads endpoint.
Direct download URL.
Quality label, e.g.
1080p, 720p, 480p. "Unknown" if the provider doesn’t supply one.Human-readable file size, e.g.
2.14 GB. null if unavailable.Container format, e.g.
MP4, MKV. Uppercase.Caching
Stream results are cached in-memory with a 5-minute TTL. The per-source stream cache is keyed bysource_key + tmdb_id + season + episode; the aggregate source-results cache is keyed by tmdb_id + season + episode + base. Cache hits skip the provider fetch entirely and return near-instantly. The cache resets on server restart.
CORS & Headers
Every endpoint returns:OPTIONS requests return 204 No Content immediately.
