Package Exports
- dou-api
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dou-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
DouAPI
nHentai unofficial API (Built Off NanaAPI)
Install
npm install dou-apiExample
const DouAPI = require("dou-api");
const dou = new DouAPI();
// Get gallery from book ID or book link
dou.g("14045").then((g) => {
console.log(g);
});
dou.g("https://nhentai.net/g/4501").then((g) => {
console.log(g);
});Results
- Book Object
{
id: 4501,
media_id: '14634',
title: {
english: '[Petite*Cerisier (Sakura*Sakura)] Suzumiya Haruhi no meirei (The Melancholy of Haruhi Suzumiya)',
japanese: '[Petite*Cerisier (さくら*さくら)] 涼宮ハルヒの命令 (涼宮ハルヒの憂鬱)',
pretty: 'Suzumiya Haruhi no meirei'
},
images: {
pages: [
{ t: 'j', w: 1050, h: 1500 },
{ t: 'j', w: 1050, h: 1500 },
{ t: 'j', w: 1050, h: 1500 },
{ t: 'j', w: 1050, h: 1500 },
{ t: 'j', w: 1050, h: 1500 },
...
],
cover: { t: 'j', w: 350, h: 500 },
thumbnail: { t: 'j', w: 250, h: 357 }
},
scanlator: '',
upload_date: 1403972325,
tags: [
{
id: 190,
type: 'tag',
name: 'maid',
url: '/tag/maid/',
count: 10631
},
{
id: 2937,
type: 'tag',
name: 'big breasts',
url: '/tag/big-breasts/',
count: 104551
},
{
id: 8010,
type: 'tag',
name: 'group',
url: '/tag/group/',
count: 72839
},
...
],
num_pages: 10,
num_favorites: 7
}- List Object
{
num_pages: 852,
results: [
{
id: '239990',
title: "[Fue] Inma no Mikata! | Succubi's Supporter! [English] [biribiri, Hennojin] [Decensored]",
language: 'english',
thumbnail: [
s: 'https://t.nhentai.net/galleries/1258772/thumb.jpg',
w: '250',
h: '307'
]
},
{
id: '142825',
title: '[Higuma-ya (Nora Higuma)] Toaru Mura no Fudeoroshi Jijou | A Certain Village Custom [English] [PSYN + Facedesk] [Digital]',
language: 'english',
thumbnail: [
s: 'https://t.nhentai.net/galleries/849121/thumb.jpg
w: '250',
h: '354'
]
},
{
id: '123554',
title: '[Mizuryu Kei] Teisou Kannen ZERO [English] {doujin-moe.us}',
language: 'english',
thumbnail: [
s: 'https://t.nhentai.net/galleries/770772/thumb.jpg
w: '250',
h: '105'
]
},
...
]
}API List
The ID of a doujin can be found can be found at after the /g/ in the search bar or a URL.
https://nhentai.net/g/248121 in this case 248121 is the ID.
douAPI.g(ID | Link)
ID | Linkcan bothstringornumber
Get book API from book ID of book Link
return a Book Object
douAPI.random()
Get random book API
return a Book Object
douAPI.related(ID | Link)
ID | Linkcan bothstringornumber
Get realated book API from book ID or book link
return a List Object
douAPI.homepage([page])
pageisoptionaland must be anumber
Get book list from nHentai homepage
return a List Object
douAPI.popular()
Get book list from popular section
return a List Object
douAPI.search(keyword [, page, popular ])
pagemust be anumberpopularcan be abooleanorstring, if settruewill get thepopularlist availablestringparameter is:today,all, andweek
Get search list from keyword provided
return a List Object
douAPI.tag(keyword [, page, popular ])
Same as douAPI.search()
douAPI.artist(keyword [, page, popular ])
Same as douAPI.search()
douAPI.character(keyword [, page, popular ])
Same as douAPI.search()
douAPI.parody(keyword [, page, popular ])
Same as douAPI.search()
douAPI.group(keyword [, page, popular ])
Same as douAPI.search()