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

TikTok Gift Names by IDs

Tài liệu API
https://api.sandbase.ai/v1/api/tiktok/web/gift-names-by-ids

Returns gift names for a batch of TikTok gift identifiers. Provide a list of gift IDs to look up their corresponding gift labels.

Giá
$0.025USD / 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
Gift ID list, recommend 50/call for best value ($0.025), auto-process first 50 if more than 50
Đầu raVí dụ
Phản hồioutputs · 495 B · 29 dòng
[
  {
    "data": {
      "found": 3,
      "message": null,
      "not_found": 0,
      "original_count": 3,
      "results": [
        {
          "code": 0,
          "gift_id": "10001",
          "gift_name": "鞭炮"
        },
        {
          "code": 0,
          "gift_id": "10002",
          "gift_name": "红包"
        },
        {
          "code": 0,
          "gift_id": "10003",
          "gift_name": "龙年幸运福袋"
        }
      ],
      "total": 3,
      "truncated": false
    }
  }
]

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 Gift Names by IDs API

Returns the gift name for each TikTok gift ID in a list. You send gift_ids as an array of strings and get one result row per ID, plus counts for found and missing IDs.

Use cases

  • Turn raw gift IDs in live stream gift event logs into readable gift names.
  • Build a local lookup table of TikTok gift IDs and names.
  • Check which gift IDs in a stored dataset have no known name.
  • Label gift columns in a report on live stream gifting.

Request

curl -X POST "https://api.sandbase.ai/v1/api/tiktok/web/gift-names-by-ids" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"gift_ids": ["10001", "10002", "10003"]}'

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

Parameters

NameTypeRequiredDescription
gift_idsarrayYesGift ID list, recommend 50/call for best value ($0.025), auto-process first 50 if more than 50

Example response

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

{
  "found": 3,
  "message": null,
  "not_found": 0,
  "original_count": 3,
  "results": [
    {
      "code": 0,
      "gift_id": "10001",
      "gift_name": "鞭炮"
    }
  ],
  "total": 3,
  "truncated": false
}

Response fields

FieldMeaning
results[].gift_idThe gift ID from your request that this row answers.
results[].gift_nameThe name of the gift. The sample values are in Chinese, such as 鞭炮 and 红包.
results[].codeResult code for this single lookup. It is 0 on every row in the sample, where all IDs returned a name.
found / not_foundNumber of IDs that returned a name and number of IDs that did not.
original_count / totalCount of IDs in the request and total count of results. Both are 3 in the sample.
truncatedBoolean flag. It is false in the sample.
messageText message about the call. It is null in the sample.

Notes

  • Send each ID as a string, for example "10001". The gift_ids list accepts 1 to 1000 items.
  • If you send more than 50 IDs, only the first 50 are processed.
  • Compare found, not_found and truncated with your request to see whether any IDs were unresolved or skipped.
  • To look up one ID, use TikTok Gift Name by ID.

Pricing

$0.025 per successful call. Failed calls are not charged.

Khám phá thêm

APIs liên quan

Tất cả APIs
APIGiáPhản hồi
TikTok$0.025 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 Gift Names by IDs?

Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/tiktok/web/gift-names-by-ids 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 Gift Names by IDs có giá bao nhiêu?

$0.025 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 Gift Names by IDs chấp nhận những tham số nào?

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

API TikTok Gift Names by IDs 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 Gift Names by IDs 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.