Make money on TikTok LIVE in 2026 by tapping into the easiest psychological trick in streaming: Gamification.
When viewers see that the "Top Gifter" gets their actual profile picture displayed dynamically on the screen, they will spend massive amounts of coins to claim that spot. Giving your biggest fans public recognition is exactly how the top creators make thousands a day.
Here is a super easy Python script for absolute beginners. It connects to the stream via WebSocket and constantly grabs the profile picture URL of whoever sends the biggest gift.
Step 1: Install Python (Crucial Step for Beginners)
-
Windows (PC):
Go to python.org and download the installer. CRITICAL STEP: On the very first screen of the installer, look at the bottom and check the box that says "Add python.exe to PATH" before clicking Install. If you forget this, your computer won't know how to run the code. Once installed, open your Start Menu, type
cmd, right-click Command Prompt, and click Run as Administrator. -
Mac:
Macs come with Python, but it's best to get the latest one. Download the macOS installer from python.org and click through it. Open your Terminal (
Cmd + Space-> Terminal). On Mac, you will typepython3instead ofpythonin your terminal.
Step 2: Install WebSockets
In your terminal, you need to install the WebSocket library to talk to the real-time server. Type this and hit Enter:
pip install websockets asyncio
(Mac users: if that throws an error, type pip3 install websockets asyncio)
Step 3: The Code
Create a file on your Desktop called overlay.py and paste this inside:
Python
import asyncio
import websockets
import json
# Change to whoever is live right now
USERNAME = "tiktok"
async def track_top_gifter():
# The backbone WebSocket connection for real-time events
url = f"wss://api.tik.tools/events?uniqueId={USERNAME}&apiKey=TEST_KEY"
top_gifter = {"username": None, "coins": 0}
print(f"📡 Connecting to @{USERNAME}...")
try:
async with websockets.connect(url) as ws:
while True:
message = await ws.recv()
event = json.loads(message)
if event.get('type') == 'gift':
sender = event['user']['uniqueId']
coins = event['diamondCount']
avatar = event['user']['profilePictureUrl']
if coins > top_gifter["coins"]:
top_gifter["coins"] = coins
top_gifter["username"] = sender
print(f"👑 NEW TOP GIFTER: {sender} ({coins} coins)")
print(f"🖼️ IMAGE URL FOR OBS: {avatar}\n")
except Exception as e:
print("\n❌ Connection closed. Read the server logs to see what access you are missing:")
print(e)
if __name__ == "__main__":
asyncio.run(track_top_gifter())
To run it:
Type cd Desktop in your terminal, then type python overlay.py (or python3 overlay.py on Mac). You can tie these outputted image URLs directly into an OBS browser source.
Watch the gift battles begin!
Top comments (0)