--- id: tiktokapi version: "7.3.3" license: MIT license_treatment: permissive maintenance: active --- # TikTokApi — The Unofficial TikTok API Wrapper in Python 3. License: permissive · Maintenance: active · Downloads: 147.0K/mo ## 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 above — 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 pip install tiktokapi uv add tiktokapi 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_current - Install friction: low - Maintenance: active - Downloads: 147.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags tiktok data scraping python, fetch tiktok videos trending, tiktok user info api, unofficial tiktok wrapper, tiktok public data retrieval, tiktok api python client, scrape tiktok metadata, web-scraping, async-first, social-media-api [View on SkillFed](https://skillfed.io/packages/tiktokapi) · [View on PyPI](https://pypi.org/project/tiktokapi/)