# TikTok-Api errors (EmptyResponseException, 200 empty body, Captcha, statusCode): how do I fix them?

David Teather's Python `TikTok-Api` library fails mainly from TikTok's signature upgrades and headless-browser checks: `api.user().videos()` returns HTTP 200 with an empty body because TikTok now requires `X-Gnarly` instead of `X-Bogus` (issue #1311, Jul 2026), `EmptyResponseException` fires when headless Playwright or an IP is flagged (issues #1090, #1179), and captcha pages interrupt older flows (issues #627, #787). Use the diagnostic and `statusCode` tables below—or read TikTok over plain HTTP with XTikAPI at $0.002 a call.

Updated 2026-11-25

## Why TikTok-Api returns empty responses or captchas

| Symptom | Cause in GitHub issues | Workarounds users tried |
| --- | --- | --- |
| HTTP 200 with empty body on `user().videos()` or `hashtag().videos()` (issue #1311, Jul 2026) | `/api/post/item_list/` now checks `X-Gnarly` while library still sends `X-Bogus` (`trending.videos()` still works with `ms_token`) | Test PR #1310 (let TikTok's own JS inject signatures), or intercept `/api/post/item_list/` via Playwright `page.on("response")` |
| `EmptyResponseException: TikTok returned an empty response` (issues #1090, #1179, #1213) | Headless browser, session, or IP flagged by bot detection; `user.videos` checked harder than `user.info` | Try `headless=False`, fresh `ms_token`, residential proxy, and new session |
| "TikTok blocks this request displaying a Captcha" (issues #627, #787) | Page or signature drift; proxies and custom `verifyFp` fail intermittently | Upgrade library when patched; fixes typically last until TikTok's next signature change |

## TikTok web statusCode reference (from issue #403)

| statusCode | Name in TikTok's JS | Meaning |
| --- | --- | --- |
| 0 | OK | Success |
| 10000 | VERIFY_CODE | Captcha challenge |
| 10102 | USER_NOT_LOGIN | Requires logged-in session |
| 10113 / 10114 | SHARK_SLIDE / SHARK_BLOCK | Slider check / risk-control block |
| 10201 | (captcha script) | Often invalid params (e.g. `count > 50`) |
| 10202 / 10204 | USER_NOT_EXIST / VIDEO_NOT_EXIST | Account or video not found |
| 10216 / 10221 / 10222 | VIDEO_PRIVATE / USER_BAN / USER_PRIVATE | Private video, banned account, or private account |
| 10231 | VIDEO_GEOFENCE_BLOCK | Region-restricted video |
| 10404 | FYP_VIDEO_LIST_LIMIT | For You feed limit |

Note: later comments in issue #403 report TikTok returning HTTP 200 even for banned or non-existent users, so always inspect the response body.

## Reading TikTok without Playwright or signatures

1. Profile: `tiktok.accounts.detail` with `uniqueId` (@handle) or `secUid`.
2. User & hashtag videos: `tiktok.videos.list` (`unique_id` or `id`, `cursor`, `sort`) and `tiktok.hashtag_videos.list` (`ch_id`).
3. Video details & comments: `tiktok.videos.detail` and `tiktok.comments.list` (`id`).

Cost check: 100 accounts (profile + 3 pages of videos each) = 400 calls × $0.002 = $0.80; failed calls return `charged: false` and cost nothing.

## Why XTikAPI

- XTikAPI reads TikTok with 24 endpoints from $0.002 a call, and a failed call is not charged.
- Fewer tokens for AI: across 14 recorded live TikTok calls (2026-11-18), raw platform JSON is ~1.21M tokens vs ~35k via XTikAPI REST (97.1% fewer) and ~35k via MCP (97.1% fewer).
- See before you pay: 192 of 229 endpoints show a recorded real response on their page (22 of 24 for TikTok).
- Spending you control: a failed call or a timeout is not charged (charged: false), X-Max-Price caps one call, and the same Idempotency-Key within 24 hours is never billed twice.
- Free trial: a verified account gets $0.50, no card.

## Endpoints

- [TikTok video list API](https://xtikapi.com/apis/tiktok/videos/list) ($0.002 a call): Videos posted by one TikTok account.
- [TikTok account details API](https://xtikapi.com/apis/tiktok/accounts/detail) ($0.002 a call): A TikTok account profile.
- [TikTok video details API](https://xtikapi.com/apis/tiktok/videos/detail) ($0.002 a call): One TikTok video by ID: caption, author, plays, likes, comments and shares.
- [TikTok comments API](https://xtikapi.com/apis/tiktok/comments/list) ($0.002 a call): A page of comments on one TikTok video.
- [TikTok hashtag videos API](https://xtikapi.com/apis/tiktok/hashtag_videos/list) ($0.002 a call): TikTok videos under a hashtag ID.

## More about TikTok

- [TikTok API](https://xtikapi.com/apis/tiktok)
- [f2 TikTok user posts return status 200 with an empty response: why?](https://xtikapi.com/answers/f2-tiktok-user-post-empty)
- [yt-dlp fails on a TikTok user profile with "[tiktok:user] Failed to parse JSON": how do I fix it?](https://xtikapi.com/answers/yt-dlp-tiktok-user-failed-parse-json)
- [Can I use the TikTok Research API for commercial work?](https://xtikapi.com/answers/tiktok-research-api-commercial-use)
- [The TikTok comments endpoint in Douyin_TikTok_Download_API stopped working: what now?](https://xtikapi.com/answers/tiktok-comments-api-not-working)
- [Why does the Douyin video URL I parsed return 403 Forbidden?](https://xtikapi.com/answers/douyin-video-url-403-forbidden)

## How to do it

- [How to get TikTok video comments with Python](https://xtikapi.com/guides/tiktok-video-comments-python)

## Sources

What this page says about other products comes from their own pages and docs, read on 2026-11-25.

- [TikTok-Api issue #1311 (200 empty body, X-Gnarly)](https://github.com/davidteather/TikTok-Api/issues/1311)
- [TikTok-Api pull request #1310 (let TikTok inject signatures)](https://github.com/davidteather/TikTok-Api/pull/1310)
- [TikTok-Api issue #1179 (EmptyResponseException on user.videos)](https://github.com/davidteather/TikTok-Api/issues/1179)
- [TikTok-Api issue #1090 (EmptyResponseException on all examples)](https://github.com/davidteather/TikTok-Api/issues/1090)
- [TikTok-Api issue #627 (TikTok blocks request with Captcha)](https://github.com/davidteather/TikTok-Api/issues/627)
- [TikTok-Api issue #403 (TikTok statusCode reference)](https://github.com/davidteather/TikTok-Api/issues/403)

## Questions

### Is a 200 empty body on `user().videos()` caused by an expired `ms_token`?

Usually no: in issue #1311 `trending.videos()` kept working with the exact same `ms_token`; the break was `X-Gnarly` replacing `X-Bogus` on user/hashtag feeds.

### Does TikTok publish its web `statusCode` list?

No. The table above was extracted from TikTok's web JavaScript by contributors in issue #403.

---

XTikAPI: one API key for public social media data, prepaid per call. [HTML version](https://xtikapi.com/answers/tiktok-api-errors-and-fixes) · [llms.txt](https://xtikapi.com/llms.txt) · [OpenAPI](https://xtikapi.com/openapi.json)
