Skip to content
NHentaiSharp is a C# library to use NHentai.net API
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
NHentaiSharp.UnitTests Add unit test Jun 6, 2019
NHentaiSharp Fix crash when pages are GIF Jun 16, 2019
.gitattributes Add empty project Aug 8, 2018
.gitignore Add url in GalleryElement Jun 3, 2019
LICENSE Initial commit Aug 8, 2018
NHentaiSharp.sln Add empty project Aug 8, 2018
README.md Update README.md Jun 3, 2019
appveyor.yml Add empty project Aug 8, 2018

README.md

Build status NuGet codecov Unit tests CodeFactor

NHentaiSharp

NHentaiSharp is a C# library to use NHentai.net API.

How to download it?

You can download it from NuGet with the following command line:

Install-Package NHentaiSharp

Example: Getting a random doujinshi

string[] tags = new[] { // Tags for the upcoming searches
  "loli", // We add the tag loli
  NHentaiSharp.Core.SearchClient.GetExcludeTag("rape"), // We exclude the tag rape
  NHentaiSharp.Core.SearchClient.GetCategoryTag("kantai collection", NHentaiSharp.Search.TagType.Parody)
  // We search doujinshi of the anime/game Kantai Collection
};

Random r = new Random();
// We do a search with the tags
var result = await NHentaiSharp.Core.SearchClient.SearchWithTagsAsync(tags);
int page = r.Next(0, result.numPages) + 1; // Page count begin at 1
// We do a new search at a random page
result = await NHentaiSharp.Core.SearchClient.SearchWithTagsAsync(tags, page);
var doujinshi = result.elements[r.Next(0, result.elements.Length)]; // We get a random doujinshi

Console.WriteLine("Random doujinshi: " + doujinshi.prettyTitle + Environment.NewLine +
  "URL: " + doujinshi.url);

For more information about using this library, please check the wiki.

You can’t perform that action at this time.