Web Search
curl --request POST \
--url https://api.bocha.cn/v1/web-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "阿里巴巴2024年的ESG报告"
}
'import requests
url = "https://api.bocha.cn/v1/web-search"
payload = { "query": "阿里巴巴2024年的ESG报告" }
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({query: '阿里巴巴2024年的ESG报告'})
};
fetch('https://api.bocha.cn/v1/web-search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"log_id": "d71841ad20095f61",
"msg": null,
"data": {
"_type": "SearchResponse",
"queryContext": {
"originalQuery": "阿里巴巴2024年的ESG报告"
},
"webPages": {
"webSearchUrl": "https://bochaai.com/search?q=阿里巴巴2024年的ESG报告",
"totalEstimatedMatches": 8912791,
"someResultsRemoved": false,
"value": [
{
"name": "阿里巴巴发布2024年ESG报告",
"url": "https://www.alibabagroup.com",
"displayUrl": "https://www.alibabagroup.com",
"snippet": "阿里巴巴集团发布《2024财年环境、社会和治理(ESG)报告》。",
"summary": "报告介绍了阿里巴巴在环境、社会和治理方面的进展。",
"siteName": "www.alibabagroup.com",
"datePublished": "2024-07-22T00:00:00+08:00"
}
]
},
"images": {
"value": []
},
"videos": null
}
}Web Search
从全网搜索网页信息和链接,返回适合 AI 使用的准确结果与完整摘要。
POST
https://api.bocha.cn
/
v1
/
web-search
Web Search
curl --request POST \
--url https://api.bocha.cn/v1/web-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "阿里巴巴2024年的ESG报告"
}
'import requests
url = "https://api.bocha.cn/v1/web-search"
payload = { "query": "阿里巴巴2024年的ESG报告" }
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({query: '阿里巴巴2024年的ESG报告'})
};
fetch('https://api.bocha.cn/v1/web-search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"log_id": "d71841ad20095f61",
"msg": null,
"data": {
"_type": "SearchResponse",
"queryContext": {
"originalQuery": "阿里巴巴2024年的ESG报告"
},
"webPages": {
"webSearchUrl": "https://bochaai.com/search?q=阿里巴巴2024年的ESG报告",
"totalEstimatedMatches": 8912791,
"someResultsRemoved": false,
"value": [
{
"name": "阿里巴巴发布2024年ESG报告",
"url": "https://www.alibabagroup.com",
"displayUrl": "https://www.alibabagroup.com",
"snippet": "阿里巴巴集团发布《2024财年环境、社会和治理(ESG)报告》。",
"summary": "报告介绍了阿里巴巴在环境、社会和治理方面的进展。",
"siteName": "www.alibabagroup.com",
"datePublished": "2024-07-22T00:00:00+08:00"
}
]
},
"images": {
"value": []
},
"videos": null
}
}Authorizations
Body
application/json
用户的搜索词。
搜索指定时间范围内的网页。可填 noLimit、oneDay、oneWeek、oneMonth、oneYear、
单个日期(YYYY-MM-DD)或日期范围(YYYY-MM-DD..YYYY-MM-DD)。
Examples:
"noLimit"
"2025-04-06"
"2025-01-01..2025-04-06"
是否显示网页内容的文本摘要。设为 true 时返回结果中包含 summary 字段。
限定搜索的网站范围。多个根域名或子域名以 | 或 , 分隔,最多 100 个;
例如:qq.com|m.163.com。
排除搜索的网站范围。多个根域名或子域名以 | 或 , 分隔,最多 100 个;
例如:qq.com|m.163.com。
返回结果数量。实际返回数量可能小于指定值,单次最多返回 50 条。
Required range:
1 <= x <= 50