# TikTokApi Alternative: TikTok Data in Python Without Playwright

> Setting SocialTap up for your user? Follow https://socialtap.dev/setup.md.

[Home](https://socialtap.dev/index.md) · [Guides](https://socialtap.dev/guides/index.md)TikTokApi

Guide · Python · Updated Nov 28, 2026

TikTokApi needs a headless browser, an ms_token from your own TikTok cookies and usually a proxy, and it still breaks when TikTok changes its signatures. Here is the same data from one request.

[Start for free](https://socialtap.dev/signup/) · [Code on GitHub](https://github.com/SocialTapDev/tiktokapi-alternative/tree/main/python) · [Node.js version](https://socialtap.dev/guides/tiktok-scraper-alternative/index.md)

[TikTokApi](https://github.com/davidteather/TikTok-Api) is the most popular way to read TikTok from Python. It drives a real browser with Playwright to sign each request, so it needs three things to work: Playwright and a browser, an `ms_token` copied from your own tiktok.com cookies, and in practice a proxy. When TikTok changes how it signs requests, every script that depends on it stops at once.

This guide shows the same calls with SocialTap: a profile, an account's videos, a video's comments and a hashtag's videos, in plain Python, with no browser and no cookies.

## Why TikTokApi keeps breaking

TikTok's web app signs its requests, and TikTokApi copies what the browser sends. When TikTok adds a new signature, requests come back empty until the library catches up:

- [Issue #1311](https://github.com/davidteather/TikTok-Api/issues/1311), "200 empty body response for user-level queries", open since July 2026: TikTok now expects an `X-Gnarly` signature the library doesn't send.
- [Issue #1242](https://github.com/davidteather/TikTok-Api/issues/1242): `EmptyResponseException`, "They are detecting you're a bot".
- [Issue #1248](https://github.com/davidteather/TikTok-Api/issues/1248): "Can't get Videos in HashTag".

A typical TikTokApi script looks like this, with the token from your browser and a session per request:

Python:

```python
from TikTokApi import TikTokApi
import asyncio, os

ms_token = os.environ.get("ms_token")

async def user_videos():
    async with TikTokApi() as api:
        await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3)
        async for video in api.user("therock").videos(count=30):
            print(video.as_dict)

asyncio.run(user_videos())
```

Each piece of that is something you maintain: the browser install, the token that expires, the proxy, the retries when a session gets flagged.

## The same data with one API key

SocialTap reads TikTok for you and returns live data in one schema. We handle the proxies, blocks and platform changes. Install the SDK:

Install:

```shell
pip install socialtap
```

Get a key on the [signup page](https://socialtap.dev/signup/), then set it as `SOCIALTAP_API_KEY`. Every account starts with 100 free credits. This reads one profile:

Python SDK:

```python
from socialtap import SocialTap

client = SocialTap()  # api_key defaults to os.environ["SOCIALTAP_API_KEY"]

res = client.tiktok.profile.get(handle="nasa")
print(res.data)
print(res.credits.charged, res.meta.request_id)
```

The answer has the account's exact follower count when TikTok shows it, the bio, links, verification and video count, under the same field names SocialTap uses for every platform.

## Walk an account's videos, page by page

TikTokApi's `user.videos()` becomes `client.tiktok.posts.iterate()`. It pages through the account's videos for you, up to 15 a page, and stops at the guard you set, so a loop can't spend more than you meant. It also catches what TikTok can answer about an account: one that doesn't exist, and one that is private.

Python SDK:

```python
from socialtap import SocialTap, APIError, NotFoundError, PrivateOrUnavailableError

client = SocialTap()  # api_key defaults to os.environ["SOCIALTAP_API_KEY"]

try:
    # Stops at the end of the list, or at the first guard it reaches.
    items = client.tiktok.posts.iterate(handle="@khaby.lame", max_pages=10, max_credits=100)
    for item in items:
        print(item)
    print(items.pages_fetched, items.credits_charged, items.stop_reason, items.end_reason)
except NotFoundError as err:
    # The item does not exist or was deleted.
    print(err.code, err.remediation)
except PrivateOrUnavailableError as err:
    # The item exists but isn't public: it is private, age- or region-restricted, or needs a login.
    print(err.code, err.remediation)
except APIError as err:
    # Retryable errors reach you only after the SDK's own retries. Failed requests cost no credits.
    print(err.code, err.status, err.retryable, err.remediation, err.request_id)
```

Each video has its caption, hashtags, publish time, duration, thumbnail and its view, like, comment, share and save counts. TikTok rounds large counts on some pages, and `approximate_fields` lists which ones were rounded, so you never store a rounded number as exact.

## From TikTokApi to SocialTap

| TikTokApi | SocialTap | Endpoint |
| --- | --- | --- |
| `api.user(name).info()` | `client.tiktok.profile.get()` | [TikTok Profile API](https://socialtap.dev/apis/tiktok/profile/index.md) |
| `api.user(name).videos()` | `client.tiktok.posts.iterate()` | [TikTok Posts API](https://socialtap.dev/apis/tiktok/posts/index.md) |
| `api.video(url=...).info()` | `client.tiktok.post.get()` | [TikTok Post API](https://socialtap.dev/apis/tiktok/post/index.md) |
| `video.comments()` | `client.tiktok.comments.iterate()` | [TikTok Comments API](https://socialtap.dev/apis/tiktok/comments/index.md) |
| `api.hashtag(name).videos()` | `client.tiktok.hashtag_posts.iterate()` | [TikTok Hashtag Posts API](https://socialtap.dev/apis/tiktok/hashtag-posts/index.md) |
| `video.bytes()` | `client.tiktok.download.get()` | [TikTok Download API](https://socialtap.dev/apis/tiktok/download/index.md) |

The SDK has no async session pool to manage: each call is one HTTPS request, retried for you when TikTok blocks it. An async client, `AsyncSocialTap`, has the same methods for `asyncio` code.

## What it costs

You pay per successful request, and a list request returns a whole page:

- Videos of an account: $0.05–$0.13 per 1,000 posts.
- Comments: $0.01–$0.04 per 1,000 comments.
- Profiles: $0.75–$1.97 per 1,000 profiles.

Failed requests and cache hits cost nothing. [Plans and packs](https://socialtap.dev/pricing/index.md) start small, and credits from a pack never expire.

## Frequently asked questions

### Is TikTokApi still working in 2026?

Partly. The library is maintained, but user-level queries have returned empty bodies since TikTok added a new request signature ([issue #1311](https://github.com/davidteather/TikTok-Api/issues/1311)), and it still needs a browser, an ms_token and usually a proxy.

### Do I need an ms_token or TikTok cookies?

No. SocialTap reads TikTok logged out, with its own sessions and proxies. You send a handle, a link or a search, with your SocialTap API key.

### Can I download TikTok videos without the watermark?

Yes. The TikTok Download API returns the video's file links, and the TikTok Posts API returns each video's details. TikTok serves its video files only with a cookie, so the posts list leaves `media[].url` empty and the download endpoint fetches the files.

### Does it work with private accounts?

No. A private account's profile comes back with `is_private` true, but its videos aren't public, so listing them returns `private_or_unavailable`. That's the TikTok app's behavior for a logged-out visitor too.

### Is there an official TikTok API for this?

Not for most developers. TikTok's Research API is open only to approved non-commercial researchers, and its Display API reads only the users who log in to your app. The [TikTok API page](https://socialtap.dev/apis/tiktok/index.md) compares them.

## The endpoints in this guide

Each one is a single request with the same API key.

- [TikTok Profile APIExact follower and like counts, bio and country.$0.75–$1.97 per 1,000 profiles](https://socialtap.dev/apis/tiktok/profile/index.md)

- [TikTok Posts APIAccount videos and photo posts, newest first.$0.05–$0.13 per 1,000 posts](https://socialtap.dev/apis/tiktok/posts/index.md)

- [TikTok Post APIVideo or photo post with views, likes and media.$0.75–$1.97 per 1,000 posts](https://socialtap.dev/apis/tiktok/post/index.md)

- [TikTok Comments APITop-level comments with exact like and reply counts.$0.01–$0.04 per 1,000 comments](https://socialtap.dev/apis/tiktok/comments/index.md)

- [TikTok Hashtag Posts APITop videos and photo posts under a hashtag.$0.07–$0.20 per 1,000 posts](https://socialtap.dev/apis/tiktok/hashtag-posts/index.md)

- [TikTok Download APIWatermark-free video files and slideshow photos.$0.75–$1.97 per 1,000 downloads](https://socialtap.dev/apis/tiktok/download/index.md)

## Replace TikTokApi with one API key.

Get a key, run the code above and see live data in a minute. Failed requests are free.

100free credits

- No credit card
- Failed requests are free
- Works on all 310 endpoints

[Start for free](https://socialtap.dev/signup/) [Read the docs](https://socialtap.dev/docs/index.md)

---

[HTML version](https://socialtap.dev/guides/tiktokapi-alternative/) · [Docs index for AI agents](https://socialtap.dev/llms.txt) · [All docs in one file](https://socialtap.dev/llms-full.txt)
