Endpoints

GET/api/v1/home

Get trending, featured, movies, and TV shows for homepage. Include x-api-key header.

GET/api/v1/info/:type/:slug

Get detailed info for a movie or TV show. Returns title, poster, backdrop, trailer, cast, genres, related content.

GET/api/v1/search/:query

Search for movies and TV shows by title or keyword. Returns matching results.

GET/api/v1/home/list/:type

Paginated movie or TV list. Query: ?page=1. Type: movie or tv.

GET/api/v1/home/genre/:genreId

Filter content by genre. IDs: action, comedy, drama, romance, thriller, sci-fi, horror, animation, documentary, crime, fantasy.

Code Examples

Get Homepage Content

Fetch trending movies, TV shows, and featured content

1constBASE="https://api.scenespotter.app/";
2constAPI_KEY="ss_your_api_key_here";
3constheaders={"x-api-key":API_KEY};
4
5constresponse=awaitfetch(`${BASE}/api/v1/home`,{headers});
6constdata=awaitresponse.json();
7
8console.log(data.featured);// Featured movie/show
9console.log(data.trending);// Array of trending items
10console.log(data.movies);// Popular movies
11console.log(data.tvShows);// Popular TV shows

Search Movies

Search for movies and TV shows by keyword

1constquery="inception";
2constresults=awaitfetch(
3`${BASE}/api/v1/search/${encodeURIComponent(query)}`,
4{headers:{"x-api-key":API_KEY}}
5).then(r=>r.json());
6
7results.forEach(item=>{
8console.log(`${item.title} (${item.year}) — ${item.type}`);
9});

Get Movie Details

Fetch full details including trailer, cast, and related content

1constslug="inception-27205";// title-id format
2constmovie=awaitfetch(
3`${BASE}/api/v1/info/movie/${slug}`,
4{headers:{"x-api-key":API_KEY}}
5).then(r=>r.json());
6
7console.log(movie.title);// "Inception"
8console.log(movie.trailer);// YouTube video ID
9console.log(movie.cast);// ["Leonardo DiCaprio", ...]
10console.log(movie.genres);// ["Action", "Sci-Fi", ...]
11console.log(movie.related);// Similar movies

Stream a Movie (Authenticated)

Start a stream session and poll for progress (requires Basic plan or higher)

1constAPI_KEY="ss_your_api_key_here";
2constheaders={
3"Content-Type":"application/json",
4"x-api-key":API_KEY
5};
6
7// 1. Start the stream
8conststream=awaitfetch(`${BASE}/api/v1/stream/start`,{
9method:"POST",
10headers,
11body:JSON.stringify({
12title:"Inception",
13year:"2010",
14type:"movie"
15})
16}).then(r=>r.json());
17
18if(stream.status==="cached"){
19// Ready immediately — stream from CDN
20constvideoUrl=`${BASE}/api/v1/stream?title=Inception&year=2010`;
21console.log("Stream ready:",videoUrl);
22}else{
23// Poll for progress
24constpoll=setInterval(async()=>{
25constprogress=awaitfetch(
26`${BASE}/api/v1/stream/progress/${stream.streamId}`,
27{headers}
28).then(r=>r.json());
29
30console.log(`Progress: ${Math.round(progress.progress * 100)}%`);
31console.log(`Speed: ${(progress.downloadSpeed / 1024 / 1024).toFixed(1)} MB/s`);
32
33if(progress.ready){
34clearInterval(poll);
35console.log("Stream is ready to play!");
36}
37},1500);
38}

Browse by Genre

Filter movies by genre category

1// Available genres: action, comedy, drama, romance,
2// thriller, sci-fi, horror, animation, documentary,
3// crime, fantasy
4
5constgenre="sci-fi";
6constmovies=awaitfetch(
7`${BASE}/api/v1/home/genre/${genre}`,
8{headers:{"x-api-key":API_KEY}}
9).then(r=>r.json());
10
11movies.forEach(m=>{
12console.log(`${m.title} — ${m.rating}/10`);
13});

Paginated Movie List

Fetch movies page by page

1// Get page 2 of popular movies
2constpage=2;
3constmovies=awaitfetch(
4`${BASE}/api/v1/home/list/movie?page=${page}`,
5{headers:{"x-api-key":API_KEY}}
6).then(r=>r.json());
7
8console.log(`Got ${movies.length} movies on page ${page}`);

Authentication

Include your Firebase ID token in the Authorization: Bearer <token> header for authenticated requests (streaming, payments).