Skip to main content

an nhentai api wrapper.

Project description


nhentai.get_doujin(id:int) -> Doujin
Returns a doujin by given /g/id.

nhentai.get_random_id() -> int
Returns a random and valid /g/id.

nhentai.get_homepage(page:int) -> List[Doujin]
Returns a list of the most recently uploaded doujins on the homepage., page:int, sort_by:str) -> List[Doujin]
Returns a list of doujins related to a given keyword.

nhentai.search_tagged(tag_id:int, page:int, sort_by:str) -> List[Doujin]
Returns a list of doujins that have the given tag id.


Getting doujin using a /g/id

>>> d = nhentai.get_doujin(123)
>>> # URL to first page's image.
>>> d[0].url 
>>> d.__dict__
{'id': 123, 
'media_id': '635',
'thumbnail': '',
'cover': ''}
'titles': {'english': '(C69) [Nakayohi Mogudan (Mogudan)] Omakehon 2005 (Neon Genesis Evangelion)', 'japanese': '(C69) [なかよひモグダン (モグダン)] おまけ本 2005 (新世紀エヴァンゲリオン)', 'pretty': 'Omakehon 2005'},
'tags': [Tag(id=17202, type='artist', name='mogudan', url='/artist/mogudan/', count=213)

Getting a random doujin

>>> id = nhentai.get_random_id()
>>> id
>>> nhentai.get_doujin(id).tags
[Tag(id=17249, type='language', name='translated', url='/language/translated/', count=109734), 

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for, version 2.2.1
Filename, size File type Python version Upload date Hashes
Filename, size (3.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page