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.
- Preço
- $0.001USD / chamada
- Método
- POST
- Resposta
- JSON
- Parâmetros
- 0 obrigatórios · 1 opcionais
Playground
[
{
"data": {
"ttwid": "1%7CDUhgx1gk7BiWEvdAdekoqVeGk6a5k8MitMgWFagQJPg%7C1787219000%7C4a18a285f75af40fb5376e9da85e1dcf234dd9e1e27a4f2a4f78d8504744abac"
}
}
]Exemplos
Selecione um exemplo para carregar as entradas e o resultado no playground.
README da 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.
Comece a construir
Envie sua primeira solicitação
Endpoint da API da plataforma com autenticação unificada e rastreamento de uso.
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. Autenticação
Defina sua chave da API SandBase no ambiente do seu servidor. As requisições usam autenticação Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Mantenha sua chave no servidor. Não a exponha em código do navegador.
3. Parâmetros
4. Resposta
Resposta de exemplo salva para esta API; nenhuma requisição ao vivo é feita ao visualizá-la.
[
{
"data": {
"ttwid": "1%7CDUhgx1gk7BiWEvdAdekoqVeGk6a5k8MitMgWFagQJPg%7C1787219000%7C4a18a285f75af40fb5376e9da85e1dcf234dd9e1e27a4f2a4f78d8504744abac"
}
}
]Explorar mais
APIs relacionadas
| API | Preço | Resposta |
|---|---|---|
Douyin Web TTWID GeneratorEsta API Douyin | $0.001 por chamada | JSON |
Douyin | $0.001 por chamada | JSON |
Douyin | $0.001 por chamada | JSON |
Douyin | $0.001 por chamada | JSON |
Douyin | $0.001 por chamada | JSON |
Douyin | $0.03 por chamada | JSON |
Perguntas
FAQ
Como eu uso a API Douyin Web TTWID Generator?
Envie uma solicitação POST para https://api.sandbase.ai/v1/api/douyin/web/generate-ttwid com sua chave de API da SandBase no cabeçalho Authorization (Bearer) e os parâmetros no corpo JSON. Você também pode testar no Playground desta página sem escrever código.
Quanto custa a API Douyin Web TTWID Generator?
$0.001 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.
Quais parâmetros a API Douyin Web TTWID Generator aceita?
Nenhum parâmetro é obrigatório. Opcionais: user_agent (string). A tabela de Parâmetros e o Playground nesta página listam todos os campos.
O que a API Douyin Web TTWID Generator retorna?
Uma resposta JSON retornada na mesma solicitação HTTP (síncrona). O README desta página inclui um exemplo de resposta.
Preciso de uma conta de desenvolvedor Douyin ou de uma chave de API?
Não. Douyin Web TTWID Generator funciona via SandBase, então uma única chave de API da SandBase cobre este endpoint e todas as outras APIs e modelos do catálogo. Você não precisa solicitar acesso à API do Douyin separadamente.
