public information
base parameters
| Parameter | Description |
|---|---|
| BasePath | the base path for API calls |
| Endpoint | the random path generated when calling APIs |
| AccessKey | the AccessKey for API calls |
request path
https://{BasePath}/search/{Endpoint}/smart
request method
GET
request header
| Parameter | Type | Description |
|---|---|---|
| Authorization | String | Input format: Bearer {AK}, where AK refers to the AccessKey |
| Pragma | String | Input value: no-cache. When no-cache is provided, the response results will not be cached and each request is independent; if not provided, the response results for the same query term will be cached for 10 minutes |
Request Parameter
| Parameter | Required | Type | Description |
|---|---|---|---|
| q | Y | String | The user's search query term, which cannot be empty. |
| count | N | Short | The number of search results to return. Defaults to 10, maximum 50. |
| Enumerated values: 10 / 20 / 30 / 40 / 50 The actual number returned may be less than requested. Use this parameter with the offset parameter for pagination. | |||
| freshness | N | String | Filter search results by time range: - Day (past 24 hours) -Week (past 7 days) - Month (past 30 days) |
| offset | N | Short | The zero-based offset indicating how many results to skip before returning. Defaults to 0. Use with the count parameter for pagination. There is no upper limit for offset; setting a large value may result in no results being returned. |
| enableContent | N | bool | ontrols whether to return long abstract content: -true: Return long abstracts -false: Do not return long abstracts |
| Defaults to false | |||
| contentType | N | String | The format of the long abstract (content) to return. Options:: - HTML - MARKDOWN - TEXT(default) |
| contentTimeout | N | Float | Timeout for reading long abstracts. If reading exceeds this time, it will terminate and no long abstract will be returned for that result. Defaults to 0 (seconds), maximum 10s. |
| mainText | N | bool | Controls whether to return key fragments of dynamic abstracts: true: Return key fragments false:Do not return key fragments Default false |
| sites | N | String | The value must be in host address format (e.g., baijiahao.baidu.com). Returns results only from the specified site(s). |
| blockWebsites | N | String | The value must be in host address format (e.g., baijiahao.baidu.com). Excludes results from the specified site(s). |
Response
| Parameter | Type | Description |
|---|---|---|
| queryContext.originalQuery | String | The user's original search query |
| webPages.value | Array | Detailed result data returned |
| webPages.value.name | String | Webpage title |
| webPages.value.url | String | Webpage URL |
| webPages.value.datePublished | String | Page publication time (included in some sites) Example: 2025-07-14T01:15:00.0000000Z |
| webPages.value.snippet | String | Text snippet describing the webpage content |
| webPages.value.mainText | String | Dynamic abstract fragment extracted from the text, most relevant to the query. More intelligent than snippet |
| webPages.value.siteName | String | Website name (included in some webpages) |
| webPages.value.contentCrawled | Bool | Long abstract retrieval status: true for success (content is included in content), false for failure (content is empty) |
| webPages.value.content | String | Long abstract information of the webpage, retrieved from the main text. MARKDOWN and HTML formats include image links with anchor positions |
| webPages.value.logo | String | Website logo (included in some webpages) |
| webPages.value.imageList | Array | List of image URLs in the webpage (included in some webpages, depending on whether the page contains images) |
| webPages.value.score | Float | Content relevance score |
Request Example
cURL
curl --location --request GET 'https://{basePath}/search/{endpoint}/smart?q=cat&count=10&mainText=true&enableContent=true' \
--header 'Authorization: Bearer {AK}' \
--header 'pragma: no-cache'
Python(Requests)
import requests
BasePath = 'xxxxxx' # Replace with your obtained BasePath
Endpoint = 'xxxxxx' # Replace with your obtained Endpoint
AK = 'xxxxxx' # Replace with your obtained AccessKey
url = f"https://{BasePath}/search/{Endpoint}/smart"
payload = {
"q": "cat",
"count": 10,
"enableContent": True,
"mainText": True
}
headers = {
'Authorization': f'Bearer {AK}',
'Pragma': 'no-cache'
}
response = requests.get(url, headers=headers, params=payload)
print(response.text)
Response Example
{
"queryContext": {
"originalQuery": "cat"
},
"webPages": {
"value": [
{
"name": "cat - 搜狗百科",
"url": "http://baike.sogou.com/v64497242.htm?fromTitle=cat",
"datePublished": "2024-07-31T06:25:29.0000000",
"snippet": "cat(英[kæt],美[kæt]),英语单词。作名词时,释义为猫;猫科动物;心地恶毒的女人。作动词时,释义为把(锚)吊放在锚架上;用九尾鞭打;<英俚> 呕吐。作缩写词时,释义为(CAT)晴空湍流;计算机辅助测试。 中文名 猫 外文名 cat 另一含义 国际公认会计技师 类型 英语单词 基本介绍 猫:猫科的动物:猫的身体分为头、颈、躯干、四肢和尾五部分,大多数全身披毛,少数为无毛猫。",
"siteName": "搜狗百科",
"content": "cat(英[kæt],美[kæt]),英语单词。作名词时,释义为猫;猫科动物;心地恶毒的女人。作动词时,释义为把(锚)吊放在锚架上;用九尾鞭打;<英俚> 呕吐。作缩写词时,释义为(CAT)晴空湍流;计算机辅助测试。短语搭配为pet cat(宠物猫)。例句为“It is a large-sized wild cat.(它是一个体型很大的野猫。)” cat的复数为cats,现在分词为catting,过去分词为catted。其反义词为keep down,名词性近义词为pussy-cat、grimalkin[1]。英语单词cat(英[kæt],美[kæt]),英语单词。作名词时,释义为猫;猫科动物;心地恶毒的女人。作动词时,释义为把(锚)吊放在锚架上;用九尾鞭打;<英俚> 呕吐。作缩写词时,释义为(CAT)晴空湍流;计算机辅助测试。短语搭配为pet cat(宠物猫)。例句为“It is a large-sized wild cat.(它是一个体型很大的野猫。)” cat的复数为cats,现在分词为catting,过去分词为catted。其反义词为keep down,名词性近义词为pussy-cat、grimalkin[1]。 免责声明 搜狗百科词条内容由用户共同创建和维护,不代表搜狗百科立场。如果您需要医学、法律、投资理财等专业领域的建议,我们强烈建议您独自对内容的可信性进行评估,并咨询相关专业人士。 词条信息词条浏览:45555次 最近更新:24.07.31 编辑次数:12次 创建者:兔子... 突出贡献者:",
"contentCrawled": "true",
"logo": "http://search.sogoucdn.com/baike/common/favicon.d5e2980b.ico",
"score": 0.6703299,
"imageList": [],
"mainText": "短语搭配为pet cat(宠物猫)。例句为“It is a large-sized wild cat.(它是一个体型很大的野猫。)” cat的复数为cats,现在分词为catting,过去分词为catted。其反义词为keep down,名词性近义词为pussy-cat、grimalkin[1]。英语单词cat(英[kæt],美[kæt]),英语单词。作名词时,释义为猫;猫科动物;心地恶毒的女人。作动词时,释义为把(锚)吊放在锚架上;用九尾鞭打; 呕吐。作缩写词时,释义为(CAT)晴空湍流;计算机辅助测试。短语搭配为pet cat(宠物猫)。例句为“It is a large-sized wild cat.(它是一个体型很大的野猫。)” cat的复数为cats,现在分词为catting,过去分词为catted。其反义词为keep down,名词性近义词为pussy-cat、grimalkin[1]。 免责声明 搜狗百科词条内容由用户共同创建和维护,不代表搜狗百科立场。如果您需要医学、法律、投资理财等专业领域的建议,我们强烈建议您独自对内容的可信性进行评估,并咨询相关专业人士。 词条信息词条浏览:45555次 最近更新:24.07.31 编辑次数:12次 创建者:兔子... 突出贡献者:"
},
{
"name": "Cat是什么单词",
"url": "https://www.kaoshibaike.com/396832178.html",
"datePublished": "2024-01-06T08:44:52.0000000",
"snippet": "小写cat译为中文是猫的意思,大写的CAT是指化学中的过氧化氢酶和计算机程序中的计算机辅助翻译。同时CAT也是卡特彼勒公司的缩写和一著名品牌休闲服装和鞋类。另外CAT还是国际公认会计技师。 CAT是英文Certified Accounting Technician的缩写,.该资格证书是由特许公认会计师公会(ACCA)授予、国际认可的会计专业资格。",
"content": "小写cat译为中文是猫的意思,大写的CAT是指化学中的过氧化氢酶和计算机程序中的计算机辅助翻译。同时CAT也是卡特彼勒公司的缩写和一著名品牌休闲服装和鞋类。另外CAT还是国际公认会计技师。 CAT是英文Certified Accounting Technician的缩写,.该资格证书是由特许公认会计师公会(ACCA)授予、国际认可的会计专业资格。",
"contentCrawled": "true",
"logo": "https://www.kaoshibaike.com/favicon.ico",
"score": 0.5712132,
"imageList": [],
"mainText": "小写cat译为中文是猫的意思,大写的CAT是指化学中的过氧化氢酶和计算机程序中的计算机辅助翻译。同时CAT也是卡特彼勒公司的缩写和一著名品牌休闲服装和鞋类。另外CAT还是国际公认会计技师。 CAT是英文Certified Accounting Technician的缩写,.该资格证书是由特许公认会计师公会(ACCA)授予、国际认可的会计专业资格。"
}
]
}
}
Status Code Description
| Status Code | Error Code | Description |
|---|---|---|
| 200 | - | API call succeeded |
| 429 | - | QPS exceeded, please contact support to increase your quota |