Getting Started¶
Installation¶
Optional speed extras (orjson, aiodns, Brotli):
Setup¶
Before using the library, you need a Kick developer application:
- Create a Kick account and enable 2FA
- Go to Account Settings > Developer tab
- Create an app to get your Client ID and Client Secret
First API Call¶
import asyncio
from kickpy import KickClient
async def main():
client = KickClient("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
# Fetch a user by ID
user = await client.fetch_user(4377088)
print(f"Name: {user.name}")
print(f"Profile: {user.profile_picture}")
# Fetch a channel by slug
channel = await client.fetch_channel(slug="kickbot")
print(f"Title: {channel.stream_title}")
print(f"Live: {channel.stream.is_live}")
# Search categories
categories = await client.fetch_categories(query="Gaming")
for cat in categories:
print(f"{cat.name} ({cat.id})")
# Get live streams
streams = await client.fetch_livestreams(limit=5)
for stream in streams:
print(f"{stream.slug}: {stream.viewer_count} viewers")
await client.close()
asyncio.run(main())
Note
KickClient uses app access tokens by default (client credentials flow). This gives you read-only access to public data. For write operations (chat, moderation, rewards), you need a user token.
Context Manager¶
You can also use KickClient without manually calling close():