``` ╔══════════════════════════════════════════════════════════════════════════════╗ ║ AniKotoAPI — Streaming Guide ║ ║ Base URL: https://anikototvapi.vercel.app/api ║ ║ Free REST API scraping anime data from anikototv.to ║ ╚══════════════════════════════════════════════════════════════════════════════╝ ``` # Streaming Guide This document covers the complete streaming workflow for AniKotoAPI — from searching for an anime to playing the actual video stream. --- ## ⚠️ Streaming Status > **Streaming endpoints (`/api/servers`, `/api/stream`, `/api/stream/resolve`) return errors when anikototv.to blocks AJAX requests from server-side IPs.** | What Works | What's Blocked | |:---|:---| | Home, spotlight, trending | `/api/servers` — server list | | Search, suggestions, filter | `/api/stream` — embed URLs | | Info, episodes, schedule | `/api/stream/resolve` — m3u8/mp4 | | Top 10, most popular, new release | `/api/mapper-servers` — gogoanime servers | | AZ list, random, genre list | All AJAX-dependent endpoints | | All HTML-scraped endpoints | | **To fix streaming**, set one of these environment variables: ```bash # Option 1: ScraperAPI (requires premium plan — $49/month) SCRAPER_API_KEY=your_scraperapi_key # Option 2: FlareSolverr (self-hosted, unlimited) FLARESOLVERR_URL=http://your-flaresolverr-host:8191 ``` --- ## Table of Contents 1. [Architecture Overview](#architecture-overview) 2. [Streaming Workflow](#streaming-workflow) 3. [Endpoint Reference](#endpoint-reference) 4. [M3U8 Proxy](#m3u8-proxy) 5. [Video Player Integration](#video-player-integration) 6. [Error Handling](#error-handling) 7. [Performance Tips](#performance-tips) --- // ═══════════════════════════════════════════════════════════════════════════════ // === ARCHITECTURE OVERVIEW === // ═══════════════════════════════════════════════════════════════════════════════ ## Architecture Overview ``` ┌─────────────────────────────────────────────────────────────────────────────┐ │ CLIENT / BROWSER │ │ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────────┐ │ │ │ Search / │───>│ Episode │───>│ Servers │───>│ Stream + Resolve │ │ │ │ Browse │ │ List │ │ List │ │ (get m3u8/mp4 URL) │ │ │ └──────────┘ └──────────┘ └──────────┘ └──────────┬───────────┘ │ │ │ │ │ ▼ │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ VIDEO PLAYER │ │ │ │ (HLS.js / Plyr / Video.js / native