# What does "failed to get user data, get a new ttwid from the web" mean for Douyin?

It is TikTokDownload's message when Douyin refuses the user-data request, and the ttwid cookie it names was only part of the fix. In issue 329 (February 2023) high-frequency runs succeeded about 2% of the time until users pasted a fresh ttwid from the browser, and from March 2023 (issue 335, 45 comments) Douyin checked more cookie fields, so the working fix became pasting the whole cookie. TikTokDownload has had no push since June 2024. XTikAPI's `douyin.accounts.detail` and `douyin.videos.list` read profiles and videos with no cookie on your side, $0.002 a call.

Updated 2026-11-25

## How the fix changed

| When | Issue | Fix that worked |
|---|---|---|
| Feb 2023 | 329 | Open the user's page in a browser, copy `ttwid` from the cookie, replace it in `Util/__init__.py` |
| Mar 2023 | 335 | Douyin added more checks; copy the whole cookie from DevTools (Network → Doc → Request Headers → cookie) and keep the generated `msToken` |
| Later | 639 | The same tool family, f2 included, ran into 429 rate limits instead |

A ttwid alone stopped being enough years ago, so the message is misleading on newer setups.

## Reading profiles and videos without a cookie

1. Profile link → `sec_uid`: `douyin.accounts.id_from_url`.
2. Profile (nickname, followers, likes, video count): `douyin.accounts.detail`.
3. Posted videos: `douyin.videos.list` with `id`, `cursor` for the next page.

Cost: 100 creators, profile + 3 pages each = 400 calls × $0.002 = $0.80.

## Why XTikAPI

- XTikAPI reads Douyin with 34 endpoints from $0.002 a call, and a failed call is not charged.
- Fewer tokens for AI: across 19 recorded live Douyin calls (2026-11-18), raw platform JSON is ~1.44M tokens vs ~169k via XTikAPI REST (88.3% fewer) and ~36k via MCP (97.5% fewer).
- See before you pay: 192 of 229 endpoints show a recorded real response on their page (30 of 34 for Douyin).
- 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

- [Douyin account details API](https://xtikapi.com/apis/douyin/accounts/detail) ($0.002 a call): A Douyin account profile by UID.
- [Douyin video list API](https://xtikapi.com/apis/douyin/videos/list) ($0.002 a call): Videos posted by one Douyin account, newest first.
- [Douyin sec_uid from profile link API](https://xtikapi.com/apis/douyin/accounts/id_from_url) ($0.002 a call): Extract the sec_user_id from a Douyin profile link.

## More about Douyin

- [Douyin API](https://xtikapi.com/apis/douyin)
- [Douyin user homepage videos API (fetch_user_post_videos) returns 400: why?](https://xtikapi.com/answers/douyin-user-videos-api-400)
- [Why does my Douyin crawler only get the first 18 videos of an account?](https://xtikapi.com/answers/douyin-account-videos-only-first-page)
- [What is the difference between uid and sec_uid on Douyin, and how do I convert one to the other?](https://xtikapi.com/answers/douyin-sec-uid-vs-uid)
- [f2 Douyin download fails with Client error '403 Forbidden': how to fix it?](https://xtikapi.com/answers/f2-douyin-403-forbidden)
- [How can an AI agent search Zhihu and Douyin?](https://xtikapi.com/answers/ai-agent-search-zhihu-douyin)
- [MediaCrawler errors (Verifytype, Douyin page 1 empty, XHS 406, Kuaishou) & hosted alternatives?](https://xtikapi.com/answers/mediacrawler-errors-and-alternatives)

## How to do it

- [How to list every video from a Douyin account](https://xtikapi.com/guides/douyin-user-videos)

## Sources

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

- [TikTokDownload issue #329 (get a new ttwid from the web, with fix)](https://github.com/Johnserf-Seed/TikTokDownload/issues/329)
- [TikTokDownload issue #335 (same error after Douyin added checks)](https://github.com/Johnserf-Seed/TikTokDownload/issues/335)
- [TikTokDownload issue #639 (CODE 429)](https://github.com/Johnserf-Seed/TikTokDownload/issues/639)

## Questions

### Where is ttwid in the browser?

DevTools → Network → pick a Doc request → Request Headers → cookie; ttwid is one of the fields. Issue 335 users found copying the whole cookie worked better.

---

XTikAPI: one API key for public social media data, prepaid per call. [HTML version](https://xtikapi.com/answers/douyin-get-new-ttwid) · [llms.txt](https://xtikapi.com/llms.txt) · [OpenAPI](https://xtikapi.com/openapi.json)
