跳转到主要内容
POST
https://api.aisa.one/apis/v1
/
dataforseo
/
on_page
/
task_post
设置 OnPage 任务
curl --request POST \
  --url https://api.aisa.one/apis/v1/dataforseo/on_page/task_post \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "target": "<string>",
  "max_crawl_pages": 123,
  "start_url": "<string>",
  "force_sitewide_checks": true,
  "priority_urls": [
    "<string>"
  ],
  "max_crawl_depth": 123,
  "crawl_delay": 123,
  "store_raw_html": true,
  "enable_content_parsing": true,
  "support_cookies": true,
  "accept_language": "<string>",
  "custom_robots_txt": "<string>",
  "robots_txt_merge_mode": "<string>",
  "custom_user_agent": "<string>",
  "browser_preset": "<string>",
  "browser_screen_width": 123,
  "browser_screen_height": 123,
  "browser_screen_scale_factor": 123,
  "respect_sitemap": true,
  "custom_sitemap": "<string>",
  "crawl_sitemap_only": true,
  "load_resources": true,
  "enable_www_redirect_check": true,
  "enable_javascript": true,
  "enable_xhr": true,
  "enable_browser_rendering": true,
  "disable_cookie_popup": true,
  "custom_js": "<string>",
  "validate_micromarkup": true,
  "allow_subdomains": true,
  "allowed_subdomains": [
    "<string>"
  ],
  "disallowed_subdomains": [
    "<string>"
  ],
  "check_spell": true,
  "check_spell_language": "<string>",
  "check_spell_exceptions": [
    "<string>"
  ],
  "calculate_keyword_density": true,
  "checks_threshold": {},
  "disable_sitewide_checks": [
    "<string>"
  ],
  "disable_page_checks": [
    "<string>"
  ],
  "switch_pool": true,
  "return_despite_timeout": true,
  "tag": "<string>",
  "pingback_url": "<string>"
}
'
import requests

url = "https://api.aisa.one/apis/v1/dataforseo/on_page/task_post"

payload = {
"target": "<string>",
"max_crawl_pages": 123,
"start_url": "<string>",
"force_sitewide_checks": True,
"priority_urls": ["<string>"],
"max_crawl_depth": 123,
"crawl_delay": 123,
"store_raw_html": True,
"enable_content_parsing": True,
"support_cookies": True,
"accept_language": "<string>",
"custom_robots_txt": "<string>",
"robots_txt_merge_mode": "<string>",
"custom_user_agent": "<string>",
"browser_preset": "<string>",
"browser_screen_width": 123,
"browser_screen_height": 123,
"browser_screen_scale_factor": 123,
"respect_sitemap": True,
"custom_sitemap": "<string>",
"crawl_sitemap_only": True,
"load_resources": True,
"enable_www_redirect_check": True,
"enable_javascript": True,
"enable_xhr": True,
"enable_browser_rendering": True,
"disable_cookie_popup": True,
"custom_js": "<string>",
"validate_micromarkup": True,
"allow_subdomains": True,
"allowed_subdomains": ["<string>"],
"disallowed_subdomains": ["<string>"],
"check_spell": True,
"check_spell_language": "<string>",
"check_spell_exceptions": ["<string>"],
"calculate_keyword_density": True,
"checks_threshold": {},
"disable_sitewide_checks": ["<string>"],
"disable_page_checks": ["<string>"],
"switch_pool": True,
"return_despite_timeout": True,
"tag": "<string>",
"pingback_url": "<string>"
}
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({
target: '<string>',
max_crawl_pages: 123,
start_url: '<string>',
force_sitewide_checks: true,
priority_urls: ['<string>'],
max_crawl_depth: 123,
crawl_delay: 123,
store_raw_html: true,
enable_content_parsing: true,
support_cookies: true,
accept_language: '<string>',
custom_robots_txt: '<string>',
robots_txt_merge_mode: '<string>',
custom_user_agent: '<string>',
browser_preset: '<string>',
browser_screen_width: 123,
browser_screen_height: 123,
browser_screen_scale_factor: 123,
respect_sitemap: true,
custom_sitemap: '<string>',
crawl_sitemap_only: true,
load_resources: true,
enable_www_redirect_check: true,
enable_javascript: true,
enable_xhr: true,
enable_browser_rendering: true,
disable_cookie_popup: true,
custom_js: '<string>',
validate_micromarkup: true,
allow_subdomains: true,
allowed_subdomains: ['<string>'],
disallowed_subdomains: ['<string>'],
check_spell: true,
check_spell_language: '<string>',
check_spell_exceptions: ['<string>'],
calculate_keyword_density: true,
checks_threshold: {},
disable_sitewide_checks: ['<string>'],
disable_page_checks: ['<string>'],
switch_pool: true,
return_despite_timeout: true,
tag: '<string>',
pingback_url: '<string>'
})
};

fetch('https://api.aisa.one/apis/v1/dataforseo/on_page/task_post', 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/on_page/task_post",
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([
'target' => '<string>',
'max_crawl_pages' => 123,
'start_url' => '<string>',
'force_sitewide_checks' => true,
'priority_urls' => [
'<string>'
],
'max_crawl_depth' => 123,
'crawl_delay' => 123,
'store_raw_html' => true,
'enable_content_parsing' => true,
'support_cookies' => true,
'accept_language' => '<string>',
'custom_robots_txt' => '<string>',
'robots_txt_merge_mode' => '<string>',
'custom_user_agent' => '<string>',
'browser_preset' => '<string>',
'browser_screen_width' => 123,
'browser_screen_height' => 123,
'browser_screen_scale_factor' => 123,
'respect_sitemap' => true,
'custom_sitemap' => '<string>',
'crawl_sitemap_only' => true,
'load_resources' => true,
'enable_www_redirect_check' => true,
'enable_javascript' => true,
'enable_xhr' => true,
'enable_browser_rendering' => true,
'disable_cookie_popup' => true,
'custom_js' => '<string>',
'validate_micromarkup' => true,
'allow_subdomains' => true,
'allowed_subdomains' => [
'<string>'
],
'disallowed_subdomains' => [
'<string>'
],
'check_spell' => true,
'check_spell_language' => '<string>',
'check_spell_exceptions' => [
'<string>'
],
'calculate_keyword_density' => true,
'checks_threshold' => [

],
'disable_sitewide_checks' => [
'<string>'
],
'disable_page_checks' => [
'<string>'
],
'switch_pool' => true,
'return_despite_timeout' => true,
'tag' => '<string>',
'pingback_url' => '<string>'
]),
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/on_page/task_post"

payload := strings.NewReader("{\n \"target\": \"<string>\",\n \"max_crawl_pages\": 123,\n \"start_url\": \"<string>\",\n \"force_sitewide_checks\": true,\n \"priority_urls\": [\n \"<string>\"\n ],\n \"max_crawl_depth\": 123,\n \"crawl_delay\": 123,\n \"store_raw_html\": true,\n \"enable_content_parsing\": true,\n \"support_cookies\": true,\n \"accept_language\": \"<string>\",\n \"custom_robots_txt\": \"<string>\",\n \"robots_txt_merge_mode\": \"<string>\",\n \"custom_user_agent\": \"<string>\",\n \"browser_preset\": \"<string>\",\n \"browser_screen_width\": 123,\n \"browser_screen_height\": 123,\n \"browser_screen_scale_factor\": 123,\n \"respect_sitemap\": true,\n \"custom_sitemap\": \"<string>\",\n \"crawl_sitemap_only\": true,\n \"load_resources\": true,\n \"enable_www_redirect_check\": true,\n \"enable_javascript\": true,\n \"enable_xhr\": true,\n \"enable_browser_rendering\": true,\n \"disable_cookie_popup\": true,\n \"custom_js\": \"<string>\",\n \"validate_micromarkup\": true,\n \"allow_subdomains\": true,\n \"allowed_subdomains\": [\n \"<string>\"\n ],\n \"disallowed_subdomains\": [\n \"<string>\"\n ],\n \"check_spell\": true,\n \"check_spell_language\": \"<string>\",\n \"check_spell_exceptions\": [\n \"<string>\"\n ],\n \"calculate_keyword_density\": true,\n \"checks_threshold\": {},\n \"disable_sitewide_checks\": [\n \"<string>\"\n ],\n \"disable_page_checks\": [\n \"<string>\"\n ],\n \"switch_pool\": true,\n \"return_despite_timeout\": true,\n \"tag\": \"<string>\",\n \"pingback_url\": \"<string>\"\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/on_page/task_post")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target\": \"<string>\",\n \"max_crawl_pages\": 123,\n \"start_url\": \"<string>\",\n \"force_sitewide_checks\": true,\n \"priority_urls\": [\n \"<string>\"\n ],\n \"max_crawl_depth\": 123,\n \"crawl_delay\": 123,\n \"store_raw_html\": true,\n \"enable_content_parsing\": true,\n \"support_cookies\": true,\n \"accept_language\": \"<string>\",\n \"custom_robots_txt\": \"<string>\",\n \"robots_txt_merge_mode\": \"<string>\",\n \"custom_user_agent\": \"<string>\",\n \"browser_preset\": \"<string>\",\n \"browser_screen_width\": 123,\n \"browser_screen_height\": 123,\n \"browser_screen_scale_factor\": 123,\n \"respect_sitemap\": true,\n \"custom_sitemap\": \"<string>\",\n \"crawl_sitemap_only\": true,\n \"load_resources\": true,\n \"enable_www_redirect_check\": true,\n \"enable_javascript\": true,\n \"enable_xhr\": true,\n \"enable_browser_rendering\": true,\n \"disable_cookie_popup\": true,\n \"custom_js\": \"<string>\",\n \"validate_micromarkup\": true,\n \"allow_subdomains\": true,\n \"allowed_subdomains\": [\n \"<string>\"\n ],\n \"disallowed_subdomains\": [\n \"<string>\"\n ],\n \"check_spell\": true,\n \"check_spell_language\": \"<string>\",\n \"check_spell_exceptions\": [\n \"<string>\"\n ],\n \"calculate_keyword_density\": true,\n \"checks_threshold\": {},\n \"disable_sitewide_checks\": [\n \"<string>\"\n ],\n \"disable_page_checks\": [\n \"<string>\"\n ],\n \"switch_pool\": true,\n \"return_despite_timeout\": true,\n \"tag\": \"<string>\",\n \"pingback_url\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.aisa.one/apis/v1/dataforseo/on_page/task_post")

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 \"target\": \"<string>\",\n \"max_crawl_pages\": 123,\n \"start_url\": \"<string>\",\n \"force_sitewide_checks\": true,\n \"priority_urls\": [\n \"<string>\"\n ],\n \"max_crawl_depth\": 123,\n \"crawl_delay\": 123,\n \"store_raw_html\": true,\n \"enable_content_parsing\": true,\n \"support_cookies\": true,\n \"accept_language\": \"<string>\",\n \"custom_robots_txt\": \"<string>\",\n \"robots_txt_merge_mode\": \"<string>\",\n \"custom_user_agent\": \"<string>\",\n \"browser_preset\": \"<string>\",\n \"browser_screen_width\": 123,\n \"browser_screen_height\": 123,\n \"browser_screen_scale_factor\": 123,\n \"respect_sitemap\": true,\n \"custom_sitemap\": \"<string>\",\n \"crawl_sitemap_only\": true,\n \"load_resources\": true,\n \"enable_www_redirect_check\": true,\n \"enable_javascript\": true,\n \"enable_xhr\": true,\n \"enable_browser_rendering\": true,\n \"disable_cookie_popup\": true,\n \"custom_js\": \"<string>\",\n \"validate_micromarkup\": true,\n \"allow_subdomains\": true,\n \"allowed_subdomains\": [\n \"<string>\"\n ],\n \"disallowed_subdomains\": [\n \"<string>\"\n ],\n \"check_spell\": true,\n \"check_spell_language\": \"<string>\",\n \"check_spell_exceptions\": [\n \"<string>\"\n ],\n \"calculate_keyword_density\": true,\n \"checks_threshold\": {},\n \"disable_sitewide_checks\": [\n \"<string>\"\n ],\n \"disable_page_checks\": [\n \"<string>\"\n ],\n \"switch_pool\": true,\n \"return_despite_timeout\": true,\n \"tag\": \"<string>\",\n \"pingback_url\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "version": "<string>",
  "status_code": 123,
  "status_message": "<string>",
  "time": "<string>",
  "cost": 123,
  "tasks_count": 123,
  "tasks_error": 123,
  "tasks": [
    "<string>"
  ],
  "tasks.id": "<string>",
  "tasks.status_code": 123,
  "tasks.status_message": "<string>",
  "tasks.time": "<string>",
  "tasks.cost": 123,
  "tasks.result_count": 123,
  "tasks.path": [
    "<string>"
  ],
  "tasks.data": {},
  "tasks.result": [
    "<string>"
  ]
}

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
target
string
必填

目标域名,必填字段。应指定不含 https:// 和 www. 的域名。如果指定页面 URL,则将返回该 URL 所属域名的结果。

max_crawl_pages
integer
必填

已抓取页面数上限。必填字段。要在指定域名上抓取的页面数量。注意:如果将 max_crawl_pages 设置为 1,并且未指定 start_url 或将其设置为主页,则会禁用以下全站检查:test_canonicalization、enable_www_redirect_check、test_hidden_server_signature、test_page_not_found、test_directory_browsing、test_https_redirect。若仍需启用这些检查,请将 force_sitewide_checks 设置为 true。如果将 max_crawl_pages 设置为 1,并将 start_url 指定为主页以外的页面,则会禁用所有全站检查;若仍需启用这些检查,请将 force_sitewide_checks 设置为 true。

start_url
string

要抓取的第一个 URL,可选字段。注意:你应指定绝对 URL;如果要抓取单个页面,请在此字段中指定其 URL,并将 max_crawl_pages 参数设置为 1。你也可以使用实时 Instant Pages 端点获取特定页面的数据

force_sitewide_checks
boolean

抓取单个页面时启用全站检查;可选字段;设置为 true 可在抓取单个页面时获取全站检查数据;默认值:false。

priority_urls
string[]

绕过队列进行抓取的 URL,可选字段;此数组中指定的 URL 将优先抓取并绕过抓取队列;注意:应指定绝对 URL;最多可以指定 20 个 URL;数组中的所有 URL 都必须属于目标域名;除非将 allow_subdomains 参数设置为 true,否则将忽略子域名;示例:"priority_urls": [ "https://dataforseo.com/apis/serp-api", "https://dataforseo.com/contact" ]

max_crawl_depth
integer

抓取深度,可选字段,即待抓取页面的链接层级深度;例如,抓取起始页面为第 0 层,该页面所链接的页面为第 1 层,依此类推。

crawl_delay
integer

请求之间的延迟(毫秒),可选字段;爬虫向服务器发起请求时的自定义间隔,默认值:2000

store_raw_html
boolean

存储已抓取页面的 HTML 可选字段;如果要使用 OnPage Raw HTML 端点获取页面的 HTML,请设置为 true;默认值:false

enable_content_parsing
boolean

解析已抓取页面上的内容;可选字段;设置为 true 以使用 OnPage Content Parsing 端点;默认值:false

support_cookies
boolean

是否在抓取的页面上支持 Cookie;可选字段,设置为 true 可在抓取页面时支持 Cookie;默认值:false

accept_language
string

用于访问网站的语言标头,可选字段。支持所有区域设置格式(xx、xx-XX、xxx-XX 等)。注意:如果未指定此参数,某些网站可能会拒绝访问;在这种情况下,响应数组中返回的页面将包含 "type":"broken

custom_robots_txt
string

自定义 robots.txt 设置,可选字段,示例:Disallow: /directory1/

robots_txt_merge_mode
string

合并或覆盖 robots.txt 设置 可选字段 可选值:merge、override;如果要忽略网站抓取限制及其他 robots.txt 设置,请设为 override 默认值:merge;注意:如果设为 override,请指定 custom_robots_txt 参数

custom_user_agent
string

自定义用户代理。可选字段,用于抓取网站的自定义用户代理。示例:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36。默认值:Mozilla/5.0 (compatible; RSiteAuditor)

browser_preset
string

浏览器屏幕参数预设,可选字段;如果使用此字段,则无需指定 browser_screen_width、browser_screen_height、browser_screen_scale_factor;可用值:desktop、mobile、tablet;desktop 预设将应用以下值:browser_screen_width: 1920 browser_screen_height: 1080 browser_screen_scale_factor: 1;mobile 预设将应用以下值:browser_screen_width: 390 browser_screen_height: 844 browser_screen_scale_factor: 3;tablet 预设将应用以下值:browser_screen_width: 1024 browser_screen_height: 1366 browser_screen_scale_factor: 2 注意:要使用此参数,请将 enable_javascript 或 enable_browser_rendering 设置为 true

browser_screen_width
integer

浏览器屏幕宽度,可选字段;你可以设置自定义浏览器屏幕宽度,以针对特定设备执行审计;如果使用此字段,则无需指定 browser_preset,因为它将被忽略;注意:要使用此参数,请将 enable_javascript 或 enable_browser_rendering 设置为 true;最小值(像素):240;最大值(像素):9999

browser_screen_height
integer

浏览器屏幕高度,可选字段;你可以设置自定义浏览器屏幕高度,以针对特定设备执行审计;如果使用此字段,则无需指定 browser_preset,因为它将被忽略;注意:要使用此参数,请将 enable_javascript 或 enable_browser_rendering 设置为 true;最小值(像素):240;最大值(像素):9999

browser_screen_scale_factor
number

浏览器屏幕缩放系数;可选字段。您可以设置自定义浏览器屏幕分辨率比例,以针对特定设备执行审计;如果使用此字段,则无需指定 browser_preset,因为该参数将被忽略。注意:要使用此参数,请将 enable_javascript 或 enable_browser_rendering 设置为 true;最小值:0.5;最大值:3

respect_sitemap
boolean

抓取时遵循站点地图;可选字段。如果希望抓取时按照主站点地图中指定的页面顺序,请设置为 true;默认值:false。注意:如果设置为 true,API 响应中的 click_depth 值将等于 0;请求中的 max_crawl_depth 字段将被忽略,您可以使用 max_crawl_pages 参数指定要抓取的页面数量

custom_sitemap
string

自定义站点地图 URL,可选字段,即替代站点地图所在页面的 URL。注意:如果要使用此参数,respect_sitemap 应为 true

crawl_sitemap_only
boolean

仅抓取站点地图中指定的页面;可选字段;如果只想抓取站点地图中指定的页面,请设置为 true;如果将此参数设置为 true 且未指定 custom_sitemap,我们将抓取默认站点地图;默认值:false;注意:如果要使用此参数,respect_sitemap 应为 true

load_resources
boolean

加载资源;可选字段;如果要加载图片、样式表、脚本和损坏的资源,请设置为 true;默认值:false;注意:如果使用此参数,将产生额外费用;有关使用此参数的任务费用,请参阅我们的帮助文章;费用可以在定价页面上计算

enable_www_redirect_check
boolean

检查域名是否实现 www 重定向。可选字段,如果要检查请求的域名是否实现从 www 到非 www 或从非 www 到 www 的重定向,请设置为 true;默认值:false

enable_javascript
boolean

在页面上加载 JavaScript。可选字段。如果要加载页面上可用的脚本,请设置为 true。默认值:false。注意:使用此参数将产生额外费用;有关使用此参数的任务费用,请参阅我们的帮助文章;费用可在定价页面上计算

enable_xhr
boolean

在页面上启用 XMLHttpRequest;可选字段;如果希望爬虫使用 XMLHttpRequest 对象从 Web 服务器请求数据,请将其设置为 true;默认值:false;如果使用此字段,enable_javascript 必须设置为 true;

enable_browser_rendering
boolean

模拟浏览器渲染以测量 Core Web Vitals 可选字段 使用此参数可在加载网页时模拟浏览器;enable_browser_rendering 会加载页面上的样式、图像、字体、动画、视频及其他资源;默认值:false 设置为 true 可在响应中获取 Core Web Vitals(FID、CLS、LCP)指标;如果使用此字段,enable_javascript 和 load_resources 参数必须设置为 true 注意:使用此参数会产生额外费用;有关使用此参数的任务费用,请参阅我们的帮助文章;具体费用可在 Pricing Page 上计算

禁用 Cookie 弹窗 可选字段;如果要禁用请求用户同意使用 Cookie 的弹窗,请设置为 true;默认值:false

custom_js
string

自定义 JavaScript,可选字段。请注意,此处输入脚本的最长执行时间应为 700 ms。例如,可以使用以下 JS 代码片段检查网站是否包含将 Google Tag Manager 作为 scr 属性:let meta = { haveGoogleAnalytics: false, haveTagManager: false }; for (var i = 0; i = 0) meta.haveGoogleAnalytics = true; if (src.indexOf("gtm.js") >= 0) meta.haveTagManager = true; } } meta;返回值取决于您在此字段中指定的内容。例如,如果指定以下脚本:meta = {}; meta.url = document.URL; meta.test = 'test'; meta; 则响应中将包含以下数据:"custom_js_response": { "url": "https://dataforseo.com/", "test": "test" } 注意:输入的脚本长度不得超过 2000 个字符。注意:使用此参数将产生额外费用;有关使用此参数的任务费用,请参阅我们的帮助文章;费用可在定价页面计算

validate_micromarkup
boolean

启用微数据验证;可选字段。如果要使用 OnPage API Microdata 端点,请设置为 true;默认值:false

allow_subdomains
boolean

包含子域名上的页面,可选字段;如果要抓取目标网站的所有子域名,请设置为 true,默认值:false

allowed_subdomains
string[]

要抓取的子域名;可选字段;指定要抓取的子域名;示例:["blog.site.com", "my.site.com", "shop.site.com"];注意:要使用此参数,应将 allow_subdomains 参数设置为 false;否则,allowed_subdomains 字段的内容将被忽略,并返回所有子域名的结果

disallowed_subdomains
string[]

不抓取的子域名,可选字段。指定不希望抓取的子域名。示例:["status.site.com", "docs.site.com"] 注意:要使用此参数,应将 allow_subdomains 参数设置为 true

check_spell
boolean

检查拼写,可选字段;设为 true 时使用 Hunspell 库检查网站上的拼写;默认值:false

check_spell_language
string

拼写检查的语言,可选字段。支持的语言:‘hy’、‘eu’、‘bg’、‘ca’、‘hr’、‘cs’、‘da’、‘nl’、‘en’、‘eo’、‘et’、‘fo’、‘fa’、‘fr’、‘fy’、‘gl’、‘ka’、‘de’、‘el’、‘he’、‘hu’、‘is’、‘ia’、‘ga’、‘it’、‘rw’、‘la’、‘lv’、‘lt’、‘mk’、‘mn’、‘ne’、‘nb’、‘nn’、‘pl’、‘pt’、‘ro’、‘gd’、‘sr’、‘sk’、‘sl’、‘es’、‘sv’、‘tr’、‘tk’、‘uk’、‘vi’。注意:如果未指定语言,系统将根据页面内容自动设置。

check_spell_exceptions
string[]

不进行拼写检查的单词,可选字段。指定要从拼写检查中排除的单词。单词最大长度:100 个字符;单词数量上限:1000。示例:"SERP", "minifiers", "JavaScript"

calculate_keyword_density
boolean

计算目标域名的关键词密度,可选字段。如果希望计算网站页面的关键词密度,请设置为 true。默认值:false。注意:使用此参数将产生额外费用;有关使用此参数的任务费用,请参阅我们的帮助文章。爬取完成后,您可以通过 Keyword Density 端点获取关键词密度值。

checks_threshold
object

检查项的自定义阈值;这是一个可选字段,可用于为 OnPage API 响应的 checks 对象中包含的参数指定自定义阈值;注意:只能修改整数阈值;例如,high_loading_time 和 large_page_size 参数的默认值分别设置为 3 秒和 1 兆字节;如果要将这些阈值更改为 1 秒和 1000 千字节,请使用以下代码片段:"checks_threshold": { "high_loading_time": 1, "large_page_size": 1000 }可自定义的参数及其默认值:"title_too_short",默认值:30,类型:"int";"title_too_long",默认值:65,类型:"int";"small_page_size",默认值:1024,类型:"int";"large_page_size",默认值:1048576 (1024 * 1024),类型:"int";"low_character_count",默认值:1024,类型:"int";"high_character_count",默认值:256000 (250 * 1024),类型:"int";"low_content_rate",默认值:0.1,类型:"float";"high_content_rate",默认值:0.9,类型:"float";"high_loading_time",默认值:3000,类型:"int";"high_waiting_time",默认值:1500,类型:"int";"low_readability_rate",默认值:15.0,类型:"float";"irrelevant_description",默认值:0.2,类型:"float";"irrelevant_title",默认值:0.3,类型:"float";"irrelevant_meta_keywords",默认值:0.6,类型:"float"

disable_sitewide_checks
string[]

阻止运行特定的全站检查,可选字段。指定以下检查可阻止其在目标网站上运行:"test_page_not_found" "test_canonicalization" "test_https_redirect" "test_directory_browsing"。示例:"disable_sitewide_checks": ["test_directory_browsing", "test_page_not_found"]。更多信息请参阅我们的帮助中心。

disable_page_checks
string[]

阻止运行特定页面检查。可选字段,指定要阻止运行的特定检查,避免其影响 onpage_score。示例:"disable_page_checks": ["is_5xx_code", "is_4xx_code"]

switch_pool
boolean

切换代理池,可选字段;如果为 true,将使用其他代理池获取请求的数据;当同时设置大量任务,偶尔出现限流和/或 site_unreachable 错误时,可以使用此参数

return_despite_timeout
boolean

即使发生超时错误仍返回页面数据,可选字段;如果为 true,将提供未能在 120 秒内加载并返回超时错误的页面数据;默认值:false

tag
string

用户定义的任务标识符。可选字段。字符数限制为 255。您可以使用此参数标识任务并将其与结果匹配;您将在响应的 data 对象中找到指定的 tag 值

pingback_url
string

已完成任务的通知 URL。可选字段。任务完成后,我们将通过向您指定的 URL 发送 GET 请求来通知您。您可以使用字符串 ‘$id’ 作为 $id 变量,并使用 ‘$tag’ 作为经过 urlencoded 编码的 $tag 变量。我们会在发送请求前设置必要的值。示例:http://your-server.com/pingscript?id=$id http://your-server.com/pingscript?id=$id&tag=$tag 注意:pingback_url 中的特殊字符将经过 urlencoded 编码;例如,# 字符将被编码为 %23。请在我们的帮助中心了解更多信息

响应

成功响应

version
string

API 的当前版本

status_code
integer

通用状态码;您可以在此处查看完整的响应码列表。注意:我们强烈建议设计必要的系统来处理相关异常或错误情况

status_message
string

常规信息消息;可在此处查看常规信息消息的完整列表

time
string

执行时间(秒)

cost
number

任务总成本(美元)

tasks_count
integer

tasks 数组中的任务数量

tasks_error
integer

返回错误的 tasks 数组中的任务数量

tasks
string[]

任务数组

tasks.id
string

任务标识符,系统中采用 UUID 格式的唯一任务标识符

tasks.status_code
integer

DataForSEO 生成的任务状态码;范围为:10000-60000;完整响应代码列表可在此处查看

tasks.status_message
string

任务的信息性消息,你可以在此处查看通用信息性消息的完整列表

tasks.time
string

执行时间(秒)

tasks.cost
number

任务成本(美元)

tasks.result_count
integer

结果数组中的元素数量

tasks.path
string[]

URL 路径

tasks.data
object

包含您在 POST 请求中指定的相同参数

tasks.result
string[]

结果数组;在此情况下,该值将为 null