Web Search API
curl --request POST \
--url https://api.ppio.com/v3/web-search \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"query": "<string>",
"freshness": "<string>",
"summary": true,
"include": "<string>",
"exclude": "<string>",
"count": 123
}
'import requests
url = "https://api.ppio.com/v3/web-search"
payload = {
"query": "<string>",
"freshness": "<string>",
"summary": True,
"include": "<string>",
"exclude": "<string>",
"count": 123
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
query: '<string>',
freshness: '<string>',
summary: true,
include: '<string>',
exclude: '<string>',
count: 123
})
};
fetch('https://api.ppio.com/v3/web-search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ppio.com/v3/web-search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>',
'freshness' => '<string>',
'summary' => true,
'include' => '<string>',
'exclude' => '<string>',
'count' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ppio.com/v3/web-search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"freshness\": \"<string>\",\n \"summary\": true,\n \"include\": \"<string>\",\n \"exclude\": \"<string>\",\n \"count\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ppio.com/v3/web-search")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"query\": \"<string>\",\n \"freshness\": \"<string>\",\n \"summary\": true,\n \"include\": \"<string>\",\n \"exclude\": \"<string>\",\n \"count\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/v3/web-search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"query\": \"<string>\",\n \"freshness\": \"<string>\",\n \"summary\": true,\n \"include\": \"<string>\",\n \"exclude\": \"<string>\",\n \"count\": 123\n}"
response = http.request(request)
puts response.read_body{
"SearchData": {
"_type": "<string>",
"queryContext": {},
"webPages": {},
"images": {},
"videos": {}
},
"WebSearchQueryContext": {
"originalQuery": "<string>"
},
"WebSearchWebPages": {
"webSearchUrl": "<string>",
"totalEstimatedMatches": 123,
"value": [
{}
],
"someResultsRemoved": true
},
"WebPageValue": {
"id": "<string>",
"name": "<string>",
"url": "<string>",
"displayUrl": "<string>",
"snippet": "<string>",
"summary": "<string>",
"siteName": "<string>",
"siteIcon": "<string>",
"datePublished": "<string>",
"dateLastCrawled": "<string>",
"cachedPageUrl": "<string>",
"language": "<string>",
"isFamilyFriendly": true,
"isNavigational": true
},
"WebSearchImages": {
"id": "<string>",
"readLink": "<string>",
"webSearchUrl": "<string>",
"isFamilyFriendly": true,
"value": [
{}
]
},
"WebSearchVideos": {
"id": "<string>",
"readLink": "<string>",
"webSearchUrl": "<string>",
"isFamilyFriendly": true,
"scenario": "<string>",
"value": [
{}
]
},
"ImageValue": {
"webSearchUrl": "<string>",
"name": "<string>",
"thumbnailUrl": "<string>",
"datePublished": "<string>",
"contentUrl": "<string>",
"hostPageUrl": "<string>",
"contentSize": "<string>",
"encodingFormat": "<string>",
"hostPageDisplayUrl": "<string>",
"width": 123,
"height": 123,
"thumbnail": {}
},
"VideoValue": {
"webSearchUrl": "<string>",
"name": "<string>",
"description": "<string>",
"thumbnailUrl": "<string>",
"publisher": [
{}
],
"creator": {},
"contentUrl": "<string>",
"hostPageUrl": "<string>",
"encodingFormat": "<string>",
"hostPageDisplayUrl": "<string>",
"width": 123,
"height": 123,
"duration": "<string>",
"motionThumbnailUrl": "<string>",
"embedHtml": "<string>",
"allowHttpsEmbed": true,
"viewCount": 123,
"thumbnail": {},
"allowMobileEmbed": true,
"isSuperfresh": true,
"datePublished": "<string>"
},
"Creator": {
"name": "<string>"
},
"Publisher": {
"name": "<string>"
},
"Thumbnail": {
"height": 123,
"width": 123
},
"RankingResponse": {
"mainline": {}
},
"Mainline": {
"items": [
{}
]
},
"MainlineItem": {
"answerType": "<string>",
"value": {}
},
"MainlineItemValue": {
"id": "<string>"
}
}联网搜索
Web Search API
POST
/
v3
/
web-search
Web Search API
curl --request POST \
--url https://api.ppio.com/v3/web-search \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"query": "<string>",
"freshness": "<string>",
"summary": true,
"include": "<string>",
"exclude": "<string>",
"count": 123
}
'import requests
url = "https://api.ppio.com/v3/web-search"
payload = {
"query": "<string>",
"freshness": "<string>",
"summary": True,
"include": "<string>",
"exclude": "<string>",
"count": 123
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
query: '<string>',
freshness: '<string>',
summary: true,
include: '<string>',
exclude: '<string>',
count: 123
})
};
fetch('https://api.ppio.com/v3/web-search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ppio.com/v3/web-search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>',
'freshness' => '<string>',
'summary' => true,
'include' => '<string>',
'exclude' => '<string>',
'count' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ppio.com/v3/web-search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"freshness\": \"<string>\",\n \"summary\": true,\n \"include\": \"<string>\",\n \"exclude\": \"<string>\",\n \"count\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ppio.com/v3/web-search")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"query\": \"<string>\",\n \"freshness\": \"<string>\",\n \"summary\": true,\n \"include\": \"<string>\",\n \"exclude\": \"<string>\",\n \"count\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/v3/web-search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"query\": \"<string>\",\n \"freshness\": \"<string>\",\n \"summary\": true,\n \"include\": \"<string>\",\n \"exclude\": \"<string>\",\n \"count\": 123\n}"
response = http.request(request)
puts response.read_body{
"SearchData": {
"_type": "<string>",
"queryContext": {},
"webPages": {},
"images": {},
"videos": {}
},
"WebSearchQueryContext": {
"originalQuery": "<string>"
},
"WebSearchWebPages": {
"webSearchUrl": "<string>",
"totalEstimatedMatches": 123,
"value": [
{}
],
"someResultsRemoved": true
},
"WebPageValue": {
"id": "<string>",
"name": "<string>",
"url": "<string>",
"displayUrl": "<string>",
"snippet": "<string>",
"summary": "<string>",
"siteName": "<string>",
"siteIcon": "<string>",
"datePublished": "<string>",
"dateLastCrawled": "<string>",
"cachedPageUrl": "<string>",
"language": "<string>",
"isFamilyFriendly": true,
"isNavigational": true
},
"WebSearchImages": {
"id": "<string>",
"readLink": "<string>",
"webSearchUrl": "<string>",
"isFamilyFriendly": true,
"value": [
{}
]
},
"WebSearchVideos": {
"id": "<string>",
"readLink": "<string>",
"webSearchUrl": "<string>",
"isFamilyFriendly": true,
"scenario": "<string>",
"value": [
{}
]
},
"ImageValue": {
"webSearchUrl": "<string>",
"name": "<string>",
"thumbnailUrl": "<string>",
"datePublished": "<string>",
"contentUrl": "<string>",
"hostPageUrl": "<string>",
"contentSize": "<string>",
"encodingFormat": "<string>",
"hostPageDisplayUrl": "<string>",
"width": 123,
"height": 123,
"thumbnail": {}
},
"VideoValue": {
"webSearchUrl": "<string>",
"name": "<string>",
"description": "<string>",
"thumbnailUrl": "<string>",
"publisher": [
{}
],
"creator": {},
"contentUrl": "<string>",
"hostPageUrl": "<string>",
"encodingFormat": "<string>",
"hostPageDisplayUrl": "<string>",
"width": 123,
"height": 123,
"duration": "<string>",
"motionThumbnailUrl": "<string>",
"embedHtml": "<string>",
"allowHttpsEmbed": true,
"viewCount": 123,
"thumbnail": {},
"allowMobileEmbed": true,
"isSuperfresh": true,
"datePublished": "<string>"
},
"Creator": {
"name": "<string>"
},
"Publisher": {
"name": "<string>"
},
"Thumbnail": {
"height": 123,
"width": 123
},
"RankingResponse": {
"mainline": {}
},
"Mainline": {
"items": [
{}
]
},
"MainlineItem": {
"answerType": "<string>",
"value": {}
},
"MainlineItemValue": {
"id": "<string>"
}
}从全网搜索任何网页信息和网页链接,结果准确、摘要完整,更适合 AI 使用。
搜索结果包括网页、图片
- 网页包括 name、url、snippet、summary、siteName、siteIcon、datePublished 等信息
- 图片包括 contentUrl、hostPageUrl、width、height 等信息
可配置搜索时间范围、是否显示摘要,支持按分页获取更多结果。
请求头
string
必填
枚举值:
application/jsonstring
必填
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。
请求体
string
必填
用户的搜索词。
string
搜索指定时间范围内的网页。可填值:
noLimit,不限(默认)oneDay,一天内oneWeek,一周内oneMonth,一个月内oneYear,一年内YYYY-MM-DD..YYYY-MM-DD,搜索日期范围,例如:“2025-01-01..2025-04-06”YYYY-MM-DD,搜索指定日期,例如:“2025-04-06”
推荐使用
noLimit。搜索算法会自动进行时间范围的改写,效果更佳。如果指定时间范围,很有可能出现时间范围内没有相关网页的情况,导致找不到搜索结果。boolean
是否显示文本摘要。可填值:
true,显示false,不显示(默认)
string
指定搜索的网站范围。多个域名使用
| 或 , 分隔,最多不能超过20个可填值:- 根域名
- 子域名
string
排除搜索的网站范围。多个域名使用
| 或 , 分隔,最多不能超过20个可填值:- 根域名
- 子域名
int
返回结果的条数(实际返回结果数量可能会小于count指定的数量)。
- 可填范围:1-50,最大单次搜索返回50条
- 默认为10
响应
object
object
object
单个网页搜索结果的详细信息
显示 properties
显示 properties
string
网页的排序ID
string
网页的标题
string
网页的URL
string
网页的展示URL(url decode后的格式)
string
网页内容的简短描述
string
网页内容的文本摘要,当请求参数中 summary 为 true 时显示此属性
string
网页的网站名称
string
网页的网站图标
string
网页的发布时间(例如:2025-02-23T08:18:30+08:00),UTC+8时间
string
网页的发布时间(此处其实是发布时间,名字起为LastCrawled是兼容性适配)
接口中返回的
dateLastCrawled 值(例如:2025-02-23T08:18:30Z)实际上要表达的是 UTC+8 北京时间2025-02-23 08:18:30,并非UTC时间。实际应用中请使用 datePublished 字段,或将 “2025-02-23T08:18:30Z” 替换成 “2025-02-23T08:18:30+08:00”,即得到正确的UTC+8时间,可以使用 datetime 函数正确解析。string
网页的缓存页面URL
string
网页的语言
boolean
是否为家庭友好的页面
boolean
是否为导航性页面
object
object
object
object
单个视频搜索结果的详细信息
显示 properties
显示 properties
string
视频的搜索URL
string
视频的名称
string
视频的描述
string
视频的缩略图URL
List<Publisher>
视频的发布者列表
Creator
视频的创建者信息
string
视频的内容URL
string
视频所在页面的URL
string
视频的编码格式
string
视频所在页面的展示URL
int
视频的宽度
int
视频的高度
string
视频的时长
string
视频的动态缩略图URL
string
视频的嵌入HTML代码
boolean
是否允许HTTPS嵌入
int
视频的观看次数
Thumbnail
视频的缩略图信息
boolean
是否允许移动端嵌入
boolean
是否为超新鲜内容
string
视频的发布时间
最后修改于 2026年1月12日
⌘I