Skip to content

🛡️ Unofficial Kick.com API wrapper with automatic bypass protection.

License

Notifications You must be signed in to change notification settings

sarperavci/kick-unofficial-api

Repository files navigation

Kick.com Unofficial API

An unofficial API wrapper for Kick.com that handles Cloudflare protection automatically. This project provides a FastAPI-based REST API that mirrors Kick.com's API endpoints while managing Cloudflare bypass seamlessly.

Quick Start

Try it out before you deploy it: https://kickapi.hackmap.win/docs

Features

  • 🛡️ Automatic Cloudflare protection bypass
  • 🔄 Session token authentication support
  • 🚀 FastAPI-powered REST API
  • 📝 Comprehensive endpoint documentation
  • 🔍 Error handling and logging
  • ⚡ Efficient request retrying and caching

Prerequisites

  • Python 3.8+
  • Docker (optional, for containerized deployment)
  • FastAPI
  • curl-cffi

Installation

Option 1: Direct Installation

  1. Clone the repository:
git clone https://github.com/sarperavci/kick-unofficial-api.git
cd kick-unofficial-api
  1. Install dependencies:
pip install -r requirements.txt
  1. Deploy the Cloudflare bypass server:
docker run -d -p 8000:8000 ghcr.io/sarperavci/cloudflarebypassforscraping:latest
  1. Run the API server:
python src/api.py

Option 2: Docker Deployment

  1. First, deploy the Cloudflare bypass server:
docker run -d -p 8000:8000 ghcr.io/sarperavci/cloudflarebypassforscraping:latest
  1. Then, deploy the API server:
docker run -d -p 5000:5000 \
  -e BYPASS_SERVER_URL=http://host.docker.internal \
  -e BYPASS_SERVER_PORT=8000 \
  -e TARGET_URL=https://kick.com \
  ghcr.io/sarperavci/kick-unofficial-api:latest

Note: Use host.docker.internal to connect to the bypass server running on your host machine.

Option 3: Docker Compose

Run:

docker-compose up -d

Configuration

The API configuration is managed through environment variables:

Variable Description Default
BYPASS_SERVER_URL Cloudflare bypass server URL http://localhost
BYPASS_SERVER_PORT Bypass server port 8000
TARGET_URL Target API base URL https://kick.com

API Documentation

Once running, access the Swagger UI documentation at:

  • Local deployment: http://localhost:5000/docs
  • Docker deployment: http://your-server:5000/docs

Authentication

For endpoints requiring authentication, include your Kick.com session token in the Authorization header:

curl -H "Authorization: Bearer your-session-token" http://localhost:5000/api/v2/...

Available Endpoints

API Endpoint Discovery

The project includes a mitmproxy script (misc/endpoint_discovery.py) for discovering new Kick.com API endpoints:

  1. Install mitmproxy requirements:
pip install -r misc/requirements.txt
  1. Run mitmproxy with the discovery script:
mitmproxy -s misc/endpoint_discovery.py

The script will automatically capture and document API requests/responses in the api_docs directory.

Development

Building the Docker Image

docker build -t kick-unofficial-api .

Contributing

Contributions are welcome! Please feel free to submit a PR. Endpoints are not complete yet.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Disclaimer

This project is not affiliated with or endorsed by Kick.com. Use responsibly and in accordance with Kick.com's terms of service.