TikTok Web TTWID Identifier
https://api.sandbase.ai/v1/api/tiktok/web/generate-ttwidReturns a valid TikTok ttwid cookie value for web session handling. Accepts an optional user_agent string to match specific browser environments.
- Precio
- $0.001USD / llamada
- Método
- POST
- Respuesta
- JSON
- Parámetros
- 0 obligatorios · 1 opcionales
Entorno de pruebas
Su salida aparecerá aquí
Complete las entradas y luego haga clic en Ejecutar.
README de la API
TikTok Web TTWID Identifier API
Returns a TikTok 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
- Set the
ttwidcookie on a web client before it sends requests to TikTok web endpoints. - Pair the cookie with a specific browser
user_agentso your request headers stay consistent. - Fetch a new cookie value when a scraper needs a fresh web session identity.
Request
curl -X POST "https://api.sandbase.ai/v1/api/tiktok/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%7C0K27…"
}
Response fields
| Field | Meaning |
|---|---|
ttwid | The full cookie value as a URL-encoded string. Send it as ttwid=<value> in a Cookie header. |
ttwid | The value has four segments separated by %7C, which decodes to /. The segments are 1, a short token, a 10-digit number, and a 64-character hex string. |
ttwid | The 10-digit third segment looks like a Unix timestamp in seconds. The response does not say if it marks creation or expiry. |
Notes
- Send
{}to get a cookie with nouser_agent. Adduser_agentto match a specific browser string. - The value is already URL-encoded. Use it as is, without encoding it again.
- Related tokens for TikTok web requests: TikTok Web ID, TikTok Real msToken and TikTok Web X-Bogus Signature.
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/tiktok/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.
No se ha publicado ninguna respuesta guardada. Ejecute la API en Playground para inspeccionar su respuesta.
Explorar más
APIs relacionadas
| API | Precio | Respuesta |
|---|---|---|
TikTok Web TTWID IdentifierEsta API TikTok | $0.001 por llamada | JSON |
TikTok | $0.001 por llamada | JSON |
TikTok | $0.001 por llamada | JSON |
TikTok | $0.001 por llamada | JSON |
TikTok | $0.001 por llamada | JSON |
TikTok | $0.05 por llamada | JSON |
Guías:TikTok API pricing: official access vs per-call dataBest TikTok API in 2026: Pricing Compared
Preguntas
FAQ
¿Cómo uso la API de TikTok Web TTWID Identifier?
Envía una solicitud POST a https://api.sandbase.ai/v1/api/tiktok/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 TikTok Web TTWID Identifier?
$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 TikTok Web TTWID Identifier?
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 TikTok Web TTWID Identifier?
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 TikTok?
No. TikTok Web TTWID Identifier 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 TikTok por separado.
