Douyin Web TTWID Generator
https://api.sandbase.ai/v1/api/douyin/web/generate-ttwidReturns a Douyin web ttwid cookie value required for web session authentication. Accepts an optional custom user agent string.
- Cena
- $0.001USD / wywołanie
- Metoda
- POST
- Odpowiedź
- JSON
- Parametry
- 0 wymaganych · 1 opcjonalnych
Playground
[
{
"data": {
"ttwid": "1%7CDUhgx1gk7BiWEvdAdekoqVeGk6a5k8MitMgWFagQJPg%7C1787219000%7C4a18a285f75af40fb5376e9da85e1dcf234dd9e1e27a4f2a4f78d8504744abac"
}
}
]Przykłady
Wybierz przykład, aby wczytać jego dane wejściowe i wynik do playgroundu.
README API
Douyin Web TTWID Generator API
Returns a Douyin web ttwid cookie value as a single string. The only input is an optional user_agent string, so you can call it with an empty body.
Use cases
- Build a
Cookieheader for Douyin web requests that need attwidvalue. - Replace a
ttwidcookie in your own client when you start a new session. - Pair a generated
ttwidwith the sameuser_agentyou send in later web requests.
Request
curl -X POST "https://api.sandbase.ai/v1/api/douyin/web/generate-ttwid" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
The result is returned in outputs[0].data.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
user_agent | string | No |
Example response
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"ttwid": "1%7CvTde…"
}
Response fields
| Field | Meaning |
|---|---|
ttwid | The full Douyin web ttwid cookie value as a URL-encoded string. Use it as is in a cookie header. |
ttwid | The value has four parts separated by %7C, which is an encoded /. Keep the separators when you copy the value. |
ttwid | The parts are a short leading number, a token, a 10-digit number, and a long hex string. Treat the whole string as opaque and do not edit it. |
Notes
- Send
{}to use the default user agent, or setuser_agentto match the client headers you use later. - The response has one key,
ttwid. Pass its value as thettwidcookie in your next Douyin web request. - For a different kind of cookie, see Douyin Web Guest Cookie.
- To prepare IDs for later calls, use Douyin Video ID Extractor or Douyin sec_user_id from URL.
Pricing
$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Zacznij tworzyć
Wyślij pierwsze żądanie
Punkt końcowy API platformy z jednolitym uwierzytelnianiem i śledzeniem użycia.
curl -X POST "https://api.sandbase.ai/v1/api/douyin/web/generate-ttwid" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'2. Uwierzytelnianie
Ustaw klucz API SandBase w środowisku serwera. Żądania używają uwierzytelniania Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Przechowuj klucz na serwerze. Nie ujawniaj go w kodzie przeglądarkowym.
3. Parametry
4. Odpowiedź
Zapisany przykładowy response dla tego API; podczas wyświetlania nie jest wykonywane żadne żądanie na żywo.
[
{
"data": {
"ttwid": "1%7CDUhgx1gk7BiWEvdAdekoqVeGk6a5k8MitMgWFagQJPg%7C1787219000%7C4a18a285f75af40fb5376e9da85e1dcf234dd9e1e27a4f2a4f78d8504744abac"
}
}
]Odkryj więcej
Powiązane APIs
| API | Cena | Odpowiedź |
|---|---|---|
Douyin | $0.001 za wywołanie | JSON |
Douyin | $0.001 za wywołanie | JSON |
Douyin | $0.001 za wywołanie | JSON |
Douyin | $0.001 za wywołanie | JSON |
Douyin | $0.001 za wywołanie | JSON |
Douyin | $0.03 za wywołanie | JSON |
Przewodniki:Best Douyin API in 2026: Pricing Compared
Pytania
FAQ
Jak używać API Douyin Web TTWID Generator?
Wyślij żądanie POST do https://api.sandbase.ai/v1/api/douyin/web/generate-ttwid z kluczem API SandBase w nagłówku Authorization (Bearer) oraz parametrami w treści JSON. Możesz też wypróbować je w Playground na tej stronie bez pisania kodu.
Ile kosztuje API Douyin Web TTWID Generator?
$0.001 za wywołanie, rozliczane z salda SandBase. Płacisz tylko za wykonane wywołania; nie ma subskrypcji.
Jakie parametry przyjmuje API Douyin Web TTWID Generator?
Nie są wymagane żadne parametry. Opcjonalne: user_agent (string). Tabela Parameters oraz Playground na tej stronie zawierają wszystkie pola.
Co zwraca API Douyin Web TTWID Generator?
Odpowiedź JSON zwrócona w tym samym żądaniu HTTP (synchronicznie). README na tej stronie zawiera przykładową odpowiedź.
Czy potrzebuję konta deweloperskiego Douyin lub klucza API?
Nie. Douyin Web TTWID Generator działa przez SandBase, więc jeden klucz API SandBase obejmuje ten endpoint i każde inne API oraz model w katalogu. Nie musisz osobno ubiegać się o dostęp do API Douyin.
