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

TikTok Web Guest Cookie

Tài liệu API
https://api.sandbase.ai/v1/api/tiktok/web/web-guest-cookie

Returns guest session cookies for TikTok Web based on a specified browser user agent string. Helps maintain session identity when querying web-based TikTok data.

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

Phòng thử nghiệm

Đầu vào
User browser agent
Đầu raVí dụ
Phản hồioutputs · 810 B · 9 dòng
[
  {
    "data": {
      "Cookie": "tt_csrf_token=ywaXaQLU--rOjuZB_3jrby1Ny8QQ15htaWrs;ttwid=1%7CEApwHaHDTLZB5Jb-XinqPHzZUz6aisIjXuYSgXl2s9Q%7C1791290496%7C313236d0a37a07997f641229f2273ba668db80b177d347172150c5b6ec5771e5; reg-store-region=;store-idc=;msToken=HNusxz2W9Qlj49radrV_3MbrR7F5PjLkzQl4oY5DKOSfpfv6y2vhKOZDrRUJ1548XaENKger2VSh9wJoCHY9mttwrzL0BAwox8EhZxk1cIL_9CYbK830L4qx;msToken=gCpHPspChOEhH3ZdqJKWAkZFheaptYmuY9Wjw7feWCkpAMGzaoQRZSWPerUuqOM3lLvGuZz_giR3QPUh3X3Cy2N3wnUaqfMs0S1hHp2h5P67b70fRGIjGTOg; ttwid=1%7CVHzgS11G0NNfXOoqG8tjmMkOlAkEqKTsfi5zEm_Tv6o%7C1791290497%7Ccacf3a02092a62828cc19b9f7896edb7c86621506da2e79524a195163…",
      "Referer": "https://www.tiktok.com/explore",
      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0"
    }
  }
]

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

TikTok Web Guest Cookie API

Returns a set of guest session headers for TikTok Web: a Cookie string, a Referer URL and the User-Agent you sent. It needs one input, a browser user_agent string.

Use cases

  • Build a cookie header for guest requests to TikTok Web endpoints.
  • Pair a cookie with a chosen browser user_agent so both headers match across requests.
  • Fetch fresh guest cookies at the start of a scraping job that reads public TikTok data.
  • Copy the returned Referer and User-Agent into your own HTTP client along with the cookie.

Request

curl -X POST "https://api.sandbase.ai/v1/api/tiktok/web/web-guest-cookie" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
user_agentstringYesUser browser agent

Example response

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

{
  "Cookie": "tt_csrf_…",
  "Referer": "https://www.tiktok.com/explore",
  "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/1…"
}

Response fields

FieldMeaning
CookieFull cookie string for a guest session, ready to use as a Cookie header. It holds several name=value pairs separated by semicolons, including tt_csrf_token and ttwid.
RefererReferer URL to send with requests, here https://www.tiktok.com/explore.
User-AgentThe browser user agent string the cookie was issued for. It matches the user_agent you sent.

Notes

  • Send the same User-Agent value in your later requests that you passed in user_agent here.
  • The Cookie value is a single string. Use it as is in the Cookie header.
  • For a standalone ttwid value, call TikTok Web TTWID Identifier.
  • To sign web requests, see TikTok Web X-Bogus Signature.

Pricing

$0.002 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
TikTok$0.002 mỗi lần gọiJSON
TikTok$0.001 mỗi lần gọiJSON
TikTok$0.001 mỗi lần gọiJSON
TikTok$0.001 mỗi lần gọiJSON
TikTok$0.001 mỗi lần gọiJSON
TikTok$0.05 mỗi lần gọiJSON

Hướng dẫn:TikTok API pricing: official access vs per-call dataBest TikTok API in 2026: Pricing Compared

Câu hỏi

FAQ

Làm thế nào để dùng API TikTok Web Guest Cookie?

Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/tiktok/web/web-guest-cookie 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 TikTok Web Guest Cookie có giá bao nhiêu?

$0.002 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 TikTok Web Guest Cookie chấp nhận những tham số nào?

Bắt buộc: user_agent (string). Bảng Parameters và Playground trên trang này liệt kê mọi trường.

API TikTok Web Guest Cookie 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 TikTok không?

Không. TikTok Web Guest Cookie 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 TikTok.