BangumiApiClient.NET 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package BangumiApiClient.NET --version 1.0.0
                    
NuGet\Install-Package BangumiApiClient.NET -Version 1.0.0
                    
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="BangumiApiClient.NET" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BangumiApiClient.NET" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="BangumiApiClient.NET" />
                    
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 BangumiApiClient.NET --version 1.0.0
                    
#r "nuget: BangumiApiClient.NET, 1.0.0"
                    
#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 BangumiApiClient.NET@1.0.0
                    
#: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=BangumiApiClient.NET&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=BangumiApiClient.NET&version=1.0.0
                    
Install as a Cake Tool

Bangumi API 客户端

这是一个基于 .NET 8.0 的 Bangumi API 客户端库,用于访问 Bangumi 番组计划 的 API 接口。

项目概述

该项目是使用 Microsoft Kiota 工具根据 Bangumi API 规范自动生成的客户端库。它提供了对 Bangumi 平台数据(如动画、书籍、游戏、音乐、三次元作品以及相关的人物、角色等信息)的访问能力。

项目结构

BangumiApi/
├── Calendar/           # 时间表相关接口
├── Models/             # 数据模型类(约90个)
├── V0/                 # API v0 版本接口实现
│   ├── Characters/     # 角色相关接口
│   ├── Episodes/       # 剧集相关接口
│   ├── Indices/        # 索引相关接口
│   ├── Me/             # 当前用户相关接口
│   ├── Persons/        # 人物相关接口
│   ├── Revisions/      # 版本修订相关接口
│   ├── Search/         # 搜索相关接口
│   ├── Subjects/       # 条目相关接口
│   └── Users/          # 用户相关接口
├── ApiClient.cs              # API 客户端主入口
├── ClientBuilder.cs          # 客户端构建器
├── BangumiAuthenticationProvider.cs     # 认证提供程序
└── BangumiAuthenticationTokenAccess.cs # Token 访问处理

主要功能模块

1. 数据模型 (Models)

包含约90个数据模型类,对应 Bangumi API 返回的各种数据结构:

2. API 接口 (V0)

按照 Bangumi API v0 版本组织的接口调用类:

3. 核心组件

使用示例

// 创建公共客户端(无需认证)
var client = ClientBuilder.CreatePublicClient();

// 获取条目信息
var subject = await client.V0.Subjects["123"].GetAsync();

// 创建认证客户端
var authProvider = new BangumiAuthenticationProvider("YourApp/1.0", "your-access-token");
var authenticatedClient = ClientBuilder.CreateAuthenticatedClient(authProvider, "your-access-token");

// 获取当前用户信息
var userInfo = await authenticatedClient.V0.Me.GetAsync();

依赖项

构建与打包

该项目配置为可打包的 NuGet 库,包名为 BangumiApi.Client

dotnet pack

许可证

本项目采用 MIT 许可证。

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 was computed.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.1 472 12/10/2025
1.1.0 689 12/3/2025
1.0.0 681 12/3/2025