Skip to main content

Async library for Kick.com API and webhooks

Project description

kickcom.py

PyPI

Async library for Kick.com API and webhooks

[!NOTE]
This is in alpha stage, it currently only supports app access tokens. PRs to improve are very welcome!

Find the kick.com API documentation here

Installation

pip install kickcom.py

Client

All endpoints available for app access tokens are available.

from kickpy.client import Client

kick_client = Client("KICK_CLIENT_ID", "KICK_CLIENT_SECRET")

user = await kick_client.fetch_user(4377088)
# Returns:
# User(user_id=4377088, name='KickBot', email='', profile_picture='https://files.kick.com/images/user/4377088/profile_image/conversion/8dde6c21-7008-43d1-b6ac-7d9c34b7d9cc-fullsize.webp')

channel = await kick_client.fetch_channel(4377088)
# Returns:
# Channel(broadcaster_user_id=4377088, slug='kickbot', channel_description='Official bot of https://kickbot.app, the #1 tool for Kick streamers. | VOD Downloader | !clip command | Custom Commands | Timed Messages | Customizable overlays | Stream Deck Plugin |\n\nContact: contact@kickbot.app', banner_picture='https://files.kick.com/images/channel/4295080/banner_image/b0d66fa3-3a4e-45d5-94ea-84d0590990d7', stream=Stream(url='', key='', is_live=False, is_mature=False, language='', start_time='0001-01-01T00:00:00Z', viewer_count=0), stream_title='', category=Category(id=0, name='', thumbnail=''))

Webhook server

Support for receiving webhooks events from Kick is also available.

from kickpy.client import Client
from kickpy.models.webhooks.chat_message import ChatMessage
from kickpy.webhooks.enums import WebhookEvent
from kickpy.webhooks.server import WebhookServer

def on_chat_message(payload: ChatMessage):
    print(payload)


async def main():
    kick_client = Client("KICK_CLIENT_ID", "KICK_CLIENT_SECRET")
    webhook_server = WebhookServer(kick_client, callback_route="KICK_CALLBACK_ROUTE")
    webhook_server.dispatcher.listen(WebhookEvent.CHAT_MESSAGE_SENT, on_chat_message)

    await webhook_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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kickcom_py-0.0.52.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kickcom_py-0.0.52-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file kickcom_py-0.0.52.tar.gz.

File metadata

  • Download URL: kickcom_py-0.0.52.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for kickcom_py-0.0.52.tar.gz
Algorithm Hash digest
SHA256 f3eb034a01cf4102d5eafb4960d5b644ac5b4ceab893f68600fdaad1f5a8571e
MD5 3a81a2e0239da67e083f9b87def0d29e
BLAKE2b-256 a1bd30e8f564726bd1d21b036cc224503b16a98ee214862f8477050487ee6cc9

See more details on using hashes here.

File details

Details for the file kickcom_py-0.0.52-py3-none-any.whl.

File metadata

  • Download URL: kickcom_py-0.0.52-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for kickcom_py-0.0.52-py3-none-any.whl
Algorithm Hash digest
SHA256 d1f01e1522d1337940771ebe348f58115a98b9717f4455c5e32a958a58344541
MD5 d5d54efe18ceb4847f304176cb40d6fb
BLAKE2b-256 793de0c3cfd77c03e4fc4af6d2ba6f1a788d1f25fcbc7b3123c425875a3e8369

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page