kasu.nhentaiapi.js

Easy nhentai API library (C# port is now available)


Keywords
nhentai, nhentai.net, nhentai.to, R18, api, hentai, unofficial, wrapper, parser, cli, csharp-support, nhentai-api, nodejs, parser-api, unofficial-api
License
MIT
Install
npm install kasu.nhentaiapi.js@3.9.3

Documentation

N-hentai API

stable version Downloads Build Status Snyk Vulnerabilities for npm package minified
lol
kasu.nhentaiapi.js

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

  • Fast*
  • Easy to use
  • Reliable* :>
  • Discord friendly?

Install

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

npm i kasu.nhentaiapi.js

Examples

How to use n-hentai-api

To get the basic info about the ID/Doujin:

const Example = require('kasu.nhentaiapi.js');
const ExampleApi = new Example();
/**
 * or const ExampleApi = new Example('start', "https://nhentai.net");
 * If you don't want to add the url and connection.start() after it.
 * because it automatically start the connection.
 * 
 * Check the documentation or the homepage for more info.
*/

//          ----number | strings can do----
const ID = 228922 //or "228922" or "https://nhentai.net/g/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

How to run:

nhentai 228922 

check the changelogs for more info


C# port new

C# of this project's parser is now available in beta. click here to go there.


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





embed


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