TikTok API SDK for Python
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, videos, comments, sounds and hashtags, search TikTok, 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
- Create a free EulerStream account (no credit card required)
- Copy your API key from the dashboard
- Make your first TikTok API calls:
from TikTokApiSdk import AuthenticatedClient
from TikTokApiSdk.api.tik_tok_users import retrieve_tik_tok_user_basic, retrieve_tik_tok_user_videos
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: a creator's latest videos, newest first
videos = retrieve_tik_tok_user_videos.sync(unique_id="tv_asahi_news", client=c)
print(len(videos.videos))
# 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_profile, retrieve_tik_tok_user_videos, retrieve_tik_tok_user_reposts, retrieve_tik_tok_user_stories, retrieve_tik_tok_user_playlists, retrieve_tik_tok_playlist_videos, retrieve_tik_tok_user_info, plus the users catalog (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_detailed, retrieve_tik_tok_video_comments, retrieve_tik_tok_video_comment_replies, retrieve_tik_tok_video_captions, retrieve_tik_tok_video_thumbnail |
| TikTok search API | api.tik_tok_search |
search_tik_tok_general, search_tik_tok_videos, search_tik_tok_users, search_tik_tok_photos, search_tik_tok_autocomplete |
| TikTok sounds API | api.tik_tok_sounds |
retrieve_tik_tok_sound, retrieve_tik_tok_sound_videos |
| TikTok hashtags API | api.tik_tok_tags |
retrieve_tik_tok_tag_videos |
| TikTok short links | api.tik_tok_links |
resolve_tik_tok_short_link |
| TikTok OAuth | api.tik_tok_oauth |
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 |
| 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, a creator's videos, reposts, stories and playlists, and the users catalog
- Video tools that fetch TikTok video details, comments, replies, captions and thumbnails by ID
- Search and discovery across TikTok videos, users and photos, plus the videos under a hashtag or a sound
- "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.
Links
- Website: eulerstream.com
- TikTok API documentation: eulerstream.com/docs
- OpenAPI reference: eulerstream.com/docs/openapi
- Pricing (free tier available): eulerstream.com/pricing
- Community: Discord
- Source and issues: github.com/EulerStream/TikTok-Api-Sdk
License
MIT © EulerStream
Metadata
Release files for TikTokApiSdk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tiktokapisdk-0.2.0.tar.gz | 213.1 kB | With provenance | Details for tiktokapisdk-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tiktokapisdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for tiktokapisdk-0.2.0-py3-none-any.whl |
Total release size: 1.1 MB
Release files / tiktokapisdk-0.2.0.tar.gz
| Download URL | tiktokapisdk-0.2.0.tar.gz |
|---|---|
| Size | 213.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a1a93e6733b62ceb9c9e7c2d7a4fcbef59b41cde3038d12de221c194924458a
|
|
BLAKE2b-256 checksum How to use checksums |
1204cba2be6d31cf07c65cc52266ef8abf5b4231d3a737f4c04b69d1b9d32dba
|
| 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 12, 2026.
Transparency logRelease files / tiktokapisdk-0.2.0-py3-none-any.whl
| Download URL | tiktokapisdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 915.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60c2e1217e277cde28594ab1b3074b44998e988cae1448edec8ec398a8e7613c
|
|
BLAKE2b-256 checksum How to use checksums |
c8b601c3338c07572f385a60a192bf7e0a0e9a762b501b9f6467f76f214296ae
|
| 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 12, 2026.
Transparency logSecurity for TikTokApiSdk 0.2.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.
Attestation for tiktokapisdk-0.2.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 12, 2026.
Transparency logA 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.