跳转到主要内容
POST
https://api.aisa.one/apis/v1
/
dataforseo
/
dataforseo_labs
/
google
/
historical_bulk_traffic_estimation
/
live
历史批量流量估算
curl --request POST \
  --url https://api.aisa.one/apis/v1/dataforseo/dataforseo_labs/google/historical_bulk_traffic_estimation/live \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "targets": [
    "<string>"
  ],
  "location_name": "<string>",
  "location_code": 123,
  "language_name": "<string>",
  "language_code": "<string>",
  "date_from": "<string>",
  "date_to": "<string>",
  "ignore_synonyms": true,
  "item_types": [
    "<string>"
  ],
  "tag": "<string>"
}
'
import requests

url = "https://api.aisa.one/apis/v1/dataforseo/dataforseo_labs/google/historical_bulk_traffic_estimation/live"

payload = {
"targets": ["<string>"],
"location_name": "<string>",
"location_code": 123,
"language_name": "<string>",
"language_code": "<string>",
"date_from": "<string>",
"date_to": "<string>",
"ignore_synonyms": True,
"item_types": ["<string>"],
"tag": "<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({
targets: ['<string>'],
location_name: '<string>',
location_code: 123,
language_name: '<string>',
language_code: '<string>',
date_from: '<string>',
date_to: '<string>',
ignore_synonyms: true,
item_types: ['<string>'],
tag: '<string>'
})
};

fetch('https://api.aisa.one/apis/v1/dataforseo/dataforseo_labs/google/historical_bulk_traffic_estimation/live', 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/dataforseo_labs/google/historical_bulk_traffic_estimation/live",
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([
'targets' => [
'<string>'
],
'location_name' => '<string>',
'location_code' => 123,
'language_name' => '<string>',
'language_code' => '<string>',
'date_from' => '<string>',
'date_to' => '<string>',
'ignore_synonyms' => true,
'item_types' => [
'<string>'
],
'tag' => '<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/dataforseo_labs/google/historical_bulk_traffic_estimation/live"

payload := strings.NewReader("{\n \"targets\": [\n \"<string>\"\n ],\n \"location_name\": \"<string>\",\n \"location_code\": 123,\n \"language_name\": \"<string>\",\n \"language_code\": \"<string>\",\n \"date_from\": \"<string>\",\n \"date_to\": \"<string>\",\n \"ignore_synonyms\": true,\n \"item_types\": [\n \"<string>\"\n ],\n \"tag\": \"<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/dataforseo_labs/google/historical_bulk_traffic_estimation/live")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"targets\": [\n \"<string>\"\n ],\n \"location_name\": \"<string>\",\n \"location_code\": 123,\n \"language_name\": \"<string>\",\n \"language_code\": \"<string>\",\n \"date_from\": \"<string>\",\n \"date_to\": \"<string>\",\n \"ignore_synonyms\": true,\n \"item_types\": [\n \"<string>\"\n ],\n \"tag\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.aisa.one/apis/v1/dataforseo/dataforseo_labs/google/historical_bulk_traffic_estimation/live")

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 \"targets\": [\n \"<string>\"\n ],\n \"location_name\": \"<string>\",\n \"location_code\": 123,\n \"language_name\": \"<string>\",\n \"language_code\": \"<string>\",\n \"date_from\": \"<string>\",\n \"date_to\": \"<string>\",\n \"ignore_synonyms\": true,\n \"item_types\": [\n \"<string>\"\n ],\n \"tag\": \"<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>"
  ],
  "tasks.result.se_type": "<string>",
  "tasks.result.location_code": 123,
  "tasks.result.language_code": "<string>",
  "tasks.result.total_count": 123,
  "tasks.result.items_count": 123,
  "tasks.result.items": [
    "<string>"
  ],
  "tasks.result.items.se_type": "<string>",
  "tasks.result.items.target": "<string>",
  "tasks.result.items.metrics": {},
  "tasks.result.items.metrics.organic": [
    "<string>"
  ],
  "tasks.result.items.metrics.organic.year": 123,
  "tasks.result.items.metrics.organic.month": 123,
  "tasks.result.items.metrics.organic.etv": 123,
  "tasks.result.items.metrics.organic.count": 123,
  "tasks.result.items.metrics.paid": [
    "<string>"
  ],
  "tasks.result.items.metrics.paid.year": 123,
  "tasks.result.items.metrics.paid.month": 123,
  "tasks.result.items.metrics.paid.etv": 123,
  "tasks.result.items.metrics.paid.count": 123,
  "tasks.result.items.metrics.featured_snippet": [
    "<string>"
  ],
  "tasks.result.items.metrics.featured_snippet.year": 123,
  "tasks.result.items.metrics.featured_snippet.month": 123,
  "tasks.result.items.metrics.featured_snippet.etv": 123,
  "tasks.result.items.metrics.featured_snippet.count": 123,
  "tasks.result.items.metrics.local_pack": [
    "<string>"
  ],
  "tasks.result.items.metrics.local_pack.year": 123,
  "tasks.result.items.metrics.local_pack.month": 123,
  "tasks.result.items.metrics.local_pack.etv": 123,
  "tasks.result.items.metrics.local_pack.count": 123
}

授权

Authorization
string
header
必填

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

请求体

application/json
targets
string[]
必填

目标域名和子域名,必填字段。可在此字段中指定域名和子域名;指定时不应包含 https:// 和 www.;最多可设置 1000 个域名或子域名

location_name
string

位置的完整名称。如果使用此字段,则无需指定 location_code。您可以通过向 https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages 单独发出请求,获取包含 location_name 的可用位置列表。忽略此字段可获取所有可用位置的结果。示例:United Kingdom

location_code
integer

位置代码 如果使用此字段,则无需指定 location_name 可以通过向 https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages 单独发送请求,获取包含 location_code 的可用位置列表 忽略此字段可获取所有可用位置的结果 示例:2840

language_name
string

语言的完整名称。如果使用此字段,则无需指定 language_code。您可以通过向 https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages 单独发出请求,获取包含 language_name 的可用语言列表。忽略此字段可获取所有可用语言的结果。示例:English

language_code
string

语言代码;如果使用此字段,则无需指定 language_name。你可以通过向 https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages 单独发起请求,获取可用语言及其 language_code 列表。忽略此字段可获取所有可用语言的结果。示例:en

date_from
string

时间范围的起始日期,可选字段;如果未指定此字段,将提供过去 12 个月的数据;最小可用值:2020-10-01;日期格式:"yyyy-mm-dd"

date_to
string

时间范围的结束日期,可选字段。如果未指定此字段,默认使用当天日期;日期格式:"yyyy-mm-dd";示例:"2021-04-01"

ignore_synonyms
boolean

忽略高度相似的关键词,可选字段。如果设置为 true,则仅返回核心关键词,并排除所有高度相似的关键词;默认值:false

item_types
string[]

按项目类型显示结果,可选字段。指示响应中包含的搜索结果类型;注意:如果 item_types 数组包含 organic 以外的项目类型,结果将按数组中的第一个项目类型排序;可选值:["organic", "paid", "featured_snippet", "local_pack"]。默认值:["organic", "paid"]

tag
string

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

响应

成功响应

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[]

结果数组

tasks.result.se_type
string

搜索引擎类型

tasks.result.location_code
integer

POST 数组中的位置代码;如果没有数据,则值为 null

tasks.result.language_code
string

POST 数组中的语言代码;如果没有数据,则值为 null

tasks.result.total_count
integer

数据库中与您的请求相关的结果总量

tasks.result.items_count
integer

items 数组中返回的结果数量

tasks.result.items
string[]

包含相关流量估算数据的项目数组

tasks.result.items.se_type
string

搜索引擎类型

tasks.result.items.target
string

POST 数组中的目标域名

tasks.result.items.metrics
object

与指定域名相关的流量数据

tasks.result.items.metrics.organic
string[]

自然搜索流量数据

tasks.result.items.metrics.organic.year
integer

所提供数据对应的年份

tasks.result.items.metrics.organic.month
integer

数据对应的月份

tasks.result.items.metrics.organic.etv
number

预估流量 域名的预估自然搜索月流量,计算方式为该域名参与排名的所有关键词的 CTR(点击率)与搜索量之乘积的总和;有关此指标计算方式的更多信息,请参阅此帮助中心文章

tasks.result.items.metrics.organic.count
integer

包含该域名的自然搜索 SERP 总数

tasks.result.items.metrics.paid
string[]

付费搜索的流量数据

tasks.result.items.metrics.paid.year
integer

所提供数据对应的年份

tasks.result.items.metrics.paid.month
integer

数据对应的月份

tasks.result.items.metrics.paid.etv
number

预估流量:域名的预估每月付费流量,计算方式为该域名排名涉及的所有关键词的 CTR(点击率)与搜索量之积;有关此指标计算方式的更多信息,请参阅此帮助中心文章

tasks.result.items.metrics.paid.count
integer

包含该域名的付费 SERP 总数

来自 Google SERP 精选摘要结果的流量数据

所提供数据对应的年份

数据对应的月份

预估流量;域名的预估每月付费流量,计算方式为该域名在相应类别中有排名的所有关键词的 CTR(点击率)与搜索量之乘积。有关该指标计算方式的更多信息,请参阅此帮助中心文章

包含该域名的精选摘要项总数

tasks.result.items.metrics.local_pack
string[]

SERP 本地结果包中的流量数据

tasks.result.items.metrics.local_pack.year
integer

所提供数据对应的年份

tasks.result.items.metrics.local_pack.month
integer

数据对应的月份

tasks.result.items.metrics.local_pack.etv
number

预估流量;域名的预估每月付费流量,计算方式为该域名在相应类别中有排名的所有关键词的 CTR(点击率)与搜索量之乘积。有关该指标计算方式的更多信息,请参阅此帮助中心文章

tasks.result.items.metrics.local_pack.count
integer

包含该域名的本地结果包条目总数