nhentai.js-api
v3.0.3
Published
nhentai.net API
Downloads
19
Maintainers
Readme
nhentai.net api
Install
npm install nhentai.js-api
Usage
import { NHentai, NHSort } from 'nhentai.js-api';
// or
const { NHentai, NHSort } = require('nhentai.js-api');
const api = new NHentai();
// Get a hentai from a URL
const hentai = await api.hentai('https://nhentai.net/g/101010');
// Get a hentai from an id
const hentai = await api.hentai(101010);
// Get a random hentai
const hentai = await api.random(false);
// Get a random english hentai
const hentai = await api.random(true);
// Search for hentai
const results = await api.search('catgirl', NHSort.all_time);
if (results.total > 0) {
// 25 hentai max
for (const hentai of result.hentai) {
console.log(
hentai.title,
hentai.id,
hentai.url,
hentai.cover,
hentai.language
);
if (hentai.language === 'english') {
const fullHentai = await hentai.fetch();
console.log(fullHentai.images);
}
}
// next page
await results.next();
}