serp搜索
公共信息
参数 |
描述 |
示例 |
basePath |
调用mass api的基础路径 |
https://searchapi.cloudsway.net/ |
endpointPath |
调用mass api的生成的一段随机路径 |
|
AccessKey |
调用mass api的accessKey |
RWxxxxxxxx0Gd |
请求方法
GET
请求路径
{basePath}/search/{endpointPath}/serp
参数 |
描述 |
示例 |
Authorization |
AccessKey Bearer ${AccessKey} |
Bearer RWxxxxxxxx0Gd |
pragma |
string |
no-cache 不开启缓存 |
请求params
字段名 |
类型 |
是否必填 |
描述 |
count |
string |
否 |
返回结果中包含的搜索结果数量 |
freshness |
string |
否 |
按以下不区分大小写的时间值筛选搜索结果:Day、Week、Month。要获取在特定时间范围内发现的文章,请指定格式为YYYY-MM-DD..YYYY-MM-DD的日期范围。例如,&freshness=2019-02-01..2019-05-30。 |
q |
string |
否 |
用户的搜索查询词。该词不能为空。查询词可以包含Bing高级操作符。 |
返回值
Response
字段名 |
类型 |
描述 |
queryContext |
object |
图片审核结果 |
webPages |
string |
Custom Search JSON API 的 OpenSearch 网址模板的 MIME 类型。 |
QueryContext
字段名 |
类型 |
描述 |
originalQuery |
string |
请求中指定的查询字符串。 |
webPages
字段名 |
类型 |
描述 |
value |
WebPage[] |
与查询相关的网页列表。 |
webPage
字段名 |
类型 |
描述 |
name |
String |
网页的名称。使用此名称和url创建一个超链接,用户点击时会转到网页。 |
snippet |
String |
描述网页内容的文本片段。 |
url |
String |
网页的URL。使用此URL和name创建一个超链接,用户点击时会转到网页。 |
## 示例 |
|
|
请求
curl --location --request GET 'https://searchapi.cloudsway.net/search/{endpointPath}/serp?q=cat' \
--header 'Authorization: Bearer ${AccessKey} ' \
--header 'pragma: no-cache' \
--header 'X-Search-Location;' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)'
返回值
{
"queryContext": {
"originalQuery": "cat"
},
"webPages": {
"value": [
{
"name": "Cat - Reddit",
"url": "https://www.reddit.com/r/cat/",
"snippet": "As a cat subreddit, we only allow cat related things for example: videos, memes, pictures or advice. Any comment or post which isn't cat related will be removed. This rule doesn't include …"
}
]
}
}