Back

API Documentation

ONIstream REST API. All endpoints accept and return JSON. Database is SQLite (better-sqlite3).

Endpoints

Profiles

GET/api/profiles

List all profiles

Response
Profile[]
POST/api/profiles

Create a new profile

Request Body
{ name: string, avatar?: string }
Response
Profile
PATCH/api/profiles

Update profile settings

Request Body
{ id: string, name?, avatar?, avatar_url?, theme?, language? }
Response
Profile
DELETE/api/profiles

Delete a profile

Request Body
{ id: string }
Response
{ ok: true }

Watchlist

GET/api/watchlist?profile_id={id}

Get watchlist for a profile

Response
WatchlistItem[]
POST/api/watchlist

Add item to watchlist

Request Body
{ profile_id, media_id, media_type, title, poster_path?, backdrop_path?, overview?, vote_average?, release_date? }
Response
{ ok: true }
DELETE/api/watchlist

Remove from watchlist

Request Body
{ profile_id, media_id, media_type }
Response
{ ok: true }

Continue Watching

GET/api/continue-watching?profile_id={id}

Get continue watching list for a profile

Response
ContinueWatchingItem[]
POST/api/continue-watching

Upsert watch progress

Request Body
{ profile_id, media_id, media_type, title, poster_path?, backdrop_path?, progress, duration, season?, episode?, episode_name?, server? }
Response
{ ok: true }
DELETE/api/continue-watching

Remove from continue watching

Request Body
{ profile_id, media_id, media_type }
Response
{ ok: true }

Data Schemas

Profile

-id: string (UUID)
-name: string
-avatar: string (color key: blue, red, green, purple, orange, pink)
-avatar_url: string | null
-theme: string (default, purple, pink, green, blue, nude, rose, amber)
-language: string (en, es, fr, de, ja, ko, pt, zh)
-created_at: string (ISO datetime)

WatchlistItem

-media_id: number (TMDB ID)
-media_type: "movie" | "tv"
-title: string
-poster_path: string | null
-backdrop_path: string | null
-overview: string
-vote_average: number
-release_date: string
-added_at: string (ISO datetime)

ContinueWatchingItem

-media_id: number (TMDB ID)
-media_type: "movie" | "tv"
-title: string
-poster_path: string | null
-backdrop_path: string | null
-progress: number (seconds watched)
-duration: number (total seconds)
-season: number | null (TV only)
-episode: number | null (TV only)
-episode_name: string | null
-server: string (vidsrc, embed, multiembed)
-last_watched: string (ISO datetime)

Pages

/Home - Hero banner + content rows
/moviesMovies - Browse with filters
/tvTV Shows - Browse with filters
/animeAnime - Dedicated anime page
/search?q={query}Search - Multi-search
/movie/{id}Movie detail
/tv/{id}TV show detail + episodes
/watch/movie/{id}Movie player
/watch/tv/{id}?s={season}&e={episode}TV player + episode sidebar
/watchlistPer-profile watchlist
/profilesProfile selector
/settingsProfile settings (theme, language, avatar)
/api-docsThis page