Skip to content

upi-0/KomikuAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KomikuAPI

About

Unofficial Komiku.id API. Writen in Python with Asynchronus Support. The way it works is by sending a request to Komiku.id and parsing the response from HTML to JSON.

5790+ manga and 309400+ chapters available

Quick Start

Embed (Python)

pip install git+https://github.com/Malykz/KomikuAPI


Synchronous

import komiku

resp = komiku.Manga("ruri-dragon") # Send Request
ruri = resp.result # Parse the Response
ruri["title"] # "Ruri Dragon"


Asynchronous

import komiku
import httpx

async with httpx.AsyncClient() as client :
    resp = await komiku.Manga("ruri-dragon").asyn(client) # Send Request
    ruri = await resp.result # Parse the Response
    ruri["title"] # "Ruri Dragon"

Rest API

git clone https://github.com/Malykz/KomikuAPI
cd KomikuAPI
pip install -r req.txt
uvicorn server:app
curl -X GET http://localhost:8000/manga/ruri-dragon

End Points

endpoint method query decs
manga/{slug} GET - Get metadata from a manga
chapter/{slug} GET - Get chapter metadata from a manga
search GET q Search Manga(s)
search/top GET orderby, type Get trending manga info

Classes

There are 3 main classes : Manga, Chapter, Search. Each of which is a inheritance of the KomikuParser class.

KomikuParser

A parent class that has classmethods for parsing common data, sending requests, and rendering the response.

Method

  • render_page / as_render_page method is designed to fetch and process the content of a web page from a given URL.
  • async is an asynchronous function that prepares the KomikuParser instance for asynchronous operations. It takes a single parameter, client, which is an instance of httpx.AsyncClient
  • get_slug method is a utility function designed to extract a "slug" from a given URL. A slug is typically a unique identifier or part of a URL that represents a specific resource, such as a manga title in this case.

Disclaimer If you want to configure User-Agent and Navigator. But it's better not to need to reconfigure. The navigator is already set up that way.

komiku.KomikuParser.headers = {"user-agent" : "python-httpx"}

Manga

The class that handles parsing responses for all /manga/ endpoints. Requires slug as primary parameter.

Ex : Embed

ruri: dict = komiku.Manga("ruri-dragon").result

Ex : Rest API

curl -X GET http://localhost:8000/manga/ruri-dragon


Output (Preview) :

{
  "title": "Ruri Dragon",
  "judul": "Ruri Si Naga",
  "genre": [
    "Comedy",
    "Fantasy",
    "Shounen",
    "Slice of Life"
  ],
  "status": "Ongoing",
  "sinopsis": "Kisah seorang gadis naga muda menjadi malas, melakukan yang terbaik ...",
  "poster": "https://cover.komiku.id/wp-content/uploads/2022/09/Manga-Ruri-Dragon.jpg",
  "author": "Shindou Masaoki",
  "totalChapters": 33,
  "chapters": [
    {
      "chapter": "Chapter 32",
      "release": "07/04/2025",
      "url": "https://komiku.id/ruri-dragon-chapter-32-2/",
      "slug": "ruri-dragon-chapter-32-2"
    },
    . . .
  ]
}  

Chapter

The class that handles parsing responses for all /chapter/ endpoints. Requires slug as primary parameter.

Ex : Embed

ruri: dict = komiku.Search("ruri-dragon-chapter-32-2").result

Ex : Rest API

curl -X GET http://localhost:8000/chapter/ruri-dragon-chapter-32-2


Output (Preview) :

{
  "id": "https://komiku.id/ruri-dragon-chapter-32-2/#main",
  "url": "https://komiku.id/ruri-dragon-chapter-32-2/",
  "name": "Komik Ruri Dragon Chapter 32",
  "headline": "Komik Ruri Dragon Chapter 32",
  "description": "Komik Ruri Dragon Chapter 32 bahasa Indonesia bahasa Indonesia bisa kamu baca di Komiku dengan kualitas gambar terbaik.",
  "keywords": "Ruri Dragon Chapter 32, Komik, Chapter, Bahasa, Indonesia, Indo, Baca",
  "thumbnail": "https://img.komiku.id/uploads4/2918826-11.jpg",
  "totalPage": "32",
  "pagesUrl": [
    "https://cdn.komiku.id/uploads4/2918826-1.jpg",
    "https://cdn.komiku.id/uploads4/2918826-2.jpg",
    . . .
  ]  
}  

Search

The class that handles parsing responses for all /top/ and /search/ endpoints. Requires slug as parameter.

Searching Manga with title


Ex : Embed

ruri: list[dict] = komiku.Search("ruri").result

Ex : Rest API

curl -X GET http://localhost:8000/search?q=ruri


Output (Preview)

[
  {
    "img": "https://cover.komiku.id/wp-content/uploads/2022/09/Komik-Ruri-Dragon.jpg",
    "url": "https://komiku.id/manga/ruri-dragon/",
    "slug": "ruri-dragon",
    "title": "Ruri Dragon",
    "titleId": "Ruri Si Naga",
    "detail": "Update 1 minggu lalu. Kisah seorang gadis naga muda menjadi malas, melakukan yang terbaik ..."
  },
  . . .
]  

Looking for trending manga


Ex : Embed

ruri: list[dict] = komiku.Search("ruri").top("new", "manhua")

Ex : Rest API

curl -X GET http://localhost:8000/top?sort=new&type=manhua


Output (Preview)

[
  {
    "thumbnail": "https://cover.komiku.id/wp-content/uploads/2025/04/A1-I-Was-Forced-by-the-System-to-Become-a-Villain.jpg",
    "poster": "https://cover.komiku.id/wp-content/uploads/2025/04/A2-I-Was-Forced-by-the-System-to-Become-a-Villain.jpg",
    "url": "https://komiku.id/manga/i-was-forced-by-the-system-to-become-a-villain/",
    "slug": "i-was-forced-by-the-system-to-become-a-villain",
    "title": "I Was Forced by the System to Become a Villain",
    "views": "189rb x • 3 hari • Berwarna",
    "detail": "Lin Bei, yang melakukan perjalanan melintasi waktu dan menjadi saudara senior kedua dari Puncak Lingxi dari Sekte Qingyun,~"
  },
  . . .
]  

About

Unofficial Self-Hosted Komiku.id API.

Topics

Resources

Stars

Watchers

Forks

Languages