``` ╔══════════════════════════════════════════════════════════════════════════════╗ ║ 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.** > > **✅ Alternative: `/api/stream/embeds` never touches AniKoto's AJAX layer** — see [Direct Embed Providers](#direct-embed-providers). | 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 | | | **`/api/stream/embeds` — direct provider iframes** | | **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 ``` Or use the Cloudflare-free embed providers below — no proxy needed. --- ## Direct Embed Providers `GET /api/stream/embeds` builds iframe-ready player URLs for three third-party providers. Playback happens inside the provider's own iframe, so nothing ever requests AniKoto's Cloudflare-protected AJAX endpoints at watch time. | Provider | URL pattern | Requires | |:---|:---|:---| | **MegaPlay** | `megaplay.buzz/stream/mal\|ani/{id}/{ep}/{lang}` | MAL or AniList ID | | **AniXo** | `anixo.buzz/embed/ani/{anilistId}/{ep}/{lang}` | AniList ID | | **Megavid** | `megavid.buzz/{mal\|ani}/{id}/{ep}/{lang}` | MAL or AniList ID | ```bash # From an AniKoto slug (MAL/AniList IDs resolved automatically, cached 60min) curl ".../api/stream/embeds?slug=one-piece-odmau&ep=1" # From direct IDs — zero scraping, instant response curl ".../api/stream/embeds?mal=21&ep=1&lang=dub&provider=megavid,megaplay" ``` ```json { "results": { "ids": { "animeId": 1642, "malId": "21", "anilistId": "21" }, "providers": [ { "id": "megaplay", "url": "https://megaplay.buzz/stream/mal/21/1/sub", "iframeReady": true }, { "id": "anixo", "url": "https://anixo.buzz/embed/ani/21/1/sub?color=%23e63946", "iframeReady": true }, { "id": "megavid", "url": "https://megavid.buzz/mal/21/1/sub?color=%23e63946&autoplay=true", "iframeReady": true } ] } } ``` Drop any `url` straight into an `