Skip to main content

TikTok API SDK for Python

PyPI version PyPI downloads Python versions License: MIT Discord

TikTokApiSdk is the official Python client for the EulerStream TikTok API. Use one typed TikTok API client, sync or async, to look up TikTok users and videos, run TikTok OAuth, sign TikTok web requests and solve TikTok captchas. The complete TikTok LIVE API is included as well, so the same client can read real-time LIVE chat, gifts and viewer counts.

The TikTok API behind this SDK is hosted by EulerStream, the managed TikTok backend behind TikTokLive, the most popular Python library for TikTok LIVE. Request signing, captcha solving and the LIVE connection layer are maintained for you, so your integration keeps working when TikTok changes.

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

Only need TikTok LIVE? TikTokLiveApiSdk is the same client with just the LIVE groups.

Installation

pip install TikTokApiSdk

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).

TikTok API quick start

  1. Create a free EulerStream account (no credit card required)
  2. Copy your API key from the dashboard
  3. Make your first TikTok API calls:
from TikTokApiSdk import AuthenticatedClient
from TikTokApiSdk.api.tik_tok_users import retrieve_tik_tok_user_basic
from TikTokApiSdk.api.tik_tok_videos import retrieve_tik_tok_video_basic
from TikTokApiSdk.api.tik_tok_live import retrieve_hashtag_list

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

with client as c:
    # TikTok users API: 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)

    # TikTok videos API: look up a TikTok video by its ID
    video = retrieve_tik_tok_video_basic.sync(video_id="7318296342189919018", client=c)
    print(video.message)

    # TikTok LIVE API (included): list the hashtags LIVE streams are grouped under
    hashtags = retrieve_hashtag_list.sync(client=c)
    print(hashtags.message)

The same TikTok API calls with asyncio:

import asyncio
from TikTokApiSdk import AuthenticatedClient
from TikTokApiSdk.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())

AuthenticatedClient sends your key in the X-Api-Key header; use TikTokApiSdk.Client for the handful of routes that allow anonymous access.

What the TikTok API covers

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

TikTok API Module Functions
TikTok users API api.tik_tok_users retrieve_tik_tok_user_basic, retrieve_tik_tok_user_info, search_tik_tok_users_catalog, retrieve_tik_tok_users_catalog_username, retrieve_tik_tok_users_catalog_numeric_id
TikTok videos API api.tik_tok_videos retrieve_tik_tok_video_basic, retrieve_tik_tok_video_detailed, retrieve_tik_tok_video_thumbnail
TikTok OAuth api.tik_tok_general exchange_token, introspect_token, revoke_token, validate_refresh_token, get_user_info, get_public_client
TikTok request signing api.tik_tok_signing sign_tik_tok_url, plus decryptors for TikTok's encrypted payloads
TikTok captcha solving api.tik_tok_captchas complete_puzzle_captcha, complete_shapes_captcha, complete_icon_captcha, complete_whirl_captcha, retrieve_captcha_credits
Your account api.accounts / api.authentication / api.analytics Account details, rate limits, API keys, JWTs and usage analytics

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

TikTok LIVE API included

Everything in TikTokLiveApiSdk is part of this package too:

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 LIVE 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 gifts: the gift list, the gift catalog, search and single-gift lookup
api.tik_tok_live_rankings LIVE 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 LIVE kicks, bans, mutes, sensitive words and comment toggles
api.tik_tok_web_socket_api Your cloud WebSocket connections and their state

What you can build with the TikTok API

  • Creator lookups and profile tools backed by TikTok user profiles and the users catalog
  • Video tools that fetch TikTok video details and thumbnails by ID
  • "Sign in with TikTok" flows using the OAuth token, introspection and revocation routes
  • Scrapers and data pipelines that sign TikTok web requests through the API instead of maintaining signature code
  • Captcha handling for your own TikTok automation: puzzle, shapes, icon and whirl solvers
  • Everything TikTok LIVE: stream overlays, gift alerts, chat bots, moderation tools and LIVE monitoring

Advanced usage

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

import httpx
from TikTokApiSdk 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.

Migrating

Coming from EulerApiSdk? This package is the same client with everything it had, under a new name. Install it, then change EulerApiSdk to TikTokApiSdk in your imports. The modules inside keep the names they had in EulerApiSdk 0.6.

pip install TikTokApiSdk

The old package can stay installed while you switch, because the two share no files. Remove it with pip uninstall EulerApiSdk once nothing imports it.

Other languages

The TikTok API SDK is also available for Node.js / TypeScript, C# / .NET, Java and Go, and anything else can call the TikTok API over plain HTTP.

License

MIT © EulerStream

Metadata

Release files for TikTokApiSdk 0.1.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 TikTokApiSdk 0.1.0
File Size Uploaded Provenance Actions
tiktokapisdk-0.1.0.tar.gz 189.8 kB With provenance Details for tiktokapisdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for TikTokApiSdk 0.1.0
File Interpreter ABI Platform Actions
tiktokapisdk-0.1.0-py3-none-any.whl Python 3 none any Details for tiktokapisdk-0.1.0-py3-none-any.whl

Total release size: 992.9 kB

Release files / tiktokapisdk-0.1.0.tar.gz

Download URL tiktokapisdk-0.1.0.tar.gz
Size 189.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f379e50f2623b7d6dcc41a81e4d37b6b6ed0aa0d5266bacc5364b622d24398f3
BLAKE2b-256 checksum
How to use checksums
4355600be0579cf715db5d0203f073584fd80220d4e8550852d129a5071e5504
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / tiktokapisdk-0.1.0-py3-none-any.whl

Download URL tiktokapisdk-0.1.0-py3-none-any.whl
Size 803.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0566769ba5a0b781cd60abeac81110d71622a1c28a0bca852c722c31f97060a
BLAKE2b-256 checksum
How to use checksums
548bebe7366b5032720031397ffcfeecad094ee31e5b706f7fd20136988b59f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for TikTokApiSdk 0.1.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tiktokapisdk-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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