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.
- Prix
- $0.001USD / appel
- Méthode
- POST
- Réponse
- JSON
- Paramètres
- 0 obligatoires · 1 facultatifs
Bac à sable
[
{
"data": {
"ttwid": "1%7CDUhgx1gk7BiWEvdAdekoqVeGk6a5k8MitMgWFagQJPg%7C1787219000%7C4a18a285f75af40fb5376e9da85e1dcf234dd9e1e27a4f2a4f78d8504744abac"
}
}
]Exemples
Sélectionnez un exemple pour charger ses entrées et son résultat dans le playground.
README de l'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.
Commencer à construire
Envoyez votre première requête
Point de terminaison de l'API de la plateforme avec authentification unifiée et suivi de l'utilisation.
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. Authentification
Définissez votre clé API SandBase dans l'environnement de votre serveur. Les requêtes utilisent l'authentification Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conservez votre clé côté serveur. Ne l'exposez pas dans le code du navigateur.
3. Paramètres
4. Réponse
Exemple de réponse enregistré pour cette API ; aucune requête en direct n'est effectuée lors de l'affichage.
[
{
"data": {
"ttwid": "1%7CDUhgx1gk7BiWEvdAdekoqVeGk6a5k8MitMgWFagQJPg%7C1787219000%7C4a18a285f75af40fb5376e9da85e1dcf234dd9e1e27a4f2a4f78d8504744abac"
}
}
]Explorer plus
APIs associées
| API | Prix | Réponse |
|---|---|---|
Douyin Web TTWID GeneratorCette API Douyin | $0.001 par appel | JSON |
Douyin | $0.001 par appel | JSON |
Douyin | $0.001 par appel | JSON |
Douyin | $0.001 par appel | JSON |
Douyin | $0.001 par appel | JSON |
Douyin | $0.03 par appel | JSON |
Questions
FAQ
Comment utiliser l’API Douyin Web TTWID Generator ?
Envoyez une requête POST à https://api.sandbase.ai/v1/api/douyin/web/generate-ttwid avec votre clé API SandBase dans l’en-tête Authorization (Bearer) et les paramètres dans un corps JSON. Vous pouvez aussi l’essayer dans le Playground sur cette page sans écrire de code.
Combien coûte l’API Douyin Web TTWID Generator ?
$0.001 par appel, facturé depuis votre solde SandBase. Vous ne payez que les appels que vous effectuez ; aucun abonnement.
Quels paramètres l’API Douyin Web TTWID Generator accepte-t-elle ?
Aucun paramètre n’est requis. Facultatif : user_agent (string). Le tableau des paramètres et le Playground sur cette page listent tous les champs.
Que renvoie l’API Douyin Web TTWID Generator ?
Une réponse JSON renvoyée dans la même requête HTTP (synchrone). Le README sur cette page inclut un exemple de réponse.
Ai-je besoin d’un compte développeur ou d’une clé API Douyin ?
Non. Douyin Web TTWID Generator fonctionne via SandBase, donc une seule clé API SandBase couvre ce point de terminaison ainsi que toutes les autres API et tous les modèles du catalogue. Vous n’avez pas besoin de demander un accès API Douyin séparément.
