
Track TikTok LIVE Gifts in Real-Time with Python
TikTok LIVE gifts are a massive economy — creators earn real money from virtual gifts. Here's how to track every gift on any live stream with Python, building a real-time diamond leaderboard. I tested this on a live stream just now. Real output included below. Install pip install tiktok-live-api Get your free API key at tik.tools (no credit card required). The Code # gift-tracker.py — run with: python gift-tracker.py from tiktok_live_api import TikTokLive client = TikTokLive ( " USERNAME_HERE " , api_key = " YOUR_API_KEY " ) gifts = {} total_diamonds = 0 @client.on ( " connected " ) def on_connected ( event ): print ( f " ✅ Connected to @ { event [ ' uniqueId ' ] } " ) @client.on ( " gift " ) def on_gift ( event ): global total_diamonds user = event [ " user " ][ " uniqueId " ] name = event [ " giftName " ] diamonds = event . get ( " diamondCount " , 0 ) count = event . get ( " repeatCount " , 1 ) total_value = diamonds * count total_diamonds += total_value gifts [ user ] = gifts . get
Continue reading on Dev.to Tutorial
Opens in a new tab



