VidSrc API & Embed Documentation

Complete developer guide for the VidSrc embed API. Endpoints, query parameters, event listeners, and customization options. No API key required — start embedding in seconds.

VidSrc API documentation showing IDE with streaming endpoint code, JSON response snippets, and developer tools

VidSrc API Overview

The VidSrc API provides a simple, embeddable video player that streams movies and TV shows from 12+ providers. No API key, no authentication, no rate limits — just construct an iframe URL and embed it.

The API is completely free and designed for developers who want to add video streaming to their projects without building backend infrastructure. Full documentation is available on our homepage.

API Endpoints

VidSrc uses TMDB IDs for content identification. Two endpoint patterns are supported:

Movie Embed

/embed/movie/{tmdb_id}

TV Show Embed

/embed/tv/{tmdb_id}/{season}/{episode}

Example — Embed a Movie

<iframe src="/embed/movie/533535" width="100%" height="100%" frameborder="0" allowfullscreen allow="autoplay; encrypted-media"></iframe>

Query Parameters

Customize the player appearance and behavior with URL query parameters:

ParameterTypeDescription
themehexPrimary accent color (default: da3633)
autoPlaybooleanStart playback automatically
posterbooleanShow cinematic backdrop (default: true)
hideServerbooleanDisable server selection menu
hideControlsbooleanHide all player UI controls
startAtnumberStart playback at N seconds
substringPreferred subtitle language code

PostMessage Events API

The VidSrc player emits real-time playback events via the browser's postMessage API. Use these to build watch history, progress tracking, or synchronized viewing features.

window.addEventListener('message', (event) => { if (event.data.type === 'VIDRACK_PLAYER_EVENT') { const { event: name, currentTime, duration } = event.data.data; console.log('Player:', name, currentTime, duration); } });

Events emitted: play, pause, timeupdate, ended, error

VidSrc Streaming Source Architecture

For developers interested in streaming source code and how VidSrc works under the hood:

  • Provider aggregation — Queries 12+ upstream providers concurrently via SSE and REST APIs
  • Source ranking — Sorts providers by latency, quality, and reliability using a weighted scoring algorithm
  • HLS proxy — Rewrites m3u8 manifests to handle CORS and header injection transparently
  • Intelligent caching — PostgreSQL-backed cache with per-provider TTL and HEAD-check validation
  • Failover — Client-side fallback chain: tries sources sequentially, then refetches if all fail

The player frontend uses hls.js for adaptive bitrate streaming with native HLS fallback for Safari. The entire system is built with Next.js API routes and serverless functions.

Frequently Asked Questions

Ready to Stream?

Try the VidSrc player now — 4K streaming, multi-server failover, and subtitles built in.

Launch VidSrc Player