keywordstring
The keyword to be suggested
Mặc định: "人工智能"
https://api.sandbase.ai/v1/api/douyin/search/search-suggest-v2Fetch search keyword suggestions V2 on Douyin. Returns the platform data as structured JSON.
Đầu ra của bạn sẽ xuất hiện ở đây
Hoàn tất đầu vào, rồi nhấp Run.
Returns search keyword suggestions from Douyin for a given keyword. It needs one input, keyword, and accepts an optional history_words list to influence the ranking.
人工智能.history_words changes the order of suggestions for the same keyword.curl -X POST "https://api.sandbase.ai/v1/api/douyin/search/search-suggest-v2" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"keyword": "人工智能"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
history_words | string | No | Optional, the user's history search words (comma separated), affects the ranking of suggestions |
keyword | string | No | The keyword to be suggested |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"items": [
{
"content": "人工智能比赛",
"extra_info": {
"poi_id": "",
"poi_location_recall_log_id": "202611031532215E8A160EA19863E55352",
"search_params": "{\"sug_poi_id\":\"\"}"
},
"pos": [
{
"begin": 0,
"end": 3
}
],
"sug_type": "",
"word_record": {
"group_id": "6596440824983065859",
"words_content": "人工智能比赛",
"words_position": 0,
"words_source": "sug"
}
}
],
"raw_key": "sug_list",
"words": [
"人工智能比赛"
]
}
| Field | Meaning |
|---|---|
items[].content | The suggested search phrase as shown to the user. |
items[].pos[].begin / items[].pos[].end | Start and end character positions in content. In the sample they cover the part of the phrase that matches the input keyword. |
items[].word_record.words_content | The suggestion text inside the word record. It matches content in the sample. |
items[].word_record.words_position | Zero-based rank of the suggestion in the list. |
items[].word_record.words_source | Where the suggestion came from. The sample shows sug. |
items[].word_record.group_id | Numeric ID string for the suggestion word group. |
items[].sug_type | Type label of the suggestion. It is an empty string in the sample. |
items[].extra_info.search_params | JSON string with extra search parameters, such as sug_poi_id. The sample value has an empty POI ID. |
words | Plain list of the suggestion phrases, in the same order as items. |
words array is the quickest way to get just the phrases. Use items when you need rank, match positions or IDs.search_params is a JSON-encoded string, so parse it before reading its keys.$0.01 per successful call. Failed calls are not charged.
Bắt đầu xây dựng
Endpoint API của nền tảng với xác thực và theo dõi mức sử dụng thống nhất.
curl -X POST "https://api.sandbase.ai/v1/api/douyin/search/search-suggest-v2" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"keyword": "人工智能"
}'Đặt SandBase API key của bạn trong môi trường máy chủ. Các request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key của bạn trên máy chủ. Không hiển thị trong mã chạy trên trình duyệt.
keywordstringThe keyword to be suggested
Mặc định: "人工智能"
history_wordsstringOptional, the user's history search words (comma separated), affects the ranking of suggestions
Đây là phản hồi ví dụ đã lưu cho API này; không có request thực nào được gửi khi xem mục này.
Chưa có phản hồi đã lưu nào được công bố. Chạy API trong Playground để xem phản hồi.
Khám phá thêm
| API | Giá | Phản hồi |
|---|---|---|
Douyin | $0.01 mỗi lần gọi | JSON |
Douyin | $0.01 mỗi lần gọi | JSON |
Douyin | $0.01 mỗi lần gọi | JSON |
Douyin | $0.01 mỗi lần gọi | JSON |
Douyin | $0.01 mỗi lần gọi | JSON |
Douyin | $0.01 mỗi lần gọi | JSON |
Câu hỏi
Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/douyin/search/search-suggest-v2 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.
$0.01 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ý.
Không có tham số bắt buộc. Tùy chọn: keyword (string) và history_words (string). Bảng Parameters và Playground trên trang này liệt kê mọi trường.
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.
Không. Douyin Search keyword suggestions V2 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.