Skip to main content
POST
/
paas
/
v4
/
web_search
网络搜索
curl --request POST \
  --url https://open.bigmodel.cn/api/paas/v4/web_search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "search_query": "<string>",
  "search_engine": "search_std",
  "search_intent": false,
  "count": 10,
  "search_domain_filter": "<string>",
  "search_recency_filter": "noLimit",
  "content_size": "medium",
  "request_id": "<string>",
  "user_id": "<string>"
}'
{
  "id": "<string>",
  "created": 123,
  "request_id": "<string>",
  "search_intent": [
    {
      "query": "<string>",
      "intent": "SEARCH_ALL",
      "keywords": "<string>"
    }
  ],
  "search_result": [
    {
      "title": "<string>",
      "content": "<string>",
      "link": "<string>",
      "media": "<string>",
      "icon": "<string>",
      "refer": "<string>",
      "publish_date": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

使用以下格式进行身份验证:Bearer <your api key>

Body

application/json
search_query
string
required

需要进行搜索的内容,建议搜索 query 不超过 70 个字符。

Maximum length: 70
search_engine
enum<string>
required

要调用的搜索引擎编码。目前支持: search_std:智谱基础版搜索引擎 search_pro:智谱高阶版搜索引擎 search_pro_sogou:搜狗 search_pro_quark:夸克搜索

Available options:
search_std,
search_pro,
search_pro_sogou,
search_pro_quark
Example:

"search_std"

search_intent
boolean
default:false
required

是否进行搜索意图识别,默认不执行搜索意图识别。 true:执行搜索意图识别,有搜索意图后执行搜索 false:跳过搜索意图识别,直接执行搜索

count
integer
default:10

返回结果的条数。可填范围:1-50,最大单次搜索返回50条,默认为10。 支持的搜索引擎:search_pro_sogousearch_stdsearch_pro search_pro_sogou: 可选枚举值,10、20、30、40、50

Required range: 1 <= x <= 50
search_domain_filter
string

用于限定搜索结果的范围,仅返回指定白名单域名的内容。 白名单域名:(如 www.example.com) 支持的搜索引擎:search_std、search_pro 、search_pro_sogou

search_recency_filter
enum<string>
default:noLimit

搜索指定时间范围内的网页。默认为 noLimit。可填值:oneDay(一天内)、oneWeek(一周内)、oneMonth(一个月内)、oneYear(一年内)、noLimit(不限,默认)。支持的搜索引擎:search_std、search_pro、search_pro_Sogou、search_pro_quark

Available options:
oneDay,
oneWeek,
oneMonth,
oneYear,
noLimit
content_size
enum<string>

控制返回网页内容的长短。medium:返回摘要信息,满足大模型的基础推理需求,满足常规问答任务的信息检索需求。high:最大化上下文,信息量较大但内容详细,适合需要信息细节的场景。支持的搜索引擎:search_std、search_pro、search_pro_Sogou、search_pro_quark

Available options:
medium,
high
request_id
string

由用户端传递,需要唯一;用于区分每次请求的唯一标识符。如果用户端未提供,平台将默认生成。

user_id
string

终端用户的唯一ID,帮助平台对终端用户的非法活动、生成非法不当信息或其他滥用行为进行干预。ID长度要求:至少6个字符,最多128个字符。

Required string length: 6 - 128

Response

业务处理成功

id
string

任务 ID

created
integer

请求创建时间,是以秒为单位的 Unix 时间戳

request_id
string

请求标识符

search_intent
object[]

搜索意图结果

search_result
object[]

搜索结果

I