Skip to content

API Reference

MediaTree's API primarily serves the Web frontend and external playback links. Except for health checks, login, and first-run setup endpoints, /api/* requires application authentication.

Authentication

MethodPathDescription
POST/api/auth/loginSign in and receive a session token.
POST/api/auth/setupCreate the first admin account.
GET/api/auth/statusRead auth and setup status.
POST/api/auth/change-passwordChange the admin password.
POST/api/media-tokenGet a short-lived media access token.

Libraries and Scanning

MethodPathDescription
GET/api/healthHealth check.
GET/api/scanStart a scan.
GET/api/scan/statusRead scan status.
GET/api/scan/logRead scan logs.
GET/api/media-rootsList media roots.
GET/api/library-settingsRead library settings.
POST/api/library-settingsSave library settings.
POST/api/library/clearClear library data.

Browsing and Details

MethodPathDescription
GET/api/foldersGet folder tree and folder-level metadata.
GET/api/moviesList movies.
GET/api/searchSearch movies.
GET/api/favoritesList favorites.
GET/api/detail/{movie_id}Get movie details.
GET/api/recent-watchedGet continue-watching items.
GET/api/categoriesList categories.
POST/api/categoriesCreate a category.
PUT/api/categories/{cat_id}Update a category.
DELETE/api/categories/{cat_id}Delete a category.

Playback, Subtitles, and Media Files

MethodPathDescription
GET/api/stream/{movie_id}Stream video with Range and fallback transcoding.
GET/api/media-info/{movie_id}Read media information.
GET/api/external-play/{movie_id}.m3uGenerate an external player playlist.
GET/api/subtitle-tracks/{movie_id}List subtitle tracks.
GET/api/subtitle/{movie_id}/{track_index}Read Web subtitles.
GET/api/subtitle-file/{movie_id}/{track_index}/{filename}Read subtitle files.
GET/api/media/{file_path}Read a media file path.

Covers and Images

MethodPathDescription
GET/api/cover/{movie_id}Get movie cover.
GET/api/cached-cover/{cache_key}Get cached cover.
GET/api/episode-still/{movie_id}Get episode still.
GET/api/thumbnail/{movie_id}/{index}Get thumbnail.
POST/api/movies/{movie_id}/coverChange movie cover.
POST/api/folder/coverChange folder cover.
POST/api/folder/backdropChange folder backdrop.

Scraping and Metadata

MethodPathDescription
POST/api/movies/{movie_id}/rescrapeRescrape a movie.
POST/api/movies/{movie_id}/manual-scrapeApply manual movie scrape result.
POST/api/rescrape-folderRescrape a folder.
POST/api/search-scrapeSearch scrape candidates.
POST/api/apply-folder-scrapeApply folder scrape result.
POST/api/javdb/fetchFetch Javdatabase information by code.

Updates, Backup, and Settings

MethodPathDescription
GET/api/configRead runtime config.
POST/api/configSave runtime config.
GET/api/backupDownload backup.
POST/api/restoreRestore from backup.
POST/api/restore/uploadUpload and restore a backup.
GET/api/versionRead current version and runtime layer details.
GET/api/update/checkCheck available updates.
POST/api/update/performPerform update.
GET/api/update/statusRead update status.
POST/api/update/rollbackRoll back an app-package update.
GET/api/update/changelogFetch version changelog.

Guidance

Third-party clients should prefer stable browsing and playback capabilities, and should not depend on frontend-internal fields. Authentication, media tokens, restore, update, and file-path endpoints are high-risk surfaces; define clear permission boundaries before calling them.

Last updated: