{"id":23079724,"url":"https://github.com/sylveondeko/nhentaiapi","last_synced_at":"2025-07-28T09:09:56.029Z","repository":{"id":40456275,"uuid":"160789429","full_name":"SylveonDeko/NHentaiAPI","owner":"SylveonDeko","description":"A (full)  nHentai API implementation for .NET","archived":false,"fork":false,"pushed_at":"2024-11-15T18:55:54.000Z","size":86,"stargazers_count":37,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-19T07:20:36.046Z","etag":null,"topics":["andy840119","api","hentai","n-hentai","nhentai","nhentai-api","nuget"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SylveonDeko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-07T07:43:03.000Z","updated_at":"2025-02-18T18:19:25.000Z","dependencies_parsed_at":"2024-11-16T16:32:49.523Z","dependency_job_id":"3e5a15ab-e34f-4e6b-aa24-6bb67c21863b","html_url":"https://github.com/SylveonDeko/NHentaiAPI","commit_stats":null,"previous_names":["sylveon76/nhentaiapi"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/SylveonDeko/NHentaiAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SylveonDeko%2FNHentaiAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SylveonDeko%2FNHentaiAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SylveonDeko%2FNHentaiAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SylveonDeko%2FNHentaiAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SylveonDeko","download_url":"https://codeload.github.com/SylveonDeko/NHentaiAPI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SylveonDeko%2FNHentaiAPI/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267490580,"owners_count":24096000,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["andy840119","api","hentai","n-hentai","nhentai","nhentai-api","nuget"],"created_at":"2024-12-16T12:48:48.487Z","updated_at":"2025-07-28T09:09:55.972Z","avatar_url":"https://github.com/SylveonDeko.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NHentaiAPI\n\n[![Build status](https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true)](https://ci.appveyor.com/project/SylveonDeko/nhentaiapi)\n[![NuGet](https://img.shields.io/nuget/v/NHentaiAPI.svg)](https://www.nuget.org/packages/NHentaiAPI)\n[![NuGet](https://img.shields.io/nuget/dt/NHentaiAPI.svg)](https://www.nuget.org/packages/NHentaiAPI)\n[![NuGet](https://img.shields.io/badge/月子我婆-passed-ff69b4.svg)](https://github.com/SylveonDeko/NHentaiAPI)\n\nA full nHentai API implementation for .NET\n\n⚠️ If nHentai changes their API format, please create an issue to let me know!\n\n## Important Notes\n\n### User Agent Requirements\nA User-Agent is **required** to use this API. The client will throw an error if none is provided. You can get your User-Agent by:\n1. Going to https://www.whatismybrowser.com/detect/what-is-my-user-agent/\n2. Or by opening Developer Tools (F12) in your browser, going to Network tab, and looking at the \"User-Agent\" header in any request\n\nExample:\n```csharp\nvar client = new NHentaiClient(\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36\");\n```\n\n### CSRF Token (If Required)\nIf nHentai implements CSRF protection, you can get the token by:\n1. Opening Developer Tools (F12)\n2. Going to Network tab\n3. Looking for a request header named 'x-csrf-token' or a cookie named 'csrf_token'\n4. Pass it to the client using the cookies dictionary\n\n**Important**: The CSRF token must be obtained from the same IP address and User-Agent that will be used with the API. Using a token from a different IP or User-Agent will result in authentication failures.\n\n```csharp\nvar cookies = new Dictionary\u003cstring, string\u003e\n{\n    {\"csrf_token\", \"your-token-here\"}\n};\nvar client = new NHentaiClient(\"your-user-agent\", cookies);\n```\n\n## Features\n\n### Search Capabilities:\n\n1. Browse homepage content\n2. Search by keywords\n3. Search by tags with optional popularity sorting\n4. Filter tags using `-` prefix (exclusion)\n\n### Book Operations:\n\n1. Fetch book details\n2. Get related books\n\n### Image Operations:\n\n1. Page images (preview, thumbnail, and original quality)\n2. Cover images (preview and thumbnail)\n\n## Usage Examples\n\n### Search Books:\n```csharp\n// Initialize client with User-Agent\nvar client = new NHentaiClient(\"your-user-agent-string\");\n\n// Search with filters\nvar result = await client.GetSearchPageListAsync(\"school swimsuit full color -loli\", 2);\n\n// Browse homepage\nvar homeResults = await client.GetHomePageListAsync(1);\n```\n\n### Get Book Details:\n```csharp\nvar client = new NHentaiClient(\"your-user-agent-string\");\n\n// Get book by ID\nvar book = await client.GetBookAsync(123);\n\n// Get related books\nvar related = await client.GetBookRecommendAsync(123);\n```\n\n### Get Images:\n```csharp\nvar book = await client.GetBookAsync(123);\n\n// Get full page image\nbyte[] picture = await client.GetPictureAsync(book, 1);\n\n// Get cover image\nbyte[] cover = await client.GetBigCoverPictureAsync(book);\n\n// Get thumbnails\nbyte[] thumbnail = await client.GetThumbPictureAsync(book, 1);\nbyte[] coverThumb = await client.GetBookThumbPictureAsync(book);\n```\n\n## Check Out My Other Projects\n- [Mewdeko](https://github.com/SylveonDeko/Mewdeko) - Discord Bot\n- [MartineApi](https://github.com/SylveonDeko/MartineApi.Net) - Image API Wrapper\n- [NekosBestApi](https://github.com/SylveonDeko/Nekos.Best-API) - Anime Image API\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylveondeko%2Fnhentaiapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsylveondeko%2Fnhentaiapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylveondeko%2Fnhentaiapi/lists"}