Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Typing SVG


An unofficial, self-hostable REST API for allmanga.to — search anime, browse episodes, and get direct 1080p MP4 stream URLs with zero cookies needed.


Why does this exist?

AnimeKai is shutting down. And honestly, it won't be the last.

Every time a popular anime site dies, every app, bot, and project built on top of it dies too. Kai going down hit a lot of people. So instead of waiting for the next thing to get taken down, I built something you can run yourself — backed by a source that has been stable for years.

This scrapes allmanga.to (AllAnime), which has a clean internal GraphQL API under the hood. It is not scraping HTML that breaks every redesign. It is talking directly to their data layer. Much more reliable.

Run it yourself. Host it yourself. No rate limits from me, no middleman, no praying someone else's server stays up.


What it does

  • Search anime by title with sorting, type and translation filters
  • Homepage feed — latest updates + trending, just like the site
  • Full anime info — description, genres, studios, scores, seasons, episode counts
  • Direct 1080p MP4 stream URLs — no cookies, no captcha, no embeds needed
  • All embed servers decoded — GogoAnime, StreamSB, Doodstream, Streamtape, Mp4Upload, Filemoon, MyCloud and more
  • AES-256-CBC decryption for GogoAnime/VidStreaming
  • CORS enabled — plug it straight into any frontend
  • Beautiful built-in docs page at / plus full Swagger UI at /docs

Quick Start

Requirements: Python 3.10+

git clone https://github.com/walterwhite-69/AllManga.to-API
cd AllManga.to-API

python -m venv .venv
source .venv/bin/activate

pip install fastapi "uvicorn[standard]" "httpx[http2]" beautifulsoup4 lxml pycryptodome

uvicorn main:app --host 0.0.0.0 --port 8000 --reload

Open http://localhost:8000 and you will see the docs page with live Try it buttons.


API Endpoints

GET /anime/home

Homepage feed — recent and trending anime in one call.

Param Default Options
translationType sub sub dub raw
countryOrigin JP JP CN KR
page 1 any number
curl "http://localhost:8000/anime/home?translationType=sub&countryOrigin=JP"

GET /anime/search

Search by title. Supports sorting, type filter, translation type, country.

Param Required Notes
q yes Search query
sortBy Latest_Update Trending Name_ASC Name_DESC
type TV Movie OVA ONA Special
translationType sub dub raw
countryOrigin JP CN KR
limit Default 26, max 100
page Default 1
curl "http://localhost:8000/anime/search?q=one+piece&sortBy=Trending&limit=5"
Example response
{
  "results": [
    {
      "_id": "ReooPAxPMsHM4KPMY",
      "name": "1P",
      "englishName": "One Piece",
      "thumbnail": "https://cdn.myanimelist.net/images/anime/1810/139965.jpg",
      "score": 8.73,
      "type": "TV",
      "status": "Releasing",
      "genres": ["Action", "Adventure", "Comedy"],
      "availableEpisodes": { "sub": 1161, "dub": 1161, "raw": 0 },
      "season": { "quarter": "Fall", "year": 1999 }
    }
  ],
  "page": 1,
  "limit": 5,
  "hasNextPage": true
}

GET /anime/info/{show_id}

Full details for a show — description, genres, tags, studios, aired dates, episode counts.

curl "http://localhost:8000/anime/info/ReooPAxPMsHM4KPMY"

GET /anime/episodes/{show_id} — the main one

Episode list with direct CDN MP4 links. This is the one you actually want. Set includeStreams=true and you get playable 1080p URLs for sub and dub — no cookies, no captcha, no embed pages.

Param Default Notes
episodeStart 1 Starting episode number
episodeEnd 9999 Ending episode number
includeStreams false Set to true to get direct MP4 URLs
curl "http://localhost:8000/anime/episodes/ReooPAxPMsHM4KPMY?includeStreams=true&episodeStart=1&episodeEnd=3"
Example stream object
{
  "server": "allanime-cdn",
  "translationType": "sub",
  "url": "https://allanimenews.com/data2/media9/videos/.../sub/1_xxxx.mp4",
  "quality": "1080p",
  "sizeMB": 500.9,
  "durationSec": 1539.1,
  "type": "mp4",
  "headers": {
    "Referer": "https://allanimenews.com/",
    "Origin": "https://allanimenews.com"
  }
}

Pass the Referer header when playing. VLC, MPV, and most HTTP clients support this. You cannot paste the URL raw into a browser address bar — that is a browser security restriction, not an API limitation.


GET /anime/sources

All embed server URLs for an episode, decoded from AllAnime's XOR encoding. Set extractStreams=true to also pull actual video URLs from each embed page.

Most people will not need this. The CDN streams from /anime/episodes are cleaner — direct MP4, no ads, known file size. This endpoint is only useful as a fallback for anime not hosted on the AllAnime CDN. It also requires your browser cookies from allmanga.to to bypass their captcha check.

Param Required Notes
showId yes Show ID
episode yes Episode number e.g. "1"
translationType sub dub raw
extractStreams Also extract m3u8/mp4 from each embed
X-Cookie (header) yes Your allmanga.to browser cookies
How to get cookies
  1. Open allmanga.to in your browser and pass any Cloudflare challenge
  2. Open DevTools then Application then Cookies and copy all the values
  3. Paste them as the X-Cookie header value
curl -H "X-Cookie: <your cookies>" \
  "http://localhost:8000/anime/sources?showId=ReooPAxPMsHM4KPMY&episode=1&translationType=sub"

GET /anime/stream

Extract playable video URLs from any embed page URL. Pass an embed link, get back m3u8 or mp4 URLs.

Param Notes
url Full embed URL
server Optional hint: gogoanime streamsb doodstream streamtape mp4upload filemoon mycloud
curl "http://localhost:8000/anime/stream?url=https://dood.wf/e/XXXXX&server=doodstream"

The flow that actually works (no cookies)

1. Search
   GET /anime/search?q=attack+on+titan
   grab the "_id" from the result you want

2. Get episodes with streams
   GET /anime/episodes/{id}?includeStreams=true
   each episode has a "streams" array

3. Play
   take any "url" from the streams array
   pass Referer: https://allanimenews.com/
   done. 1080p MP4, sub or dub.

Supported Stream Servers

Server Method
AllAnime CDN Direct MP4 — no cookies needed
GogoAnime / VidStreaming AES-256-CBC decryption
StreamSB / SBPlay Multi-host API extraction
Doodstream / Dood pass_md5 token extraction
Streamtape JS innerHTML link parsing
Mp4Upload Source URL scan
Filemoon / MoonPlayer Packed JS + m3u8 scan
MyCloud / VizCloud HLS m3u8 extraction

Docker

FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install fastapi "uvicorn[standard]" "httpx[http2]" beautifulsoup4 lxml pycryptodome
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
docker build -t allanime-api .
docker run -p 8000:8000 allanime-api

Project structure

AllManga.to-API/
└── main.py        # Everything. One file. ~640 lines.

No routers. No separate scrapers folder. No 12 config files. Just main.py.


FAQ

Q: Why allmanga.to? AllAnime has a real internal GraphQL API that has been stable for years. Most sites scrape raw HTML which breaks every time they redesign. This is far more reliable.

Q: Will this break when sites get taken down? This does not depend on Kai or any site that went down. allmanga.to is an independent source. If they ever change their API I will update the code.

Q: The MP4 URL does not play in my browser You need to send Referer: https://allanimenews.com/ with the request. Browsers do not let you set Referer manually in the address bar — use VLC, MPV, or proxy it through your own backend.

Q: Getting CAPTCHA_REQUIRED on /anime/sources Use /anime/episodes?includeStreams=true instead. Direct CDN streams, zero cookies needed. /anime/sources is just a fallback for edge cases.

Q: Can I use this in my project? MIT licensed. Go for it.


Found a bug?

Open an issue and I will look at it.

github.com/walterwhite-69/AllManga.to-API/issues

Include which endpoint you hit, what you expected vs what happened, and the full error message.


Community

Come hang out. Share what you are building. Ask questions.

Discord


Disclaimer

For personal and educational use only. Does not host, store, or redistribute any video content. All streams are sourced directly from third-party servers. Use responsibly.


Built because Kai went down and I was tired of waiting for someone else to fix it

Star this repo · Open an issue · Join Discord

Contributors

Languages