N-hentai API Homepage
ようこそ!

NO LONGER SUPPORTED Downloads Build Status Snyk Vulnerabilities for npm package minified
lol
kasu.nhentaiapi.js


[PROJECT IS NOW DISCONTINUED]

Since I notice how my scraping code took too long to load
the Nhentai website now checks for the browser to check if its a bot or not
and I am not gonna work with this anymore.

Thank you all who used this package!




The "N-hentai-api" is a fast and easy to use api for connecting to nhentai.net and nhentai.to data.

Install

To install "N-hentai-api" type these:

npm i kasu.nhentaiapi.js

Examples

How to use n-hentai-api

To start off, to import the module on your project add require then kasu.nhentaiapi.js.

Before accessing the methods create a connection to the nhentai server. There are two ways to start the connection, First is you can use the Constructor or the connection.start() method.

If using the connection.start make sure you already set or inputted the url on the url property.

To get the basic info about the ID/Doujin:

const Example = require('kasuNhentaiJS'); // you can still use the old "kasu.nhentaiapi.js"
const ExampleApi = new Example();

const ID = 228922
async function json(){

    // start the connection
    ExampleApi.url = "https://nhentai.net"
    ExampleApi.connection.start()

    const val = await ExampleApi.getID(ID).json()
    val.url
    // OR
    ExampleApi.getID(ID).json(data=>{data.url})
    // OR
    (await ExampleApi.getID(ID).json()).url
    // result: https://nhentai.net/g/228922/

    // closes the connection
    ExampleApi.connection.close()
}

For CLI new

How to run:

nhentai 228922 

check the changelogs for more info


If you are intrested on this project or want to share it you can embed it to your website!

<iframe title="kasura's nhentai API" src="https://ichimakikasura.github.io/kasu.nhentaiapi.js/embed/embed101" frameborder="0" width="500" height="244"></iframe>

(≧▽≦*) Other Informations (≧▽≦*)






Enjoy using it! crediting me will be an appreciation!
Star it if you like it!