KickLib 1.0.2
dotnet add package KickLib --version 1.0.2
NuGet\Install-Package KickLib -Version 1.0.2
<PackageReference Include="KickLib" Version="1.0.2" />
paket add KickLib --version 1.0.2
#r "nuget: KickLib, 1.0.2"
// Install KickLib as a Cake Addin #addin nuget:?package=KickLib&version=1.0.2 // Install KickLib as a Cake Tool #tool nuget:?package=KickLib&version=1.0.2
<p align="center"> <img src="KickLibLogo.png" style="max-height: 300px;"> </p>
<p align="center"> <a href="https://www.microsoft.com/net"><img src="https://img.shields.io/badge/-.NET%209.0-blueviolet" style="max-height: 300px;"></a> <img src="https://img.shields.io/badge/Platform-.NET-lightgrey.svg" style="max-height: 300px;"> <a href="https://discord.gg/fPRXy57WrS"><img src="https://img.shields.io/badge/Discord-KickLib-green.svg" style="max-height: 300px;"></a> <a href="https://github.com/Bukk94/KickLib/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" style="max-height: 300px;"></a> <a href="https://www.nuget.org/packages/KickLib"><img src="https://img.shields.io/nuget/dt/KickLib?label=NuGet&color=orange" style="max-height: 300px;"></a> </p>
<p align="center"> <a href='https://ko-fi.com/bukk94' target='_blank'> <img height='30' style='border:0;height:38px;' src='https://storage.ko-fi.com/cdn/kofi6.png?v=6' border='0' alt='Buy Me a Coffee at ko-fi.com' /> </a>
About
KickLib is a C# library that allows for interaction with both official and unofficial (undocumented) Kick API (https://kick.com) and WebSocket. KickLib eases implementation for various chatbots by providing simple to use methods.
KickLib Highlights ✨
- OAuth 2.1 flow
- Real-time chat reading
- Stream state detection
- Authentication flow
- Message sending
- API Endpoint calls
<details> <summary>Click here to see Complete Features List</summary>
Client
- Reading Chatroom events
- New message received
- Message deleted
- User banned / unbanned
- New subscriptions
- Subscriptions gifts
- Stream host changes
- New pinned message
- Pinned message deleted
- Reading Channel events
- Followers status updated
- Stream state detection
- Gifts leaderboards updated
API
- Categories
- Get all main (root) categories
- Get specific main category
- Get top categories
- Get sub-categories (paged)
- Get all sub-categories (list all)
- Get specific sub-category
- Get subcategory clips (paged)
- Clips
- Get all Kick clips
- Get clip information
- Download clip
- Channels
- Get messages
- Get channel information
- Get channel chatroom information
- Get channel chatroom rules
- Get channel polls
- Get channel clips
- Get channel links
- Get channel videos
- Get channel latest video
- Get channel leaderboards
- Get latest subscriber (Requires Authentication)
- Get followers count
- Emotes
- Get channel emotes
- Livestreams
- Is streamer live?
- Get livestream information
- Message
- Send message to chatroom (Requires Authentication)
- Users
- Get user information
- Videos
- Get video </details>
Unofficial API support
KickLib provides support for unofficial API calls via IKickUnofficialApi
interface.
Documentation for unofficial API can be found here.
Installing ⏫
First, install NuGet. Then, install KickLib from the package manager console:
PM> Install-Package KickLib
Or from the .NET CLI as:
dotnet add package KickLib
Using KickLib via Dependency Injection
If you are using Dependency Injection, you can easily add KickLib via extension method
.AddKickLib()
, that will register all related services with Scoped lifetime.
Examples 💡
OAuth flow
Simple OAuth flow using KickLib OAuth generator.
NOTE: If no state is provided, it will automatically generate state for you as base64 encoded verifier code!
var callbackUrl = "https://localhost:5001/auth/kick/callback";
var clientId = "01AAAAA0EXAMPLE66YG2HD9R";
var clientSecret = "aaac0000EXAMPLE8ebe4dc223d0c45187";
var url = KickOAuthGenerator.GetAuthorizationUri(
callbackUrl,
clientId,
new List<string>
{
"user:read",
"channel:read"
}, out var verifier);
// TODO: Perform URL redirect for user and pass OAuth process
// Via callback URL, you will receive code and state
var code = "NAAAAAAY5YZQ00STATE000ZZTFHM2I1NJLK";
var state = "ZXhhbXBsZSB2YWx1ZQ==";
var exchangeResults = await KickOAuthGenerator.ExchangeCodeForTokenAsync(
state,
clientId,
clientSecret,
callbackUrl,
state);
Refreshing Access Token
var clientId = "01AAAAA0EXAMPLE66YG2HD9R";
var clientSecret = "aaac0000EXAMPLE8ebe4dc223d0c45187";
var refreshToken = "NAAAAAAY5YZQ00REFRESHTOKEN000ZZTFHM2I1NJLK";
var exchangeResults = await KickOAuthGenerator.RefreshAccessTokenAsync(
refreshToken,
clientId,
clientSecret);
Using API to get information
IKickApi api = new KickApi(new ApiSettings
{
AccessToken = accessToken
});
// Get specific category by ID
var category = await kickApi.Categories.GetCategoryAsync(28);
Using Client to read chat messages
IKickClient client = new KickClient();
client.OnMessage += delegate(object sender, ChatMessageEventArgs e)
{
Console.WriteLine(e.Data.Content);
};
await client.ListenToChatRoomAsync(123456);
await client.ConnectAsync();
Authenticated API calls
All calls require authentication. Kick officially supports OAuth 2.1 flow.
KickLib provides tools for generating OAuth URLs, exchanging code for tokens, and refreshing tokens.
To perform calls with authentication, set AccessToken
in settings object or pass it via method call.
IKickApi api = new KickApi(new ApiSettings
{
AccessToken = accessToken
}, logger);
var category = await kickApi.Categories.GetCategoryAsync(28);
Disclaimer
For a long time, Kick didn't have any official API. Most of the functionality in KickLib was researched and reversed-engineered from their website.
With new released API support, this library will be adjusted accordingly, removing all unofficial endpoints and methods. Those methods will be replaced with proper official API calls (once we have all of them).
KickLib is meant to be used for education purposes. Don't use it for heavy scraping or other harmful actions against Kick streaming platform. I don't take responsibility for any KickLib misuse and I strongly advice against such actions.
Special Thanks
@Robertsmania for helping with OTP generation, library improvements, and extensive testing.
License
See MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
-
net7.0
- FluentResults (>= 3.16.0)
- JsonSubTypes (>= 2.0.1)
- Microsoft.Extensions.Logging (>= 9.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.2)
- Microsoft.Extensions.Logging.Console (>= 9.0.2)
- Newtonsoft.Json (>= 13.0.3)
- Otp.NET (>= 1.3.0)
- Polly (>= 8.5.2)
- PuppeteerExtraSharp (>= 2.0.0)
- PuppeteerSharp (>= 14.0.0)
- PusherClient (>= 2.2.1)
- RandomUserAgent (>= 1.1.2)
- WebSocketSharper (>= 1.0.42)
-
net8.0
- FluentResults (>= 3.16.0)
- JsonSubTypes (>= 2.0.1)
- Microsoft.Extensions.Logging (>= 9.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.2)
- Microsoft.Extensions.Logging.Console (>= 9.0.2)
- Newtonsoft.Json (>= 13.0.3)
- Otp.NET (>= 1.3.0)
- Polly (>= 8.5.2)
- PuppeteerExtraSharp (>= 2.0.0)
- PuppeteerSharp (>= 14.0.0)
- PusherClient (>= 2.2.1)
- RandomUserAgent (>= 1.1.2)
- WebSocketSharper (>= 1.0.42)
-
net9.0
- FluentResults (>= 3.16.0)
- JsonSubTypes (>= 2.0.1)
- Microsoft.Extensions.Logging (>= 9.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.2)
- Microsoft.Extensions.Logging.Console (>= 9.0.2)
- Newtonsoft.Json (>= 13.0.3)
- Otp.NET (>= 1.3.0)
- Polly (>= 8.5.2)
- PuppeteerExtraSharp (>= 2.0.0)
- PuppeteerSharp (>= 14.0.0)
- PusherClient (>= 2.2.1)
- RandomUserAgent (>= 1.1.2)
- WebSocketSharper (>= 1.0.42)
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.0.2 | 37 | 3/11/2025 | |
1.0.1 | 57 | 3/11/2025 | |
1.0.0 | 200 | 3/6/2025 | |
0.2.1 | 224 | 2/26/2025 | |
0.2.0 | 217 | 2/23/2025 | |
0.2.0-preview4 | 256 | 12/13/2024 | |
0.2.0-preview3 | 121 | 12/1/2024 | |
0.1.14 | 399 | 12/13/2024 | |
0.1.13 | 103 | 12/1/2024 | |
0.1.12 | 307 | 10/6/2024 | |
0.1.11 | 138 | 7/19/2024 | |
0.1.10 | 116 | 7/4/2024 | |
0.1.9 | 151 | 7/1/2024 | |
0.1.8 | 158 | 6/9/2024 | |
0.1.7 | 899 | 11/14/2023 | |
0.1.6 | 144 | 11/9/2023 | |
0.1.5 | 146 | 11/8/2023 | |
0.1.4 | 196 | 9/25/2023 | |
0.1.3 | 146 | 9/21/2023 | |
0.1.2 | 419 | 7/21/2023 | |
0.1.1 | 243 | 7/13/2023 | |
0.1.0 | 168 | 7/13/2023 | |
0.0.6 | 168 | 7/13/2023 | |
0.0.5 | 169 | 7/12/2023 | |
0.0.4 | 192 | 7/12/2023 | |
0.0.3 | 187 | 7/12/2023 | |
0.0.2 | 168 | 7/12/2023 | |
0.0.1 | 171 | 7/11/2023 |
Fixed event subscription methods.