** DISCLAIMER:** This API is experimental and not reliable. Use at your own risk. No guarantees on uptime or data accuracy. I'M NOT RESPONSIBLE FOR ANY UNETHICAL USAGES OR LEGAL TROUBLES, ONLY FOR EDUCATION PURPOSE.
A anime streaming API built for scale. Kuhi provides a clean REST interface to search, filter, and stream anime content with automatic source extraction and proxy capabilities.
- Smart Search - Search by anime name or AniList ID
- Auto-Extraction - Automatically finds best streaming sources
- Movie Detection - Automatically handles movies vs episodes
- Decryption Pipeline - Handles encrypted streaming sources
- CORS Proxy - Built-in proxy for bypassing CDN restrictions
- HLS Streaming - Full M3U8 playlist and segment proxying
- Python 3.8+
- pip
- Clone the repository:
git clone https://github.com/aryaniiil/kuhi-anime-api
cd Kuhi-anime-api- Install dependencies:
python -m pip install -r requirements.txt- Run the server:
uvicorn api:app --reload- Access the API:
http://127.0.0.1:8000
Kuhi/
├── src/
│ ├── __init__.py # Package initializer
│ ├── main.py # FastAPI app & proxy endpoints
│ ├── endpoints.py # Anime API routes
│ ├── extractor.py # AniList & Miruro data fetchers
│ ├── parser.py # Data transformation utilities
│ ├── queries.py # GraphQL query templates
│ └── config.py # Configuration & constants
├── api.py # Alternative entry point
├── .gitignore # Git ignore rules
└── README.md # This file
Search anime by keyword with pagination.
Parameters:
query(string, required) - Search termpage(int, default: 1) - Page numberper_page(int, default: 20, max: 50) - Results per page
Example:
curl "http://127.0.0.1:8000/anime/search?query=naruto&page=1"Lightweight autocomplete search for dropdowns.
Parameters:
query(string, required) - Search term
Example:
curl "http://127.0.0.1:8000/anime/suggestions?query=one%20piece"List all available genres for filtering.
Example:
curl "http://127.0.0.1:8000/anime/genres"Top 10 trending and popular anime.
Example:
curl "http://127.0.0.1:8000/anime/spotlight"Currently trending anime with pagination.
Parameters:
page(int, default: 1)per_page(int, default: 20, max: 50)
Example:
curl "http://127.0.0.1:8000/anime/trending?page=1&per_page=20"Most popular anime of all time.
Parameters:
page(int, default: 1)per_page(int, default: 20, max: 50)
Example:
curl "http://127.0.0.1:8000/anime/popular"Upcoming anime releases.
Parameters:
page(int, default: 1)per_page(int, default: 20, max: 50)
Example:
curl "http://127.0.0.1:8000/anime/upcoming"Recently aired episodes.
Parameters:
page(int, default: 1)per_page(int, default: 20, max: 50)
Example:
curl "http://127.0.0.1:8000/anime/recent"Airing schedule for upcoming episodes.
Parameters:
page(int, default: 1)per_page(int, default: 20, max: 50)
Example:
curl "http://127.0.0.1:8000/anime/schedule"Filter anime by multiple criteria.
Parameters:
genre(string, optional) - Genre name (get from /anime/genres)tag(string, optional) - Tag nameyear(int, optional) - Season yearseason(string, optional) - Season (WINTER, SPRING, SUMMER, FALL)format(string, optional) - Format (TV, MOVIE, OVA, ONA, SPECIAL)status(string, optional) - Status (RELEASING, FINISHED, NOT_YET_RELEASED)sort(string, default: POPULARITY_DESC) - Sort orderpage(int, default: 1)per_page(int, default: 20, max: 50)
Sort Options:
SCORE_DESC- Highest ratedPOPULARITY_DESC- Most popularTRENDING_DESC- Currently trendingSTART_DATE_DESC- Recently startedFAVOURITES_DESC- Most favoritedUPDATED_AT_DESC- Recently updated
Example:
curl "http://127.0.0.1:8000/anime/filter?genre=Action&sort=SCORE_DESC&year=2024"Complete anime information including characters, relations, staff, and recommendations.
Example:
curl "http://127.0.0.1:8000/anime/info/21"Character list with voice actors.
Parameters:
page(int, default: 1)per_page(int, default: 25, max: 50)
Example:
curl "http://127.0.0.1:8000/anime/anime/21/characters"Related anime (sequels, prequels, spin-offs).
Example:
curl "http://127.0.0.1:8000/anime/anime/21/relations"Recommended similar anime.
Parameters:
page(int, default: 1)per_page(int, default: 10, max: 25)
Example:
curl "http://127.0.0.1:8000/anime/anime/21/recommendations"Get episode list with provider mappings.
Example:
curl "http://127.0.0.1:8000/anime/episodes/21"Magic endpoint - Automatically extracts streaming sources from anime name or ID.
Parameters:
query(string, required) - AniList ID (21) or anime name (violet evergarden)e(int, default: 1) - Episode number
Features:
- Accepts both numeric IDs and full anime names with spaces
- Automatically searches AniList if name is provided
- Auto-detects movies and plays them regardless of episode parameter
- Prioritizes best quality providers (zoro → bee → kiwi → telli → arc → yugen → jet → neo)
- Returns HLS streams with referer headers
Examples:
# Using AniList ID
curl "http://127.0.0.1:8000/anime/extract/21?e=1"
# Using anime name (spaces work)
curl "http://127.0.0.1:8000/anime/extract/violet%20evergarden?e=1"
# Using hyphenated name
curl "http://127.0.0.1:8000/anime/extract/my-hero-academia?e=5"
# Movie (episode param ignored)
curl "http://127.0.0.1:8000/anime/extract/a-silent-voice"Tip: If search by name fails, use /anime/search?query=<name> to get the exact AniList ID first.
Proxy M3U8 playlists with referer injection and URL rewriting.
Parameters:
url(string, required) - M3U8 playlist URLreferer(string, required) - Referer header value
Proxy video segments with referer injection.
Parameters:
url(string, required) - Segment URLreferer(string, required) - Referer header value
- Search for anime:
curl "http://127.0.0.1:8000/anime/search?query=demon%20slayer"- Get anime info (use ID from search):
curl "http://127.0.0.1:8000/anime/info/101922"- Get episodes:
curl "http://127.0.0.1:8000/anime/episodes/101922"- Extract streaming source:
curl "http://127.0.0.1:8000/anime/extract/101922?e=1"Skip all steps and directly extract:
# By name
curl "http://127.0.0.1:8000/anime/extract/demon%20slayer?e=1"
# By ID
curl "http://127.0.0.1:8000/anime/extract/101922?e=1"All endpoints return JSON with consistent structure:
{
"page": 1,
"perPage": 20,
"total": 1000,
"hasNextPage": true,
"results": [...]
}{
"streams": [
{
"type": "hls",
"url": "https://..../master.m3u8",
"referer": "https://..."
}
],
"subtitles": [...]
}Edit src/config.py to customize:
- AniList API URL
- Miruro pipe URL
- Request headers
- Timeouts
- FastAPI - Modern async web framework
- httpx - Async HTTP client
- HLS.js - Video player for web interface
- AniList GraphQL API - Anime metadata
- Miruro Pipe - Encrypted streaming sources
Run in development mode with auto-reload:
uvicorn api:app --reload- All image URLs are automatically proxied through serveproxy.com
- Provider priority: zoro > bee > kiwi > telli > arc > yugen > jet > neo
- Movies automatically default to episode 1
- M3U8 playlists and segments are proxied to bypass referer checks
- CORS is enabled for all origins
Educational purposes only. Respect content creators and copyright laws.
Built with ❤️ for the anime community