NekosBestApiNet 1.0.11

dotnet add package NekosBestApiNet --version 1.0.11
                    
NuGet\Install-Package NekosBestApiNet -Version 1.0.11
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NekosBestApiNet" Version="1.0.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NekosBestApiNet" Version="1.0.11" />
                    
Directory.Packages.props
<PackageReference Include="NekosBestApiNet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NekosBestApiNet --version 1.0.11
                    
#r "nuget: NekosBestApiNet, 1.0.11"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NekosBestApiNet@1.0.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NekosBestApiNet&version=1.0.11
                    
Install as a Cake Addin
#tool nuget:?package=NekosBestApiNet&version=1.0.11
                    
Install as a Cake Tool

Nekos.Best API Wrapper

nuget version downloads

https://docs.nekos.best/index.html

Overview

A C# wrapper for the Nekos.Best API, which serves fully SFW, high quality anime images and GIFs. All endpoints are available through two APIs: ActionsApi for action-based GIFs and CategoryApi for image categories.

If you find any bugs or want a feature added, create an issue.

Installation

dotnet add package NekosBestApiNet

Usage

Basic usage

The constructor takes a client name string used as the User-Agent header.

using NekosBestApiNet;

var api = new NekosBestApi("MyAppName");

var result = await api.ActionsApi.Hug();
Console.WriteLine(result.Results[0].Url);

Requesting multiple results

All endpoints accept an optional amount parameter (defaults to 1).

var results = await api.ActionsApi.Pat(amount: 5);
foreach (var r in results.Results)
    Console.WriteLine(r.Url);

Custom HttpClient

You can provide your own HttpClient. You must set BaseAddress manually.

using System.Net.Http;
using NekosBestApiNet;

var httpClient = new HttpClient
{
    BaseAddress = new Uri("https://nekos.best/api/v2")
};

var api = new NekosBestApi(httpClient);

Dependency injection

using NekosBestApiNet;
using Microsoft.Extensions.DependencyInjection;

var services = new ServiceCollection();
services.AddSingleton(new NekosBestApi("MyAppName"));

var provider = services.BuildServiceProvider();
var api = provider.GetRequiredService<NekosBestApi>();

var result = await api.ActionsApi.Hug();
Console.WriteLine(result.Results[0].Url);

Available endpoints

ActionsApi

Method Endpoint
Angry /angry
Baka /baka
Bite /bite
Bleh /bleh
Blowkiss /blowkiss
Blush /blush
Bonk /bonk
Bored /bored
Carry /carry
Clap /clap
Confused /confused
Cry /cry
Cuddle /cuddle
Dance /dance
Facepalm /facepalm
Feed /feed
Happy /happy
Handhold /handhold
Handshake /handshake
Highfive /highfive
Hug /hug
Kabedon /kabedon
Kick /kick
Kiss /kiss
Laugh /laugh
Lappillow /lappillow
Lurk /lurk
Nod /nod
Nom /nom
Nope /nope
Nya /nya
Pat /pat
Peck /peck
Poke /poke
Pout /pout
Punch /punch
Run /run
Salute /salute
Shake /shake
Shoot /shoot
Shocked /shocked
Shrug /shrug
Sip /sip
Slap /slap
Sleep /sleep
Smile /smile
Smug /smug
Spin /spin
Stare /stare
TableFlip /tableflip
Teehee /teehee
Think /think
Thumbsup /thumbsup
Tickle /tickle
Wag /wag
Wave /wave
Wink /wink
Yawn /yawn
Yeet /yeet

CategoryApi

Fetch images by category. See docs.nekos.best for the full list of available categories.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

  • net9.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.