Alternative · Open source

TikTokApi alternative: when to switch to a hosted API

David Teather’s TikTokApi is the go-to Python library for public TikTok data. It runs a real browser to do it. Here is what it does well, where it gets hard on a server, and when a hosted API is the simpler choice.

Short answer. TikTokApi is a free, MIT-licensed, unofficial Python wrapper for TikTok’s web API, actively maintained (7.3.6 shipped on 28 November 2026). It reads public data: profiles, videos, comments, trending, hashtags, sounds and search. To do that it drives a headless browser through Playwright and works best with an ms_token from your TikTok cookies. When TikTok spots automation you get EmptyResponseException, and the README suggests proxies.

For scripts and research, keep TikTokApi. For a product that needs answers every time, a hosted API removes the browser, tokens and proxies: HandleHaul returns TikTok and Instagram data as JSON at $1.40 to $0.80 per 1,000 calls.

Facts checked 2 December 2026. Prices change: follow the links before you decide.

TikTokApi 7.3.6 (28 November 2026) · MIT licence · about 6.8k GitHub stars (December 2026) · by David Teather and contributors · Python 3.9+, async. Sources: GitHub · PyPI · docs, read 2026-12-02.

What TikTokApi does well

  • Trending and discovery. api.trending.videos() reads the trending feed, and there are hashtag, sound and search helpers. HandleHaul has hashtags, sounds and search but no trending feed, so for “what is trending right now” TikTokApi does more.
  • Video bytes. video.bytes() downloads the video file itself. HandleHaul returns a play_url and a cover URL; you fetch the file.
  • Free, open and well known. MIT licence, around since 2019, a Discord server and an examples folder. The README is upfront that it cannot post and has no logged-in routes: if you cannot see it logged out on tiktok.com, it cannot either.
  • Raw data. Every object keeps TikTok’s full dictionary in .as_dict, so you can reach any field TikTok sends.

Where TikTokApi hurts in production

  • A browser in production. Install means pip install TikTokApi and python -m playwright install. Each session is a headless Chromium, so servers need the browser, its memory and its CPU, and Docker images built on Playwright’s base.
  • ms_token housekeeping. The examples read an ms_token from your tiktok.com cookies. Without one the library tries to pick one up and logs a warning if it fails. Tokens are something to refresh and rotate.
  • Bot detection. The README’s first common issue is EmptyResponseException, meaning TikTok is blocking the request as a bot. The suggested fix is a proxy, and the author notes that old issues come back because TikTok changes things.
  • Shapes that move. The README says TikTok changes its structure from time to time and advises checking the dictionary you get. Your parsing code owns that risk.
  • No follower lists. The user object reads info, videos, playlists and liked videos; there is no followers or following method. HandleHaul returns both lists, about 30 accounts per page.

TikTokApi vs a hosted API

TikTokApi compared with HandleHaul, by requirement
RequirementTikTokApiHandleHaul
TikTok login neededNo (logged-out data only)No, an API key only
Browser or tokensPlaywright Chromium; ms_token recommendedNone
ProxiesOften needed against bot detectionNot needed
Rate limitsWhatever TikTok tolerates from your IPs10 to 30 requests per second by tier
Private accountsNoNo, public only (the call is free)
PostingNoNo
Trending feedYesNo
Followers and following listsNoYes, about 30 per page
TranscriptsNoYes, from auto-captions
Instagram tooNo (TikTok only)Yes, same key
CostFree licence; you pay for servers, proxies, upkeep$1.40 to $0.80 per 1,000 calls
OutputAsync Python objects + raw dictsStable JSON fields, any language

Same job, both ways

A profile and its latest 30 videos, for @nasa. TikTokApi opens a browser session; HandleHaul is two plain HTTP calls.

TikTokApi
import asyncio, os
from TikTokApi import TikTokApi

ms_token = os.environ.get("ms_token")  # from your tiktok.com cookies

async def main():
    async with TikTokApi() as api:
        await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3)
        user = api.user("nasa")
        info = await user.info()
        async for video in user.videos(count=30):
            print(video.id, video.stats)

asyncio.run(main())
Adapted from the repository’s user_example.py. Needs python -m playwright install first.
import os, requests

url = "https://api.handlehaul.com/v1/tiktok/users/nasa/posts"
headers = {"X-Api-Key": os.environ["HANDLEHAUL_API_KEY"]}
params, rows = {}, []
for _ in range(2):
    body = requests.get(url, headers=headers, params=params, timeout=60).json()
    rows += body["data"]
    if not body["pagination"]["has_more"]:
        break
    params["cursor"] = body["pagination"]["next_cursor"]
print(len(rows), "rows")
HandleHaul: key in HANDLEHAUL_API_KEY, 1 credit per successful call (about 16 videos per page). Naming an account by a handle we have not looked up in the last 7 days adds 1 lookup credit; send the numeric id from any result to skip it.

For the profile itself, /v1/tiktok/users/nasa returns exact counts and the sec_uid to send to every list endpoint. See the TikTok video API and profile API.

Running it yourself vs paying per call

TikTokApi is free to install. A production setup has costs that depend on volume and on how hard TikTok pushes back that month:

  • Servers sized for headless Chromium sessions rather than plain HTTP calls.
  • Proxies, often residential, once datacenter IPs start returning empty responses.
  • Token refresh, retries and monitoring so a blocked session does not become an outage.
  • Engineer time when TikTok changes its web app and the library or your parser needs an update.

We will not guess those numbers for you. HandleHaul’s side is plain arithmetic:

HandleHaul cost per job
JobCallsHandleHaul cost
One profile1$0.00080 to $0.00140
30 latest videos (about 16 per page)2$0.00160 to $0.00280
1,000 followers (about 30 per page)34$0.027 to $0.048
1,000 comments (about 20 per page)50$0.040 to $0.070

1 credit per successful call; failed calls, private accounts and cache hits are free. Page sizes are approximate, so treat list counts as estimates. Naming an account by a handle we have not looked up in the last 7 days adds 1 lookup credit; send the numeric id from any result to skip it. See pricing.

When to keep using TikTokApi

  • You need the trending feed or the video files themselves.
  • It is a notebook, a one-off study or a hobby project where an empty response means trying again later.
  • You already run browsers and proxies for other scrapers.
  • You want every raw field TikTok sends and are happy to track its changes.

Mixing is fine: TikTokApi for trending discovery, an API for the profile, video, comment and follower data your app reads every day.

Migrating from TikTokApi: field map

TikTokApi hands you TikTok’s own dictionaries (keys may change). Below, u = info["userInfo"]["user"] from info = await user.info(), and where the common keys land in the /v1/tiktok/users/{user} and /v1/tiktok/posts/{post} responses.

TikTokApi attributes mapped to HandleHaul response fields
TikTokApiHandleHaulNote
u["id"]data.idprofile
u["secUid"]data.sec_uidprofile
u["uniqueId"]data.handleprofile
u["nickname"]data.nicknameprofile
u["signature"]data.bioprofile
u["verified"]data.is_verifiedprofile
video.iddata.idpost
video.as_dict["desc"]data.captionpost
video.create_timedata.created_atISO 8601 string, not datetime
video.stats["playCount"]data.counts.viewspost
video.stats["diggCount"]data.counts.likespost
video.stats["commentCount"]data.counts.commentspost
video.stats["shareCount"]data.counts.sharespost
video.hashtagsdata.hashtagsplain strings
video.sounddata.musicobject with title, artist
video.authordata.authorobject with counts

Profile counts (data.counts.followers, following, likes, videos) are exact on the profile call; the copies inside post lists are rounded by TikTok on big accounts. raw=true returns TikTok’s own JSON at the same price if you depend on a field we do not map.

Full fields and errors: TikTok profile API docs, TikTok post API docs, TikTok posts API docs.

TikTokApi alternative: questions

Is TikTokApi official?
No. It is an unofficial, open-source wrapper by David Teather, not affiliated with TikTok. For what TikTok’s official APIs offer and who can use them, see our TikTok API guide.
How do I fix EmptyResponseException in TikTokApi?
The README says it means TikTok detected a bot. Its suggestions: check your setup, pass an ms_token, and use a proxy. Running fewer sessions from one IP also helps. If it keeps happening in production, that is the signal to consider a hosted API.
Does TikTokApi need a TikTok account?
No. It has no logged-in routes. It does need Playwright browsers installed and works best with an ms_token, which the README says to take from your cookies on tiktok.com.
Can I get TikTok followers with Python?
Not with TikTokApi; it has no followers method. With HandleHaul, call /v1/tiktok/users/{user}/followers from Python (pip install handlehaul or requests): about 30 accounts per page with a cursor.
Do I need Playwright with HandleHaul?
No. It is a plain HTTPS API: no browser, no tokens, no proxies. Any language that can send a GET request works.
Which is better for a TikTok scraper in Python?
For learning and small jobs, TikTokApi: it is free and you see how it works. For an app that needs steady answers, a hosted API costs per call but takes the browsers, tokens and blocks off your hands.

Public Instagram and TikTok data, one API key

No accounts, proxies or browsers to run. $1.40 to $0.80 per 1,000 calls.

Want to test first? Sandbox keys are free and unlimited, with sample data in the live schema.