example.tsTypeScript / anime-sdk
1
TypeScript · MIT · Node 20+

Build your anime app.
We'll handle the streams.

A TypeScript library for resolving anime streams and manga pages across 9 providers. Use it as a Node module, run the built-in HTTP server, or download episodes and chapters to disk.

9 Providers
don't get locked into a single source, switch any time
30'000+
anime & manga titles, from classics to the latest releases
100% Free
self-hosted and open source, no subscriptions or accounts needed
HTTP API
Built-in HTTP server, for apps that don't use typescript

One SDK, every kind of app.

Anywhere you can run Node or Bun, use the SDK directly. Anywhere you can't, run the HTTP server and call it over HTTP.

Mobile apps

React Native, Expo, or any native client via the HTTP server.

React NativeExpoFlutterAndroidiOS / SwiftAndroidiOS
Websites

SSR frameworks, SPAs, or anything that runs server-side Node.

Next.jsSvelteKitRemixAstroNuxtVue
Desktop apps

Electron, Tauri, or any desktop runtime with a Node backend.

ElectronTauriWindowsmacOSLinuxTypeScript
CLI tools

Single-file scripts to full interactive TUIs and download managers.

TypeScriptNode.jsBunDeno
Servers & bots

APIs, Discord/Telegram bots, scheduled jobs, or media servers.

ExpressHonoFastifyNestJSTypeScript

Setup in minutes.

Every provider exposes searchfetchContentUnitsresolveStream . Swap the provider, the three calls don't change.

Install terminal
$ npm install anime-sdk
Provider · megaplay example.ts
import { HttpClient, MegaPlayProvider } from 'anime-sdk';

const provider = new MegaPlayProvider(
  new HttpClient({ timeoutMs: 10_000 })
);

const shows   = await provider.search('Frieren');
const units   = await provider.fetchContentUnits(shows[0].id);
const result  = await provider.resolveStream(units[0].id);

if (result.type === 'video') console.log(result.streams[0].sourceUrl);
if (result.type === 'manga') console.log(result.pages.imageUrls);

Want sub/dub? Pass 'sub' | 'dub' | 'raw' to resolveStream . Need a different source? Swap the provider; same three calls.

Skip the API boilerplate.

anime-sdk ships with a ready-to-run HTTP server. Routes for search, episodes, streams, and track metadata; an optional stream + subtitle proxy; bring-your-own cache with a two-method get/set interface; bearer-token auth. Point any client at it, ship.

Start it server.ts
import { startServer, AllmangaProvider, HttpClient } from 'anime-sdk';

const store = new Map();

startServer({
  providers: [new AllmangaProvider(new HttpClient())],
  port: 3000,
  proxy: true,
  cache: { get: (k) => store.get(k), set: (k, v) => store.set(k, v) },
});

// → http://localhost:3000
Call it from anywhere curl / fetch / axios
# search shows or manga
curl 'localhost:3000/search?q=Frieren&provider=mangadex'

# content: episodes or chapters
curl 'localhost:3000/content?mediaId=...&provider=mangadex'

# resolve: streams or image pages
curl 'localhost:3000/stream?unitId=...&provider=mangadex'

Any client that speaks HTTP: React Native, Swift, Kotlin, Flutter, Python, you name it.

Lock it down optional
startServer({
  providers: [new AllmangaProvider(new HttpClient())],
  port: 3000,
  auth: { token: process.env.API_TOKEN },
});

// Clients send:
// Authorization: Bearer <token>

Skip auth entirely if it's local. The SDK works standalone too. No server required.

Browser-ready streams.

Most stream CDNs require a Referer header browsers can't send freely. Set proxy: true and every URL in the response becomes a plain proxied URL your player can use directly. No header wrangling.

Enable it one option
startServer({
  providers: [new GogoanimeProvider(new HttpClient())],
  port: 3000,
  proxy: true,  // ← that's it
});

A /proxy endpoint becomes active and every sourceUrl in /stream responses is rewritten to go through it.

URLs rewritten automatically
// without proxy
{
  sourceUrl: "https://cdn.example.com/ep1.m3u8",
  headers: { Referer: "https://provider.com/watch/..." }
}

// with proxy
{
  sourceUrl: "http://localhost:3000/proxy?url=...&h=..."
}

Required headers are base64-encoded into the URL. Your frontend uses sourceUrl as-is. No header forwarding needed.

Drop into any player hls.js / video.js / <video>
// just pass sourceUrl straight to hls.js
const hls = new Hls();
hls.loadSource(sourceUrl);
hls.attachMedia(videoEl);

// no xhrSetup. no custom headers.
// segment + key URLs rewrite automatically.

HLS manifest rewriting is recursive: segment URLs, key URLs, and sub-playlist URLs all go through the proxy. The header chain propagates automatically.

Providers.

9 live-tested sources. Each one verified by a real ffmpeg frame capture on every run.

animeparadise
animeparadise.moe

Clean REST API at api.animeparadise.moe. Episodes carry a signed streamLink token; final stream served by stream.animeparadise.moe as a multi-quality HLS master, with external VTT subtitle tracks.

REST API HLS token-signed VTT subs sub
allmanga
allmanga.to

AllAnime GraphQL endpoint. Source URLs XOR-obfuscated then AES-CTR-decrypted; falls back through mp4upload and wixmp shares.

GraphQL API AES-CTR mp4upload subdub
gogoanime
anineko.to

Scrapes episode pages on anineko.to. Resolves vibeplayer embeds to a direct HLS manifest with proxy-aware chunk URI rewriting.

HTML scrape vibeplayer HLS sub
anikoto
anikototv.to

Combines anikototv.to search with anikotoapi.site metadata. Resolves megaplay.buzz embeds to HLS streams with multi-language subtitle tracks.

JSON API + Embed megaplay HLS VTT subs subdub
megaplay
megaplay.buzz

A universal resolver that uses AniList GraphQL for search and megaplay.buzz for direct mapping. Useful for shows not yet indexed by site-specific providers.

AniList GraphQL AniList universal megaplay subdub
goyabu
goyabu.io

Reads a Blogger token from player data, calls Google batchexecute, and decodes the response to a googlevideo.com stream URL.

batchexecute RPC Blogger googlevideo pt-br
mangadex
mangadex.org

Official JSON API at api.mangadex.org. High-quality manga metadata, cover art, and high-resolution page resolution for all chapters.

JSON API covers official sub
weebcentral
weebcentral.com

Scrapes weebcentral.com. Extracts high-quality chapter image pages with Referer protection and automatic proxy routing.

HTML scrape DOM Referer sub
mangapill
mangapill.com

Scrapes mangapill.com. Reliable extraction of chapter page lists and direct image sources for titles not found elsewhere.

HTML scrape DOM sub

Contribute.

Add a provider in ~100 lines. Extend BaseProvider, implement three methods and write a test.