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.
- 料金
- $0.001USD / 回
- メソッド
- POST
- レスポンス
- JSON
- パラメータ
- 必須 0 件 · 任意 1 件
プレイグラウンド
[
{
"data": {
"ttwid": "1%7CDUhgx1gk7BiWEvdAdekoqVeGk6a5k8MitMgWFagQJPg%7C1787219000%7C4a18a285f75af40fb5376e9da85e1dcf234dd9e1e27a4f2a4f78d8504744abac"
}
}
]例
例を選択すると、その入力と結果がプレイグラウンドに読み込まれます。
API README
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.
開発を始める
最初のリクエストを送信
統一認証と使用状況の追跡を備えたプラットフォームAPIエンドポイントです。
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. 認証
SandBaseのAPIキーをサーバー環境に設定してください。リクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開しないでください。
3. パラメータ
4. レスポンス
このAPIの保存済みサンプルレスポンスです。表示時にライブリクエストは行われません。
[
{
"data": {
"ttwid": "1%7CDUhgx1gk7BiWEvdAdekoqVeGk6a5k8MitMgWFagQJPg%7C1787219000%7C4a18a285f75af40fb5376e9da85e1dcf234dd9e1e27a4f2a4f78d8504744abac"
}
}
]さらに探索
関連 APIs
| API | 価格 | レスポンス |
|---|---|---|
Douyin | $0.001 / 回 | JSON |
Douyin | $0.001 / 回 | JSON |
Douyin | $0.001 / 回 | JSON |
Douyin | $0.001 / 回 | JSON |
Douyin | $0.001 / 回 | JSON |
Douyin | $0.03 / 回 | JSON |
質問
FAQ
Douyin Web TTWID Generator API はどのように使いますか?
Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/douyin/web/generate-ttwid に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。
Douyin Web TTWID Generator API の料金はいくらですか?
1回あたり $0.001、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。
Douyin Web TTWID Generator API はどのパラメータを受け付けますか?
必須パラメータはありません。 任意: user_agent (string)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。
Douyin Web TTWID Generator API は何を返しますか?
同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。 このページの README にサンプルレスポンスがあります。
Douyin の開発者アカウントまたは API key は必要ですか?
いいえ。Douyin Web TTWID Generator は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。Douyin の API アクセスを別途申請する必要はありません。
