SERP API 页面截图
curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/serp/screenshot \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"task_id": "<string>",
"browser_preset": "<string>",
"browser_screen_width": 123,
"browser_screen_height": 123,
"browser_screen_scale_factor": 123,
"page": 123
}
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/serp/screenshot"
payload = {
"task_id": "<string>",
"browser_preset": "<string>",
"browser_screen_width": 123,
"browser_screen_height": 123,
"browser_screen_scale_factor": 123,
"page": 123
}
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({
task_id: '<string>',
browser_preset: '<string>',
browser_screen_width: 123,
browser_screen_height: 123,
browser_screen_scale_factor: 123,
page: 123
})
};
fetch('https://api.aisa.one/apis/v1/dataforseo/serp/screenshot', 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.aisa.one/apis/v1/dataforseo/serp/screenshot",
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([
'task_id' => '<string>',
'browser_preset' => '<string>',
'browser_screen_width' => 123,
'browser_screen_height' => 123,
'browser_screen_scale_factor' => 123,
'page' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.aisa.one/apis/v1/dataforseo/serp/screenshot"
payload := strings.NewReader("{\n \"task_id\": \"<string>\",\n \"browser_preset\": \"<string>\",\n \"browser_screen_width\": 123,\n \"browser_screen_height\": 123,\n \"browser_screen_scale_factor\": 123,\n \"page\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.aisa.one/apis/v1/dataforseo/serp/screenshot")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"task_id\": \"<string>\",\n \"browser_preset\": \"<string>\",\n \"browser_screen_width\": 123,\n \"browser_screen_height\": 123,\n \"browser_screen_scale_factor\": 123,\n \"page\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/dataforseo/serp/screenshot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"task_id\": \"<string>\",\n \"browser_preset\": \"<string>\",\n \"browser_screen_width\": 123,\n \"browser_screen_height\": 123,\n \"browser_screen_scale_factor\": 123,\n \"page\": 123\n}"
response = http.request(request)
puts response.read_body{
"version": "<string>",
"status_code": 123,
"status_message": "<string>",
"time": "<string>",
"cost": 123,
"tasks": [
"<string>"
],
"tasks[].id": "<string>",
"tasks[].status_code": 123,
"tasks[].status_message": "<string>",
"tasks[].result_count": 123,
"tasks[].path": [
"<string>"
],
"tasks[].data": {},
"tasks[].result": [
"<string>"
],
"tasks[].result[].items_count": 123,
"tasks[].result[].items": [
"<string>"
],
"tasks[].result[].items[].image": "<string>"
}截图
SERP API 页面截图
使用实时页面截图端点,您可以截取任意 SERP 页面的截图。
POST
https://api.aisa.one/apis/v1
/
dataforseo
/
serp
/
screenshot
SERP API 页面截图
curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/serp/screenshot \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"task_id": "<string>",
"browser_preset": "<string>",
"browser_screen_width": 123,
"browser_screen_height": 123,
"browser_screen_scale_factor": 123,
"page": 123
}
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/serp/screenshot"
payload = {
"task_id": "<string>",
"browser_preset": "<string>",
"browser_screen_width": 123,
"browser_screen_height": 123,
"browser_screen_scale_factor": 123,
"page": 123
}
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({
task_id: '<string>',
browser_preset: '<string>',
browser_screen_width: 123,
browser_screen_height: 123,
browser_screen_scale_factor: 123,
page: 123
})
};
fetch('https://api.aisa.one/apis/v1/dataforseo/serp/screenshot', 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.aisa.one/apis/v1/dataforseo/serp/screenshot",
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([
'task_id' => '<string>',
'browser_preset' => '<string>',
'browser_screen_width' => 123,
'browser_screen_height' => 123,
'browser_screen_scale_factor' => 123,
'page' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.aisa.one/apis/v1/dataforseo/serp/screenshot"
payload := strings.NewReader("{\n \"task_id\": \"<string>\",\n \"browser_preset\": \"<string>\",\n \"browser_screen_width\": 123,\n \"browser_screen_height\": 123,\n \"browser_screen_scale_factor\": 123,\n \"page\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.aisa.one/apis/v1/dataforseo/serp/screenshot")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"task_id\": \"<string>\",\n \"browser_preset\": \"<string>\",\n \"browser_screen_width\": 123,\n \"browser_screen_height\": 123,\n \"browser_screen_scale_factor\": 123,\n \"page\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/dataforseo/serp/screenshot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"task_id\": \"<string>\",\n \"browser_preset\": \"<string>\",\n \"browser_screen_width\": 123,\n \"browser_screen_height\": 123,\n \"browser_screen_scale_factor\": 123,\n \"page\": 123\n}"
response = http.request(request)
puts response.read_body{
"version": "<string>",
"status_code": 123,
"status_message": "<string>",
"time": "<string>",
"cost": 123,
"tasks": [
"<string>"
],
"tasks[].id": "<string>",
"tasks[].status_code": 123,
"tasks[].status_message": "<string>",
"tasks[].result_count": 123,
"tasks[].path": [
"<string>"
],
"tasks[].data": {},
"tasks[].result": [
"<string>"
],
"tasks[].result[].items_count": 123,
"tasks[].result[].items": [
"<string>"
],
"tasks[].result[].items[].image": "<string>"
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
响应
成功响应
API 的当前版本
通用状态码
一般信息消息
执行时间(秒)
任务总成本(美元)
任务数组
UUID 格式的任务标识符
任务状态码
任务状态消息
结果数组中的元素数量
URL 路径
包含 POST 请求中指定的相同参数
结果数组
结果数组中的项目数量
项目数组
DataForSEO 存储中页面截图的 URL
⌘I