kickcom.py
Async library for Kick.com API and webhooks
Documentation | Kick API Reference
Installation
pip install kickcom.py
Optional speed extras:
pip install kickcom.py[speed]
Quick Start
App Access Token (Bot / Server-side)
import asyncio
from kickpy import KickClient
async def main():
client = KickClient("KICK_CLIENT_ID", "KICK_CLIENT_SECRET")
user = await client.fetch_user(4377088)
print(user.name)
channel = await client.fetch_channel(slug="kickbot")
print(channel.stream_title)
await client.close()
asyncio.run(main())
User Access Token (OAuth 2.1 + PKCE)
Some endpoints require a user token. The library handles the full OAuth flow with a built-in local callback server:
import asyncio
from kickpy import KickClient, Scope
async def main():
client = KickClient("KICK_CLIENT_ID", "KICK_CLIENT_SECRET")
# Opens browser, captures callback on localhost, exchanges code for tokens
await client.authenticate(
scopes=[Scope.CHAT_WRITE, Scope.MODERATION_BAN],
port=3000, # redirect URI must be http://127.0.0.1:3000/callback in your Kick app settings
)
# User token endpoints are now available
await client.send_chat_message("Hello from kickcom.py!", broadcaster_user_id=4377088)
await client.close()
asyncio.run(main())
If you handle OAuth externally, you can inject tokens directly:
client.set_user_token(
access_token="...",
refresh_token="...",
expires_in=3600,
scope="chat:write moderation:ban",
)
API Reference
Users
| Method | Description | Token |
|---|---|---|
fetch_user(user_id) |
Get a user by ID | App |
Channels
| Method | Description | Token |
|---|---|---|
fetch_channel(user_id?, slug?) |
Get a channel by broadcaster ID or slug | App |
update_channel(category_id?, stream_title?, custom_tags?) |
Update channel metadata | User (channel:write) |
Livestreams
| Method | Description | Token |
|---|---|---|
fetch_livestream(broadcaster_user_id) |
Get a single livestream | App |
fetch_livestreams(broadcaster_user_id?, category_id?, language?, limit?, sort?) |
Get multiple livestreams | App |
fetch_livestream_stats() |
Get global livestream stats | App |
Categories
| Method | Description | Token |
|---|---|---|
fetch_categories(query?, name?, tag?, category_id?, cursor?, limit?) |
Search categories (v2) | App |
Chat
| Method | Description | Token |
|---|---|---|
send_chat_message(content, message_type?, broadcaster_user_id?, reply_to_message_id?) |
Send a chat message | User (chat:write) |
delete_chat_message(message_id) |
Delete a chat message | User (moderation:chat_message:manage) |
Moderation
| Method | Description | Token |
|---|---|---|
ban_user(broadcaster_user_id, user_id, duration?, reason?) |
Ban or timeout a user | User (moderation:ban) |
unban_user(broadcaster_user_id, user_id) |
Unban a user | User (moderation:ban) |
Channel Rewards
| Method | Description | Token |
|---|---|---|
fetch_channel_rewards() |
List channel point rewards | User (channel:rewards:read) |
create_channel_reward(cost, title, ...) |
Create a reward | User (channel:rewards:write) |
update_channel_reward(reward_id, ...) |
Update a reward | User (channel:rewards:write) |
delete_channel_reward(reward_id) |
Delete a reward | User (channel:rewards:write) |
fetch_reward_redemptions(reward_id?, status?, ids?, cursor?) |
Get redemptions | User (channel:rewards:read) |
accept_reward_redemptions(ids) |
Accept pending redemptions | User (channel:rewards:write) |
reject_reward_redemptions(ids) |
Reject pending redemptions | User (channel:rewards:write) |
KICKs
| Method | Description | Token |
|---|---|---|
fetch_kicks_leaderboard(top?) |
Get KICKs leaderboard | User (kicks:read) |
Events / Subscriptions
| Method | Description | Token |
|---|---|---|
fetch_events_subscriptions() |
List event subscriptions | App |
subscribe_to_event(event_type, user_id) |
Subscribe to a webhook event | App |
unsubscribe_from_event(subscription_id) |
Unsubscribe from an event | App |
Other
| Method | Description | Token |
|---|---|---|
fetch_public_key() |
Get the Kick public key for webhook verification | App |
OAuth Scopes
from kickpy import Scope
Scope.USER_READ # user:read
Scope.CHANNEL_READ # channel:read
Scope.CHANNEL_WRITE # channel:write
Scope.CHANNEL_REWARDS_READ # channel:rewards:read
Scope.CHANNEL_REWARDS_WRITE # channel:rewards:write
Scope.CHAT_WRITE # chat:write
Scope.STREAMKEY_READ # streamkey:read
Scope.EVENTS_SUBSCRIBE # events:subscribe
Scope.MODERATION_BAN # moderation:ban
Scope.MODERATION_CHAT_MESSAGE_MANAGE # moderation:chat_message:manage
Scope.KICKS_READ # kicks:read
Webhook Server
Receive and process webhook events from Kick:
import asyncio
from kickpy import KickClient, WebhookEvent, WebhookServer
from kickpy.models.webhooks.chat_message import ChatMessage
def on_chat_message(payload: ChatMessage):
print(f"{payload.sender.username}: {payload.content}")
async def main():
client = KickClient("KICK_CLIENT_ID", "KICK_CLIENT_SECRET")
server = WebhookServer(client, callback_route="/webhooks/kick")
server.dispatcher.listen(WebhookEvent.CHAT_MESSAGE_SENT, on_chat_message)
await server.listen(host="localhost", port=3000, access_log=None)
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(main())
loop.run_forever()
Webhook Events
| Event | Enum |
|---|---|
chat.message.sent |
WebhookEvent.CHAT_MESSAGE_SENT |
channel.followed |
WebhookEvent.CHANNEL_FOLLOWED |
channel.subscription.new |
WebhookEvent.CHANNEL_SUB_NEW |
channel.subscription.gifts |
WebhookEvent.CHANNEL_SUB_GIFTS |
channel.subscription.renewal |
WebhookEvent.CHANNEL_SUB_RENEWAL |
livestream.status.updated |
WebhookEvent.LIVESTREAM_STATUS_UPDATED |
livestream.metadata.updated |
WebhookEvent.LIVESTREAM_METADATA_UPDATED |
channel.moderation.user_banned |
WebhookEvent.MODERATION_USER_BANNED |
kicks.gifted |
WebhookEvent.KICKS_GIFTED |
channel.reward.redemption.updated |
WebhookEvent.CHANNEL_REWARD_REDEMPTION_UPDATED |
Metadata
Release files for kickcom.py 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kickcom_py-1.0.0.tar.gz | 28.2 kB | Without provenance | Details for kickcom_py-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kickcom_py-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for kickcom_py-1.0.0-py3-none-any.whl |
Total release size: 56.9 kB
Release files / kickcom_py-1.0.0.tar.gz
| Download URL | kickcom_py-1.0.0.tar.gz |
|---|---|
| Size | 28.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8cd0a536f6d83d1380c92be4a9e55093ef8410018fc6a690e87566604a0c4c84
|
|
BLAKE2b-256 checksum How to use checksums |
840c396076bdec4e3e0fbe7963d61b6e2e7edc051e67adddcd5c3d896358a356
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.4
|
Release files / kickcom_py-1.0.0-py3-none-any.whl
| Download URL | kickcom_py-1.0.0-py3-none-any.whl |
|---|---|
| Size | 28.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f3e68ea0a14da1338f05692a03a3a1ed889c08734d289a176c2ba14ca4ffcef8
|
|
BLAKE2b-256 checksum How to use checksums |
9ddea9b8a14a4518483a394bab1ff3c629c88853084b7a92c6ff06cc71e841d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.4
|
Security for kickcom.py 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.