keywordstring必填
Search Keywords
https://api.sandbase.ai/v1/api/zhihu/web/search-suggestReturns search query suggestions and related topics from Zhihu based on a specified search keyword.
[
{
"data": {
"attached_info": "OioSIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwagZPcGVuQUk=",
"input_hash_id": "80b4de6b986459c3fd81ea76a5c00110",
"suggest": [
{
"attached_info": "OioSIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwagZPcGVuQUnyAksKIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwKgZPcGVuQUk6Bk9wZW5BSUAASABSDmFjdGl2aXR5X3RvcGljXQAAAAA=",
"height": 14,
"icon_url": "https://picx.zhimg.com/80/v2-14647b51c955b4cd339e3f2150d45b9a_1440w.png",
"id": -2962146858830793000,
"label": "activity_topic",
"query": "OpenAI",
"raw_id": "-2962146858830793432",
"tab_type": "general",
"target_url": "",
"width": 26
},
{
"attached_info": "OioSIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwagZPcGVuQUnyAmEKIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwKgZPcGVuQUk6F09wZW5BSeWuo+W4gzI45aSp6K6h5YiSQABIAVITc2FwcGhpcmVfaG90X3JlY2FsbF0AAAAA",
"height": 15,
"icon_url": "https://picx.zhimg.com/v2-31e3b0a5b920d516c5813145d88397b1.png",
"id": 5175751213069824000,
"label": "hot",
"query": "OpenAI宣布28天计划",
"raw_id": "5175751213069824116",
"tab_type": "general",
"target_url": "",
"width": 16
},
{
"attached_info": "OioSIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwagZPcGVuQUnyAmwKIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwKgZPcGVuQUk6G29wZW5haeaZuuiDveS9k+mAg+mAuOS6i+S7tkAASAJSGnN1Z19wcmVmaXhfZGFpbHlfcmVjYWxsX3YyXQAAAAA=",
"height": 0,
"icon_url": "",
"id": 7635419512257695000,
"label": "",
"query": "openai智能体逃逸事件",
"raw_id": "7635419512257694873",
"tab_type": "general",
"target_url": "",
"width": 0
},
"… 7 more items in the full response"
]
}
}
]選擇一個範例,將其輸入與結果載入 playground。
Returns a list of Zhihu search suggestions for a keyword. It needs one input, keyword, and returns the suggested queries with an ID, a tab type and an optional label and icon for each.
OpenAI.curl -X POST "https://api.sandbase.ai/v1/api/zhihu/web/search-suggest" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"keyword": "OpenAI"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
keyword | string | Yes | Search Keywords |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"attached_info": "OioSIDQ5NDM5NGJhY2Y1MDIwNTQ4NDIzNDczMDA4ZDBhMDM0agZPcGVuQUk=",
"input_hash_id": "494394bacf5020548423473008d0a034",
"suggest": [
{
"attached_info": "OioSIDQ5NDM5NGJhY2Y1MDIwNTQ4NDIzNDczMDA4ZDBhMDM0agZPcGVuQUnyAksKIDQ5NDM5NGJhY2Y1…",
"height": 14,
"icon_url": "https://picx.zhimg.com/80/v2-14647b51c955b4cd339e3f2150d45b9a_1440w.png",
"id": -2962146858830793432,
"label": "activity_topic",
"query": "OpenAI",
"raw_id": "-2962146858830793432",
"tab_type": "general",
"target_url": "",
"width": 26
}
]
}
| Field | Meaning |
|---|---|
suggest[] | List of suggestion entries for the keyword, in the order returned. |
suggest[].query | The suggested search phrase as plain text. |
suggest[].id / suggest[].raw_id | Identifier of the suggestion. raw_id is the same number as a string, which is safer for tools that lose precision on large integers. |
suggest[].label | Type tag for the suggestion. A value such as activity_topic marks a topic entry. It is an empty string on plain query suggestions. |
suggest[].tab_type | Search tab the suggestion belongs to. The sample entries all return general. |
suggest[].icon_url / suggest[].width / suggest[].height | Icon image for the suggestion with its size. Plain query suggestions return an empty icon_url and 0 for both sizes. |
suggest[].target_url | Link target for the suggestion. It is an empty string in the sample. |
suggest[].attached_info | Opaque token attached to each suggestion. Pass it unchanged if you need to refer back to it. |
input_hash_id | Hash string that identifies the input keyword. |
keyword is the only parameter and it is required. Send the text the user has typed so far.id values can exceed the safe integer range in some languages. Use raw_id when you need an exact value.$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
開始建置
具備統一驗證與用量追蹤的平台 API 端點。
curl -X POST "https://api.sandbase.ai/v1/api/zhihu/web/search-suggest" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"keyword": "OpenAI"
}'請將您的 SandBase API 金鑰設定在伺服器環境中。請求使用 Bearer 驗證。
export SANDBASE_API_KEY="YOUR_API_KEY"請將金鑰保留在伺服器端,不要在瀏覽器程式碼中公開。
keywordstring必填Search Keywords
這是此 API 的已儲存範例回應;檢視時不會發出即時請求。
[
{
"data": {
"attached_info": "OioSIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwagZPcGVuQUk=",
"input_hash_id": "80b4de6b986459c3fd81ea76a5c00110",
"suggest": [
{
"attached_info": "OioSIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwagZPcGVuQUnyAksKIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwKgZPcGVuQUk6Bk9wZW5BSUAASABSDmFjdGl2aXR5X3RvcGljXQAAAAA=",
"height": 14,
"icon_url": "https://picx.zhimg.com/80/v2-14647b51c955b4cd339e3f2150d45b9a_1440w.png",
"id": -2962146858830793000,
"label": "activity_topic",
"query": "OpenAI",
"raw_id": "-2962146858830793432",
"tab_type": "general",
"target_url": "",
"width": 26
},
{
"attached_info": "OioSIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwagZPcGVuQUnyAmEKIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwKgZPcGVuQUk6F09wZW5BSeWuo+W4gzI45aSp6K6h5YiSQABIAVITc2FwcGhpcmVfaG90X3JlY2FsbF0AAAAA",
"height": 15,
"icon_url": "https://picx.zhimg.com/v2-31e3b0a5b920d516c5813145d88397b1.png",
"id": 5175751213069824000,
"label": "hot",
"query": "OpenAI宣布28天计划",
"raw_id": "5175751213069824116",
"tab_type": "general",
"target_url": "",
"width": 16
},
{
"attached_info": "OioSIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwagZPcGVuQUnyAmwKIDgwYjRkZTZiOTg2NDU5YzNmZDgxZWE3NmE1YzAwMTEwKgZPcGVuQUk6G29wZW5haeaZuuiDveS9k+mAg+mAuOS6i+S7tkAASAJSGnN1Z19wcmVmaXhfZGFpbHlfcmVjYWxsX3YyXQAAAAA=",
"height": 0,
"icon_url": "",
"id": 7635419512257695000,
"label": "",
"query": "openai智能体逃逸事件",
"raw_id": "7635419512257694873",
"tab_type": "general",
"target_url": "",
"width": 0
},
"… 7 more items in the full response"
]
}
}
]探索更多
| API | 價格 | 回應 |
|---|---|---|
Zhihu | 每次呼叫 $0.001 | JSON |
Zhihu | 每次呼叫 $0.005 | JSON |
Zhihu | 每次呼叫 $0.001 | JSON |
Zhihu | 每次呼叫 $0.001 | JSON |
Zhihu | 每次呼叫 $0.001 | JSON |
Zhihu | 每次呼叫 $0.001 | JSON |
問題
使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/zhihu/web/search-suggest。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。
每次 $0.001。每個組織每個 UTC 日可免費呼叫 100 次,並可在包含此 API 在內的所有符合資格之 SandBase APIs 間共用;超過後,每次呼叫都會從您的 SandBase 餘額中以此價格計費。沒有訂閱方案。
必要:keyword (string)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。
在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。
不需要。Zhihu Search Suggestions 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 Zhihu API 存取權。