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
new
C# port C# of this project's parser is now available in beta. click here to go there.
(≧▽≦*) Other Informations (≧▽≦*)
Enjoy using it! crediting me will be an appreciation!
Star it if you like it!