v1.0
api.straight2u.pro
REST API · JSON · Local Streaming

Stream anime.
Your server. Your rules.

AnimeAPI is a self-hosted Flask streaming backend with full episode browsing, dual-audio MKV support, embedded subtitle extraction, and a built-in video player — all exposed through a clean REST API.

MKV streaming
Dual audio tracks
Auto subtitle extraction
Embedded player
Full-text search
Byte-range seeking

Browse Library

02

Anime Detail

GET /api/anime/:slug Full anime info + episode list
JSON
Parameters
NameTypeRequiredDescription
slug string REQUIRED URL-safe anime identifier, e.g. the-eminence-in-shadow
Response
JSON · Object
{
  "id": 1,
  "title": "The Eminence In Shadow",
  "slug": "the-eminence-in-shadow",
  "cover_url": null,
  "episodes": [
    {
      "id": 1,
      "season": 1,
      "episode": 1,
      "title": null,
      "quality": "1080p"
    }
  ]
}
Try it
:slug
Response

                
03

Episode Detail

GET /api/episode/:slug/s:seasone:episode Audio, subtitle & video info
JSON
Parameters
NameTypeRequiredDescription
slug string REQUIRED Anime slug
season integer REQUIRED Season number
episode integer REQUIRED Episode number
Response
JSON · Object
{
  "season": 1,
  "episode": 1,
  "quality": "1080p",
  "anime": { "id": 1, "title": "…", "slug": "…" },
  "audio_tracks": [
    { "stream_index": 1, "lang": "jpn", "label": "Japanese 2.0 FLAC" },
    { "stream_index": 2, "lang": "eng", "label": "English 2.0 AAC" }
  ],
  "subtitle_tracks": [
    {
      "label": "Full Subtitles [Shadow Garden]",
      "lang": "eng",
      "sub_url": "/sub/1"
    }
  ]
}
Try it
:slug
:season
:episode
Response

                
04

Embed Player

GET /embed?anime=<slug>&s=<season>&ep=<episode> Full HTML video player
HTML
Description Returns the full standalone HTML video player with controls, subtitle overlay, dual-audio switching, PiP, and keyboard shortcuts. Suitable for embedding via <iframe> or direct navigation.
Parameters
NameTypeRequiredDescription
anime string REQUIRED Anime slug
s integer OPTIONAL Season number (default: 1)
ep integer OPTIONAL Episode number (default: 1)
Example
URL
https://api.straight2u.pro/embed?anime=the-eminence-in-shadow&s=1&ep=1
05

Video Stream

GET /video/:episode_id Byte-range video stream
STREAM
Description Streams the video file with RFC 7233 byte-range support for native browser seeking. MKV and AVI are remuxed to fragmented MP4 via FFmpeg on the fly. Use ?audio= to force an audio stream and ?t= to set a seek start for remuxed streams.
Parameters
NameTypeRequiredDescription
episode_id integer REQUIRED DB episode ID from episode detail
audio integer OPTIONAL Force specific audio stream index for remux
t float OPTIONAL Seek start in seconds (for remuxed/frag-MP4 streams)
06

Subtitles

GET /sub/:sub_id Serve subtitle VTT file
VTT
Description Serves a WebVTT subtitle file. IDs come from the sub_url field in episode detail. Subtitles are auto-extracted from embedded MKV tracks during database setup and converted to WebVTT.
Parameters
NameTypeRequiredDescription
sub_id integer REQUIRED Subtitle track DB ID from episode detail

Player Shortcuts

Key / ActionFunction
Space / KPlay / Pause
/ Seek ±10 seconds
/ Volume ±10%
MToggle mute
FToggle fullscreen
CToggle subtitles
Click videoPlay / Pause
Click progress barSeek to position
CC buttonChoose subtitle track
♪ buttonSwitch audio track (Chromium)