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.
- Precio
- $0.001USD / llamada
- Método
- POST
- Respuesta
- JSON
- Parámetros
- 0 obligatorios · 1 opcionales
Entorno de pruebas
[
{
"data": {
"ttwid": "1%7CDUhgx1gk7BiWEvdAdekoqVeGk6a5k8MitMgWFagQJPg%7C1787219000%7C4a18a285f75af40fb5376e9da85e1dcf234dd9e1e27a4f2a4f78d8504744abac"
}
}
]Ejemplos
Seleccione un ejemplo para cargar sus entradas y el resultado en el playground.
README de la 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.
Empiece a construir
Envíe su primera solicitud
Endpoint de la API de la plataforma con autenticación unificada y seguimiento 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. Autenticación
Configure su clave de API de SandBase en el entorno de su servidor. Las solicitudes usan autenticación Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserve su clave en el servidor. No la exponga en código del navegador.
3. Parámetros
4. Respuesta
Respuesta de ejemplo guardada para esta API; no se realiza ninguna solicitud en vivo al verla.
[
{
"data": {
"ttwid": "1%7CDUhgx1gk7BiWEvdAdekoqVeGk6a5k8MitMgWFagQJPg%7C1787219000%7C4a18a285f75af40fb5376e9da85e1dcf234dd9e1e27a4f2a4f78d8504744abac"
}
}
]Explorar más
APIs relacionadas
| API | Precio | Respuesta |
|---|---|---|
Douyin Web TTWID GeneratorEsta API Douyin | $0.001 por llamada | JSON |
Douyin | $0.001 por llamada | JSON |
Douyin | $0.001 por llamada | JSON |
Douyin | $0.001 por llamada | JSON |
Douyin | $0.001 por llamada | JSON |
Douyin | $0.03 por llamada | JSON |
Preguntas
FAQ
¿Cómo uso la API de Douyin Web TTWID Generator?
Envía una solicitud POST a https://api.sandbase.ai/v1/api/douyin/web/generate-ttwid con tu clave API de SandBase en el encabezado Authorization (Bearer) y los parámetros como un cuerpo JSON. También puedes probarlo en el Playground de esta página sin escribir código.
¿Cuánto cuesta la API de Douyin Web TTWID Generator?
$0.001 por llamada, facturado desde tu saldo de SandBase. Solo se te cobra por las llamadas que haces; no hay suscripción.
¿Qué parámetros acepta la API de Douyin Web TTWID Generator?
No se requieren parámetros. Opcionales: user_agent (string). La tabla de Parámetros y el Playground de esta página enumeran todos los campos.
¿Qué devuelve la API de Douyin Web TTWID Generator?
Una respuesta JSON devuelta en la misma solicitud HTTP (sincrónica). El README de esta página incluye una respuesta de ejemplo.
¿Necesito una cuenta de desarrollador o una clave API de Douyin?
No. Douyin Web TTWID Generator funciona a través de SandBase, así que una sola clave API de SandBase cubre este endpoint y todas las demás APIs y modelos del catálogo. No necesitas solicitar acceso a la API de Douyin por separado.
