kick-api
Rust client for the Kick.com API.
Covers channels, users, chat, moderation, rewards, livestreams, event subscriptions, and live chat over WebSocket. Handles OAuth 2.1 (PKCE + Client Credentials) authentication and automatic retry on rate limits (429).
Installation
[]
= "0.1"
= { = "1", = ["full"] }
Quick Start: Live Chat
Read live chat messages from any channel in real time — no authentication required.
use LiveChatClient;
async
You can also connect directly by chatroom ID if you already know it:
let mut chat = connect.await?;
Use next_event() instead of next_message() to receive all Pusher events (subscriptions, bans, polls, etc.).
Requirements
connect_by_username requires curl to be available on the system PATH. This is pre-installed on Windows 10+, macOS, and virtually all Linux distributions. If you prefer not to depend on curl, use connect(chatroom_id) with a known chatroom ID instead.
REST API (Authenticated)
All REST endpoints require an OAuth token. See Authentication below.
use KickApiClient;
async
Unofficial API
⚠️ These features use Kick's internal v2 API, not the public API. They are reverse-engineered and may break without notice.
Some functionality isn't available through Kick's official public API, so this crate provides access to internal endpoints using curl (to bypass Cloudflare TLS fingerprinting).
Channel Info (no auth)
use fetch_channel_info;
async
Followed Channels (requires session token)
Fetch the channels the authenticated user follows. This requires a session/bearer token from your browser cookies — not an OAuth App Access Token.
use fetch_followed_channels;
async
How to get a session token
- Log in to kick.com in your browser
- Open Developer Tools → Application → Cookies
- Copy the value of
session_token(or theauthorizationheader from a network request)
API Coverage
Official API (api.kick.com/public/v1)
| Module | Methods | Auth |
|---|---|---|
| Channels | get, get_mine, update |
OAuth token |
| Livestreams | get, stats |
OAuth token |
| Users | get, get_me, introspect_token |
OAuth token |
| Chat | send_message, delete_message |
OAuth token |
| Moderation | ban, unban |
OAuth token |
| Rewards | get_all, create, update, delete, manage_redemptions |
OAuth token |
| Events | list, subscribe, unsubscribe |
OAuth token |
Unofficial API (kick.com/api/v2)
| Function | Auth | Description |
|---|---|---|
LiveChatClient |
None | Real-time chat messages via Pusher WebSocket |
fetch_channel_info |
None | Chatroom settings, subscriber badges, livestream status |
fetch_followed_channels |
Session token | Channels the authenticated user follows |
OAuth Scopes
| Scope | Used By |
|---|---|
channel:read |
channels().get(), channels().get_mine(), livestreams().get(), livestreams().stats() |
channel:write |
channels().update() |
user:read |
users().get(), users().get_me(), users().introspect_token() |
chat:write |
chat().send_message() |
moderation:chat_message:manage |
chat().delete_message() |
moderation:ban |
moderation().ban(), moderation().unban() |
channel:rewards:read |
rewards().get_all() |
channel:rewards:write |
rewards().create(), rewards().update(), rewards().delete(), rewards().manage_redemptions() |
events:subscribe |
events().list(), events().subscribe(), events().unsubscribe() |
Authentication
Kick uses OAuth 2.1 with PKCE. You'll need a Kick Developer App to get your client ID and secret.
use ;
async
App Access Token (Server-to-Server)
For server-to-server access without user interaction:
use ;
async
Token Refresh
let new_token = oauth.refresh_token.await?;
Token Revocation
oauth.revoke_token.await?;
Examples
Run the included examples:
# Read live chat (no auth needed)
# Get channel info (requires KICK_TOKEN env var)
KICK_TOKEN=your_token
Testing
# Unit tests (fast, no network)
# Integration tests (connects to real Kick WebSocket)
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.
Disclaimer
Unofficial library, not affiliated with Kick.com.