Skip to main content

TikTok LIVE API SDK for Python

PyPI version PyPI downloads Python versions License: MIT Discord

EulerApiSdk is the official Python client for the EulerStream TikTok LIVE API. Connect to any TikTok LIVE stream by @username and receive real-time chat messages, gifts, likes, follows, shares, viewer counts, room stats and PK battles over a managed WebSocket, plus fully typed sync and async clients for webcast signing, LIVE rooms, gifts, rankings, LIVE alerts, moderation, captchas and analytics.

EulerStream is the managed TikTok LIVE backend behind TikTokLive, the most popular Python library for TikTok LIVE. The connection layer is hosted and maintained for you, so your integration keeps working when TikTok changes its webcast protocol.

Unofficial: this project is not affiliated with, endorsed by, or connected to TikTok or ByteDance.

Installation

pip install EulerApiSdk

Requires Python 3.11+. Built on httpx and attrs; every endpoint has sync, sync_detailed, asyncio and asyncio_detailed variants and ships with full type hints (py.typed).

Quick start

  1. Create a free EulerStream account (no credit card required)
  2. Copy your API key from the dashboard
  3. Make your first calls:
from EulerApiSdk import AuthenticatedClient
from EulerApiSdk.api.tik_tok_users import retrieve_tik_tok_user_basic
from EulerApiSdk.api.tik_tok_live_gifts import list_webcast_gifts
from EulerApiSdk.api.tik_tok_live_rooms import fetch_webcast_url

client = AuthenticatedClient(base_url="https://api.eulerstream.com", token="YOUR_API_KEY")

with client as c:
    # Look up any TikTok user by @username
    user = retrieve_tik_tok_user_basic.sync(unique_id="tv_asahi_news", client=c)
    print(user.user.nickname)

    # Browse the TikTok LIVE gift catalog (names, diamond values, images)
    catalog = list_webcast_gifts.sync(client=c)
    for gift in catalog.gifts:
        print(f"{gift.gift_name} = {gift.diamond_count} diamonds")

    # Fetch the TikTok LIVE WebSocket URL + first payload for a LIVE room (protobuf)
    webcast = fetch_webcast_url.sync_detailed(room_id="7318296342189919018", client=c)
    print(webcast.status_code)

The same calls with asyncio:

import asyncio
from EulerApiSdk import AuthenticatedClient
from EulerApiSdk.api.tik_tok_users import retrieve_tik_tok_user_basic


async def main():
    async with AuthenticatedClient(base_url="https://api.eulerstream.com", token="YOUR_API_KEY") as c:
        user = await retrieve_tik_tok_user_basic.asyncio(unique_id="tv_asahi_news", client=c)
        print(user.user.nickname)


asyncio.run(main())

Business plans can resolve a LIVE room straight from the creator's @username with EulerApiSdk.api.tik_tok_live_anchors.fetch_webcast_url_by_unique_id. AuthenticatedClient sends your key in the X-Api-Key header; use EulerApiSdk.Client for the handful of routes that allow anonymous access.

What you can build

  • Live stream overlays for OBS and browser sources showing TikTok LIVE chat, gifts and top gifters
  • Gift and follow alerts that trigger sounds, animations or webhooks in real time
  • TikTok LIVE games controlled by chat commands or gifts
  • Chatbots and moderation tools that respond to and moderate TikTok LIVE chat
  • Analytics dashboards tracking diamonds, viewer retention and top supporters
  • LIVE monitoring: bulk "is this creator live?" checks and LIVE start/end alerts for thousands of accounts

API coverage

Every path/method in the EulerStream OpenAPI spec becomes a module under EulerApiSdk.api.<group>, so the SDK always matches the live API.

Module TikTok LIVE API group
api.tik_tok_live Core TikTok LIVE: bulk live checks, webcast feed, hashtag lists, rankings
api.tik_tok_live_anchors Creators: webcast URL by @username, room info / ID / cover, gift gallery, earnings, moderators, LIVE analytics
api.tik_tok_live_rooms LIVE rooms: webcast URL by room ID, room info, room gifts, send chat
api.tik_tok_live_events TikTok LIVE event history for a creator
api.tik_tok_live_gifts TikTok LIVE gift catalog: list, search and look up gifts
api.tik_tok_live_rankings Creator leaderboards, rankings and ranking history
api.tik_tok_live_agencies TikTok LIVE agency catalog
api.tik_tok_live_alerts / api.tik_tok_live_alert_targets TikTok LIVE start/end alerts and webhook targets
api.tik_tok_live_moderation Kicks, bans, mutes, sensitive words and comment toggles
api.tik_tok_signing TikTok request signing and payload decryption
api.tik_tok_captchas TikTok captcha solving
api.tik_tok_general TikTok OAuth: token exchange, introspection, revocation, user info
api.tik_tok_users / api.tik_tok_videos TikTok user profiles and videos
api.tik_tok_web_socket_api Your cloud WebSocket connections and their state
api.accounts / api.authentication / api.analytics Your EulerStream account, API keys, JWTs and usage analytics

Per-endpoint Python examples for every operation are in the EulerStream API docs.

Advanced usage

Customize the underlying httpx.Client / httpx.AsyncClient (timeouts, proxies, event hooks) through httpx_args, or replace it entirely:

import httpx
from EulerApiSdk import AuthenticatedClient

client = AuthenticatedClient(
    base_url="https://api.eulerstream.com",
    token="YOUR_API_KEY",
    timeout=httpx.Timeout(30),
    httpx_args={"proxy": "http://localhost:8030"},
)

See the docstrings on Client and AuthenticatedClient for every option, including verify_ssl, raise_on_unexpected_status and follow_redirects.

Other languages

The TikTok LIVE API SDK is also available for Node.js / TypeScript, C# / .NET, Java and Go, and anything else can use the language-agnostic WebSocket directly.

License

MIT © EulerStream

Metadata

Release files for EulerApiSdk 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for EulerApiSdk 0.6.0
File Size Uploaded Provenance Actions
eulerapisdk-0.6.0.tar.gz 185.9 kB Without provenance Details for eulerapisdk-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for EulerApiSdk 0.6.0
File Interpreter ABI Platform Actions
eulerapisdk-0.6.0-py3-none-any.whl Python 3 none any Details for eulerapisdk-0.6.0-py3-none-any.whl

Total release size: 986.9 kB

Release files / eulerapisdk-0.6.0.tar.gz

Download URL eulerapisdk-0.6.0.tar.gz
Size 185.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d1247c5f87c3b8424d9e4108fb5adb768e67c29bb9c5ed99a610fa1848663ae9
BLAKE2b-256 checksum
How to use checksums
9832603d38ee612b3e811a8579d5af9bf52ebd0578c227d1bbb8a943353f7534
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.16 Linux/7.0.0-1017-azure

Release files / eulerapisdk-0.6.0-py3-none-any.whl

Download URL eulerapisdk-0.6.0-py3-none-any.whl
Size 801.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd401d5e74b91d68d054df20507f9a807b45d5ea7a9fbac8d652fad026c0f1cf
BLAKE2b-256 checksum
How to use checksums
52b95e0a6d7473e6771f4888b25af58823c685daf6fae45689e27124d5ca6870
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.16 Linux/7.0.0-1017-azure

Security for EulerApiSdk 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page