{"openapi":"3.1.0","info":{"title":"Subz API","version":"1.0.0","description":"Discover movies and TV series, including upcoming releases, and download community subtitles anonymously. Upload with an API key from a free Subz account."},"servers":[{"url":"https://subz.fun"}],"paths":{"/api/v1/movies":{"get":{"operationId":"searchMovies","summary":"Search or browse movies and TV series","parameters":[{"name":"q","in":"query","description":"Title, alternate title, or IMDb title ID.","schema":{"type":"string","maxLength":120}},{"name":"kind","in":"query","description":"Limit results to movies or TV series.","schema":{"type":"string","enum":["movie","tv"]}},{"name":"year","in":"query","description":"Release year.","schema":{"type":"integer"}},{"name":"language","in":"query","description":"Only titles with subtitle files in this language.","schema":{"type":"string","enum":["en","cs","sk","de","fr","es","it","pt","pl","uk","ru","nl","sv","no","da","fi","hu","ro","sr","hr","bg","el","tr","ar","he","fa","hi","bn","te","ta","ml","zh","ja","ko","id","vi","th"]}},{"name":"upcoming","in":"query","description":"Show titles with a future release date, a future release year when the date is unknown, or an announced film project with no release date or year.","schema":{"type":"boolean"}},{"name":"sort","in":"query","description":"`activity` lists titles with the most recent subtitle upload first, then titles without subtitles by release year. `newest` orders by release year. Defaults to `activity`, or to the best title match when `q` is set. Ignored for upcoming titles.","schema":{"type":"string","enum":["activity","newest"]}},{"name":"page","in":"query","description":"Page number. Follow nextPage to continue.","schema":{"type":"integer","minimum":1,"default":1}}],"responses":{"200":{"description":"Up to 24 movie or TV series records.","content":{"application/json":{"schema":{"type":"object","required":["movies","nextPage"],"properties":{"movies":{"type":"array","items":{"$ref":"#/components/schemas/Movie"}},"nextPage":{"type":["integer","null"]}}}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/movies/{slug}":{"parameters":[{"name":"slug","in":"path","required":true,"description":"Movie or TV series slug returned by search.","schema":{"type":"string"}}],"get":{"operationId":"getMovie","summary":"Get a movie or TV series and its available subtitles","parameters":[{"name":"language","in":"query","description":"Limit subtitle files to one language.","schema":{"type":"string","enum":["en","cs","sk","de","fr","es","it","pt","pl","uk","ru","nl","sv","no","da","fi","hu","ro","sr","hr","bg","el","tr","ar","he","fa","hi","bn","te","ta","ml","zh","ja","ko","id","vi","th"]}},{"name":"page","in":"query","description":"Page number. Follow nextPage to continue.","schema":{"type":"integer","minimum":1,"default":1}}],"responses":{"200":{"description":"The title and up to 50 public subtitle files. The list can be empty.","content":{"application/json":{"schema":{"type":"object","required":["movie","subtitles","subtitleLanguages","nextPage"],"properties":{"movie":{"$ref":"#/components/schemas/Movie"},"subtitles":{"type":"array","items":{"$ref":"#/components/schemas/Subtitle"}},"subtitleLanguages":{"type":"array","items":{"type":"string","enum":["en","cs","sk","de","fr","es","it","pt","pl","uk","ru","nl","sv","no","da","fi","hu","ro","sr","hr","bg","el","tr","ar","he","fa","hi","bn","te","ta","ml","zh","ja","ko","id","vi","th"]},"description":"Every language with at least one file for this title."},"nextPage":{"type":["integer","null"]}}}}}},"400":{"description":"Unsupported language.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Title not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/movies/{slug}/subtitles":{"parameters":[{"name":"slug","in":"path","required":true,"description":"Movie or TV series slug returned by search.","schema":{"type":"string"}}],"post":{"operationId":"uploadSubtitle","summary":"Upload a subtitle file to an existing movie or TV series","description":"API keys allow 50 upload requests per UTC day by default. Known subtitle-site links are replaced with subz.fun before checking for identical files.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","language"],"properties":{"file":{"type":"string","format":"binary","description":"SRT, VTT, ASS, or SSA file, maximum 2097152 bytes."},"language":{"type":"string","enum":["en","cs","sk","de","fr","es","it","pt","pl","uk","ru","nl","sv","no","da","fi","hu","ro","sr","hr","bg","el","tr","ar","he","fa","hi","bn","te","ta","ml","zh","ja","ko","id","vi","th"]},"release":{"type":"string","maxLength":160},"hearingImpaired":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"An identical file already exists for this title and language.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"201":{"description":"Subtitle uploaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"400":{"description":"Malformed multipart form.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"API key missing, invalid, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Title not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported request media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unsupported or invalid subtitle file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"The API key reached its daily upload request limit. Retry-After gives the seconds until midnight UTC.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Subtitle storage is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/movies/{slug}/seasons/{season}/download":{"parameters":[{"name":"slug","in":"path","required":true,"description":"Movie or TV series slug returned by search.","schema":{"type":"string"}},{"name":"season","in":"path","required":true,"schema":{"type":"integer","minimum":0,"maximum":999}}],"get":{"operationId":"downloadSeasonSubtitles","summary":"Download all available subtitle files for a TV season as a ZIP","responses":{"200":{"description":"ZIP archive of available subtitles","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"No subtitles are available for this season.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The season exceeds the size of a single archive.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/subtitles/{id}/download":{"parameters":[{"name":"id","in":"path","required":true,"description":"Subtitle UUID returned in the title’s subtitle list.","schema":{"type":"string"}}],"get":{"operationId":"downloadSubtitle","summary":"Download the stored subtitle file","responses":{"200":{"description":"Stored subtitle bytes","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"304":{"description":"The ETag matches the client copy."},"404":{"description":"Subtitle not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"Movie":{"type":"object","required":["id","slug","kind","title","url","subtitleCount"],"properties":{"id":{"type":"integer"},"sourceId":{"type":"string"},"slug":{"type":"string"},"kind":{"type":"string","enum":["movie","tv"]},"title":{"type":"string"},"titleCs":{"type":["string","null"]},"originalTitle":{"type":["string","null"]},"imdbId":{"type":["string","null"]},"tmdbId":{"type":["integer","null"]},"year":{"type":["integer","null"]},"releaseDate":{"type":["string","null"],"format":"date"},"announced":{"type":"boolean","description":"Wikidata currently designates it a film project."},"director":{"type":["string","null"]},"seriesCredit":{"anyOf":[{"type":"object","required":["role","names"],"properties":{"role":{"type":"string","enum":["creator","writer"]},"names":{"type":"array","items":{"type":"string"},"minItems":1}}},{"type":"null"}],"description":"Series creators, or credited writers when no creator is known."},"summary":{"type":["string","null"]},"summaryCs":{"type":["string","null"]},"artwork":{"type":["string","null"]},"subtitleCount":{"type":"integer"},"updatedAt":{"type":"integer"},"url":{"type":"string","format":"uri"},"apiUrl":{"type":"string","format":"uri"},"poster":{"type":["object","null"],"required":["url","provider"],"properties":{"url":{"type":"string","format":"uri","description":"Poster thumbnail or a redirect to the image provider."},"provider":{"type":"string","enum":["commons","tmdb"]},"fileUrl":{"type":"string","format":"uri"},"author":{"type":["string","null"]},"license":{"type":"string"},"licenseUrl":{"type":["string","null"]}}}}},"Subtitle":{"type":"object","required":["id","language","format","filename","downloadCount","downloadUrl"],"properties":{"id":{"type":"string","format":"uuid"},"language":{"type":"string","enum":["en","cs","sk","de","fr","es","it","pt","pl","uk","ru","nl","sv","no","da","fi","hu","ro","sr","hr","bg","el","tr","ar","he","fa","hi","bn","te","ta","ml","zh","ja","ko","id","vi","th"]},"format":{"type":"string","enum":["srt","vtt","ass","ssa"]},"release":{"type":["string","null"]},"season":{"type":["integer","null"]},"episode":{"type":["integer","null"]},"hearingImpaired":{"type":"boolean"},"filename":{"type":"string"},"byteSize":{"type":"integer"},"createdAt":{"type":"integer"},"downloadCount":{"type":"integer","minimum":0,"description":"Tracked downloads of this subtitle, including completed season ZIP downloads."},"downloadUrl":{"type":"string","format":"uri"},"uploader":{"type":["object","null"],"required":["id","name"],"description":"Listed on title responses. The public profile is at /users/{id}. Null after the uploader deletes their account.","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}},"Upload":{"type":"object","properties":{"subtitle":{"$ref":"#/components/schemas/Subtitle"},"duplicate":{"type":"boolean"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}