Skip to content

Latest commit

 

History

History
204 lines (155 loc) · 4.5 KB

README.md

File metadata and controls

204 lines (155 loc) · 4.5 KB
Dancing
Mangpi



[Go through The documentation of the Mangpi API ]
Mangpi is a simple API that provides manga, manhwa, webtoons data including its details, chapters, pages and many more. All the provided data are scraped using Puppeteer from mangaPark.

Base URL

Being a student, i am poor af 🤧. Can't afford to host the api on serverless instance. Yeah, i know there are some service provider which provide free hosting, but mine program doesn't work on them due to timeOut limitation on free-tire plans. So, no base url 🥹.


Endpoints

Endpoint 1

GET /manga/{name}

This endpoint allows clients to retrieve details about a manga/manhwa. The response includes various details such as the manga's name, author, genre, synopsis, status and more.


Parameters:

  • {name} - name of the manga/manhwa, should be in lowercase and space should be seperated by _

Example:

GET /manga/one_piece

Response (200):

[
  {
    "code": "200"
  },
  {
    "data":{
      "name": "One Piece",
      //other details
      ...
    }
  },
  //other data
]

Endpoint 2

GET /manga/chaplist/{name}

This endpoint allows clients to retrieve chapter lists of a manga/manhwa. The response includes manga's name, latest Update and all the chapter list in an array.


Parameters:

  • {name} - name of the manga/manhwa, should be in lowercase and space should be seperated by _

Example:

GET /manga/chaplist/one_piece

Response (200):

[
  {
    "code": "200"
  },
  {
    "data": {
      "name": "One Piece",
      "lastUpdate": "91 hours ago",
      "lastChapter": "Vol.TBE Ch.1104",
      "chapters": [
        "Vol.01 Ch.001: Romance Dawn",
        "Vol.01 Ch.002: They call him \"Straw Hat Luffy\"",
        //all chapters
        ...
      ]
    }
  },
  //other data
]

Endpoint 3

GET /manga/chapter/{chapterNumber}/{name}

This endpoint allows clients to retrieve chapter's pages of a manga/manhwa. The response includes manga's chapter page's image link with page count.


Parameters:

  • {name} - name of the manga/manhwa, should be in lowercase and space should be seperated by _
  • {chapterNumber} - chapter number, only the number

Example:

GET /manga/chapter/123/one_piece

Response (200):

[
  {
    "code": "200"
  },
  {
    "data": {
      "name": "One Piece",
      "chapter": "Ch.123",
      "release": "5313 days ago",
      "pages": [
        {
          "number": 0,
          "img": "https://example.link"
        },
        //other page's image
        ...
      ]
    }
  },
  //other data
]

Error Handling

There are only three types of errors possible in the program; manga not found, scraper website error and internal server error, and are handeled by returning 404, 502, 500 error code respectively.

Example (404):

[
  {
    "code": "404",
    "error": "The requested manga/data was not found !!"
  },
  //other info
]

Run Locally

Make sure you have correct package manager installed before running the program locally, npm or yarn.

  1. Clone the repo
git clone https://github.com/sololinux/mangpi
  1. Go inside the cloned repo (root) and install the required packages
cd mangpi

npm install
//or
yarn install
  1. Start the program
npm start
//or
yarn start

Now, vist localhost in port 7253 as the base url for the api ie. 127.0.0.1:7253/ , for manga explosion 💥.


Contact

For any inquiries or assistance, please contact solo .

License

This project is licensed under the MIT. See the LICENSE file for details.