cURL
curl --request POST \
--url https://api.z.ai/api/paas/v4/web_search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"search_engine": "search-prime",
"search_query": "<string>",
"count": 25,
"search_domain_filter": "<string>",
"request_id": "<string>",
"user_id": "<string>"
}
'import requests
url = "https://api.z.ai/api/paas/v4/web_search"
payload = {
"search_engine": "search-prime",
"search_query": "<string>",
"count": 25,
"search_domain_filter": "<string>",
"request_id": "<string>",
"user_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
search_engine: 'search-prime',
search_query: '<string>',
count: 25,
search_domain_filter: '<string>',
request_id: '<string>',
user_id: '<string>'
})
};
fetch('https://api.z.ai/api/paas/v4/web_search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.z.ai/api/paas/v4/web_search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"search_engine\": \"search-prime\",\n \"search_query\": \"<string>\",\n \"count\": 25,\n \"search_domain_filter\": \"<string>\",\n \"request_id\": \"<string>\",\n \"user_id\": \"<string>\"\n}")
.asString();{
"id": "<string>",
"created": 123,
"search_result": [
{
"title": "<string>",
"content": "<string>",
"link": "<string>",
"media": "<string>",
"icon": "<string>",
"refer": "<string>",
"publish_date": "<string>"
}
]
}{
"code": 123,
"message": "<string>"
}Tool API
Web Search
The Web Search is a specialized search engine for large language models. Building upon traditional search engine capabilities like web crawling and ranking, it enhances intent recognition to return results better suited for LLM processing (including webpage titles, URLs, summaries, site names, favicons etc.).
POST
/
paas
/
v4
/
web_search
cURL
curl --request POST \
--url https://api.z.ai/api/paas/v4/web_search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"search_engine": "search-prime",
"search_query": "<string>",
"count": 25,
"search_domain_filter": "<string>",
"request_id": "<string>",
"user_id": "<string>"
}
'import requests
url = "https://api.z.ai/api/paas/v4/web_search"
payload = {
"search_engine": "search-prime",
"search_query": "<string>",
"count": 25,
"search_domain_filter": "<string>",
"request_id": "<string>",
"user_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
search_engine: 'search-prime',
search_query: '<string>',
count: 25,
search_domain_filter: '<string>',
request_id: '<string>',
user_id: '<string>'
})
};
fetch('https://api.z.ai/api/paas/v4/web_search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.z.ai/api/paas/v4/web_search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"search_engine\": \"search-prime\",\n \"search_query\": \"<string>\",\n \"count\": 25,\n \"search_domain_filter\": \"<string>\",\n \"request_id\": \"<string>\",\n \"user_id\": \"<string>\"\n}")
.asString();{
"id": "<string>",
"created": 123,
"search_result": [
{
"title": "<string>",
"content": "<string>",
"link": "<string>",
"media": "<string>",
"icon": "<string>",
"refer": "<string>",
"publish_date": "<string>"
}
]
}{
"code": 123,
"message": "<string>"
}Headers
Body
application/json
Search for webpages within a specified time range.
Default is noLimit
Fillable values:
oneDay: within one day
oneWeek: within one week
oneMonth: within one month
oneYear: within one year
noLimit: no limit (default)
Supported search engines:
search_pro_jina
Available options:
oneDay, oneWeek, oneMonth, oneYear, noLimit Response
Processing successful
Search results.
Hide child attributes
Hide child attributes
Was this page helpful?