Skip to main content
DiscordBotsList.Api is the official Top.gg library for .NET. It exposes both an unauthenticated client for reading public bot and user data and an authenticated client for posting your bot’s stats and generating widget URLs.

Installation

Install with the .NET CLI:
Or from the NuGet Package Manager Console:
Or add a PackageReference directly to your .csproj:
Replace x.y.z with the latest version published on NuGet.

Unauthenticated usage

Use DiscordBotListApi to read public data without an API token. This is useful for looking up any bot or user listed on Top.gg.
unauthenticated.cs

Authenticated usage

Use AuthDiscordBotListApi when you need to post stats on behalf of your bot. Pass your bot’s Discord ID and your Top.gg API token to the constructor.
authenticated.cs
If your bot uses sharding, prefer the overload that accepts shardIndex, shardCount, and a shard array so your listing displays accurate per-shard information.

Widgets

Generate a widget image URL for your bot’s listing using SmallWidgetOptions. You can customize the widget type and colors before calling Build.
widget.cs
Embed the returned URL in an <img> tag or Markdown image to display the widget on your website or README.

Resources