Sand AISand AI MAGI-2MAGI-2 hiện đã có trên SandBase: video 1080p với âm thanh gốcDùng thử ngay

Douyin Web TTWID Generator

Tài liệu API
https://api.sandbase.ai/v1/api/douyin/web/generate-ttwid

Returns a Douyin web ttwid cookie value required for web session authentication. Accepts an optional custom user agent string.

Giá
$0.001USD / lượt gọi
Phương thức
POST
Phản hồi
JSON
Tham số
0 bắt buộc · 1 tùy chọn

Phòng thử nghiệm

Đầu vào
Đầu raVí dụ
Phản hồioutputs · 176 B · 7 dòng
[
  {
    "data": {
      "ttwid": "1%7CDUhgx1gk7BiWEvdAdekoqVeGk6a5k8MitMgWFagQJPg%7C1787219000%7C4a18a285f75af40fb5376e9da85e1dcf234dd9e1e27a4f2a4f78d8504744abac"
    }
  }
]

Ví dụ

Chọn một ví dụ để nạp đầu vào và kết quả của nó vào playground.

README 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 Cookie header for Douyin web requests that need a ttwid value.
  • Replace a ttwid cookie in your own client when you start a new session.
  • Pair a generated ttwid with the same user_agent you 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

NameTypeRequiredDescription
user_agentstringNo

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "ttwid": "1%7CvTde…"
}

Response fields

FieldMeaning
ttwidThe full Douyin web ttwid cookie value as a URL-encoded string. Use it as is in a cookie header.
ttwidThe value has four parts separated by %7C, which is an encoded /. Keep the separators when you copy the value.
ttwidThe 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

Pricing

$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

Khám phá thêm

APIs liên quan

Tất cả APIs
APIGiáPhản hồi
Douyin$0.001 mỗi lần gọiJSON
Douyin$0.001 mỗi lần gọiJSON
Douyin$0.001 mỗi lần gọiJSON
Douyin$0.001 mỗi lần gọiJSON
Douyin$0.001 mỗi lần gọiJSON
Douyin$0.03 mỗi lần gọiJSON

Hướng dẫn:Best Douyin API in 2026: Pricing Compared

Câu hỏi

FAQ

Làm thế nào để dùng API Douyin Web TTWID Generator?

Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/douyin/web/generate-ttwid với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.

API Douyin Web TTWID Generator có giá bao nhiêu?

$0.001 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.

API Douyin Web TTWID Generator chấp nhận những tham số nào?

Không có tham số bắt buộc. Tùy chọn: user_agent (string). Bảng Parameters và Playground trên trang này liệt kê mọi trường.

API Douyin Web TTWID Generator trả về gì?

Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ). README trên trang này có ví dụ phản hồi.

Tôi có cần tài khoản nhà phát triển hoặc API key của Douyin không?

Không. Douyin Web TTWID Generator chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Douyin.