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.
- ราคา
- $0.001USD / คำขอ
- Method
- POST
- การตอบกลับ
- JSON
- พารามิเตอร์
- 0 จำเป็น · 1 ไม่บังคับ
Playground
เอาต์พุตของคุณจะแสดงที่นี่
กรอกอินพุตให้ครบ แล้วคลิก Run
API README
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.
เริ่มสร้าง
ส่งคำขอแรกของคุณ
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
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. การยืนยันตัวตน
ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
3. พารามิเตอร์
4. การตอบกลับ
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
ยังไม่มีการเผยแพร่การตอบกลับที่บันทึกไว้ ให้รัน API ใน Playground เพื่อดูการตอบกลับ
สำรวจเพิ่มเติม
APIs ที่เกี่ยวข้อง
| API | ราคา | การตอบกลับ |
|---|---|---|
TikTok Web TTWID IdentifierAPI นี้ TikTok | $0.001 ต่อการเรียก | JSON |
TikTok | $0.001 ต่อการเรียก | JSON |
TikTok | $0.001 ต่อการเรียก | JSON |
TikTok | $0.001 ต่อการเรียก | JSON |
TikTok | $0.001 ต่อการเรียก | JSON |
TikTok | $0.05 ต่อการเรียก | JSON |
คู่มือ:TikTok API pricing: official access vs per-call dataBest TikTok API in 2026: Pricing Compared
คำถาม
คำถามที่พบบ่อย
ฉันจะใช้ TikTok Web TTWID Identifier API ได้อย่างไร?
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/tiktok/web/generate-ttwid โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
TikTok Web TTWID Identifier API ราคาเท่าไร?
$0.001 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
TikTok Web TTWID Identifier API รับพารามิเตอร์อะไรบ้าง?
ไม่ต้องระบุพารามิเตอร์ ตัวเลือก: user_agent (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
TikTok Web TTWID Identifier API ส่งคืนอะไร?
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ฉันจำเป็นต้องมีบัญชีนักพัฒนาหรือ API key ของ TikTok ไหม?
ไม่จำเป็น TikTok Web TTWID Identifier ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง TikTok API แยกต่างหาก
