skillfed

TikTokApi

The Unofficial TikTok API Wrapper in Python 3.

tiktokapi v7.3.3 147.0K downloads/30d#11,083 on PyPI6,567
Permissive license MIT Active released

What it is and what it does

TikTokApi is an unofficial Python client for fetching public data from TikTok without requiring user authentication. It uses playwright for browser automation and httpx/requests for HTTP calls to retrieve trending videos, user profiles, and related metadata. The package is designed strictly for data retrieval—it cannot post, upload, or access any authenticated user routes.

The library is async-first, requiring asyncio for most operations. Installation involves both pip and a separate playwright browser setup step. Common friction points include TikTok's bot detection (which may require proxies or valid session tokens) and the need to maintain compatibility as TikTok's internal API structure changes. The package is actively maintained and supports modern Python versions.

Use it for:

  • Fetch and analyze trending TikTok videos for research, trend monitoring, or content discovery
  • Retrieve public user profile data and statistics for influencer analysis or audience research
  • Build a local cache or database of TikTok metadata for offline analysis or reporting
  • Monitor specific TikTok trends or hashtags by periodically scraping public data
  • Integrate TikTok data into a dashboard or analytics tool that does not require user posting

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Unofficial Python wrapper for retrieving public TikTok data—trending videos, user information, and other metadata—without user authentication or posting capabilities.

Yes, if you need to retrieve public TikTok data and can manage the post-install playwright setup and potential bot-detection workarounds. The package is actively maintained, has no known vulnerabilities, and carries a permissive MIT license. Install it if data retrieval is your only goal; do not install if you need to post, upload, or access authenticated user content.

Install

tiktokapi on PyPI

pip

pip install tiktokapi

uv

uv add tiktokapi

poetry

poetry add tiktokapi

Installing TikTokApi

Before you install

Low friction installation with a pure Python wheel, though playwright browser installation is a required post-install step. The package is actively maintained with recent commits and a healthy repository signal.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both personal and commercial projects.

Quickstart

pip install TikTokApi
python -m playwright install

from TikTokApi import TikTokApi
import asyncio

async def get_trending():
    async with TikTokApi() as api:
        await api.create_sessions(ms_tokens=[None], num_sessions=1)
        async for video in api.trending.videos(count=10):
            print(video.as_dict)

asyncio.run(get_trending())

Requires Python 3.9+; playwright browser binaries must be installed via `python -m playwright install` after pip install; TikTok may block requests and require a proxy or valid ms_token from TikTok cookies.

Verify before relying

  • Whether the package reliably handles TikTok's frequent API structure changes without breaking existing code
  • Proxy requirements and success rates for different proxy tiers when facing bot detection
  • Performance and rate-limiting behavior under sustained data retrieval workloads

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 4 — requests, playwright, httpx, proxyproviders
Maintenance actively maintained — 135 days since the last release
Last repo commit
First released
Downloads 147,018/month — #11,083 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: tiktokapi-7.3.3-py3-none-any.whl

Keywords: tiktok, python3, api, unofficial, tiktok-api, tiktok api

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Build Tools

Tags

tiktok data scraping pythonfetch tiktok videos trendingtiktok user info apiunofficial tiktok wrappertiktok public data retrievaltiktok api python clientscrape tiktok metadata
web-scrapingasync-firstsocial-media-api

More Build Tools packages