跳转到主要内容
POST
https://api.aisa.one/apis/v1
/
dataforseo
/
keywords_data
/
google_ads
/
keywords_for_site
/
live
设置实时“Keywords For Site”任务
curl --request POST \
  --url https://api.aisa.one/apis/v1/dataforseo/keywords_data/google_ads/keywords_for_site/live \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "target": "<string>",
  "target_type": "<string>",
  "location_name": "<string>",
  "location_code": 123,
  "location_coordinate": "<string>",
  "language_name": "<string>",
  "language_code": "<string>",
  "search_partners": true,
  "date_from": "<string>",
  "date_to": "<string>",
  "include_adult_keywords": true,
  "sort_by": "<string>",
  "tag": "<string>"
}
'
import requests

url = "https://api.aisa.one/apis/v1/dataforseo/keywords_data/google_ads/keywords_for_site/live"

payload = {
    "target": "<string>",
    "target_type": "<string>",
    "location_name": "<string>",
    "location_code": 123,
    "location_coordinate": "<string>",
    "language_name": "<string>",
    "language_code": "<string>",
    "search_partners": True,
    "date_from": "<string>",
    "date_to": "<string>",
    "include_adult_keywords": True,
    "sort_by": "<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({
    target: '<string>',
    target_type: '<string>',
    location_name: '<string>',
    location_code: 123,
    location_coordinate: '<string>',
    language_name: '<string>',
    language_code: '<string>',
    search_partners: true,
    date_from: '<string>',
    date_to: '<string>',
    include_adult_keywords: true,
    sort_by: '<string>',
    tag: '<string>'
  })
};

fetch('https://api.aisa.one/apis/v1/dataforseo/keywords_data/google_ads/keywords_for_site/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/keywords_data/google_ads/keywords_for_site/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([
    'target' => '<string>',
    'target_type' => '<string>',
    'location_name' => '<string>',
    'location_code' => 123,
    'location_coordinate' => '<string>',
    'language_name' => '<string>',
    'language_code' => '<string>',
    'search_partners' => true,
    'date_from' => '<string>',
    'date_to' => '<string>',
    'include_adult_keywords' => true,
    'sort_by' => '<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/keywords_data/google_ads/keywords_for_site/live"

	payload := strings.NewReader("{\n  \"target\": \"<string>\",\n  \"target_type\": \"<string>\",\n  \"location_name\": \"<string>\",\n  \"location_code\": 123,\n  \"location_coordinate\": \"<string>\",\n  \"language_name\": \"<string>\",\n  \"language_code\": \"<string>\",\n  \"search_partners\": true,\n  \"date_from\": \"<string>\",\n  \"date_to\": \"<string>\",\n  \"include_adult_keywords\": true,\n  \"sort_by\": \"<string>\",\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/keywords_data/google_ads/keywords_for_site/live")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"target\": \"<string>\",\n  \"target_type\": \"<string>\",\n  \"location_name\": \"<string>\",\n  \"location_code\": 123,\n  \"location_coordinate\": \"<string>\",\n  \"language_name\": \"<string>\",\n  \"language_code\": \"<string>\",\n  \"search_partners\": true,\n  \"date_from\": \"<string>\",\n  \"date_to\": \"<string>\",\n  \"include_adult_keywords\": true,\n  \"sort_by\": \"<string>\",\n  \"tag\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.aisa.one/apis/v1/dataforseo/keywords_data/google_ads/keywords_for_site/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  \"target\": \"<string>\",\n  \"target_type\": \"<string>\",\n  \"location_name\": \"<string>\",\n  \"location_code\": 123,\n  \"location_coordinate\": \"<string>\",\n  \"language_name\": \"<string>\",\n  \"language_code\": \"<string>\",\n  \"search_partners\": true,\n  \"date_from\": \"<string>\",\n  \"date_to\": \"<string>\",\n  \"include_adult_keywords\": true,\n  \"sort_by\": \"<string>\",\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.keyword": "<string>",
  "tasks.result.location_code": 123,
  "tasks.result.language_code": "<string>",
  "tasks.result.search_partners": true,
  "tasks.result.competition": "<string>",
  "tasks.result.competition_index": 123,
  "tasks.result.search_volume": 123,
  "tasks.result.low_top_of_page_bid": 123,
  "tasks.result.high_top_of_page_bid": 123,
  "tasks.result.cpc": 123,
  "tasks.result.monthly_searches": [
    "<string>"
  ],
  "tasks.result.monthly_searches.year": 123,
  "tasks.result.monthly_searches.month": 123,
  "tasks.result.monthly_searches.search_volume": 123,
  "tasks.result.keyword_annotations": {},
  "tasks.result.concepts": [
    "<string>"
  ],
  "tasks.result.concepts.name": "<string>",
  "tasks.result.concepts.concept_group": {},
  "tasks.result.concepts.concept_group.name": "<string>",
  "tasks.result.concepts.concept_group.type": "<string>"
}

授权

Authorization
string
header
必填

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

请求体

application/json
target
string
必填

域名或页面,必填字段。目标网站的域名或目标页面的 url;注意:如需获取目标网站的关键词,请使用 target_type 参数。

target_type
string

网站或 URL 的搜索关键词;可选字段。可能的值:site、page;默认值:page;如果设置为 site,将提供整个网站的关键词;如果设置为 page,将提供指定网页的关键词。

location_name
string

搜索引擎位置的完整名称 可选字段 如果未指定位置,您将收到全球结果,即所有可用位置的结果;如果使用此字段,则无需指定 location_code 或 location_coordinate 可通过向 https://api.dataforseo.com/v3/keywords_data/google_ads/locations 发出单独请求,获取搜索引擎可用位置及其 location_name 的列表 示例:London,England,United Kingdom

location_code
integer

搜索引擎位置代码,可选字段。如果不指定位置,您将收到全球结果,即所有可用位置的结果;如果使用此字段,则无需指定 location_name 或 location_coordinate;您可以单独向 https://api.dataforseo.com/v3/keywords_data/google_ads/locations 发出请求,以获取搜索引擎可用位置及其 location_code 的列表。示例:2840

location_coordinate
string

位置的 GPS 坐标,可选字段。如果不指定位置,您将收到全球结果,即所有可用位置的结果;如果使用此字段,则无需指定 location_name 或 location_code;location_coordinate 参数应以“latitude,longitude”格式指定;将提供指定坐标所属国家/地区的数据;示例:52.6178549,-155.352142

language_name
string

搜索引擎语言的完整名称 可选字段 可通过向 https://api.dataforseo.com/v3/keywords_data/google_ads/languages 单独发出请求,获取搜索引擎可用语言及其 language_name 的列表 示例:English

language_code
string

搜索引擎语言代码,可选字段;你可以通过向 https://api.dataforseo.com/v3/keywords_data/google_ads/languages 单独发起请求,获取搜索引擎可用语言及其 language_code 的列表;示例:en

search_partners
boolean

是否包含 Google 搜索合作伙伴 可选字段 如果指定 true,将返回 Google 自有、运营及联合网络,以及托管 Google 搜索的合作伙伴网站的结果;默认值:false – 仅返回 Google 搜索网站的结果

date_from
string

时间范围的开始日期 可选字段 日期格式:"yyyy-mm-dd" 最小值:当前日期往前 4 年 默认返回过去 12 个月的数据;注意:指定日期不得晚于 date_to 指定的日期和/或昨天;如果 Status 端点在 actual_data 字段中返回 false,则 date_from 可设置为上上个月或更早;如果 Status 端点在 actual_data 字段中返回 true,则 date_from 可设置为上个月或更早

date_to
string

时间范围的结束日期;可选字段。注意:指定的日期不能晚于昨天;如果不指定此字段,将默认使用昨天的日期。日期格式:"yyyy-mm-dd";示例:"2022-11-30"。

include_adult_keywords
boolean

包含与成人内容相关的关键词,可选字段。如果设置为 true,响应中将包含成人关键词,默认值:false。请注意,由于 Google Ads 的限制,API 可能不会返回此类关键词的数据

sort_by
string

结果排序参数,可选字段。使用这些参数按 relevance、search_volume、competition_index、low_top_of_page_bid 或 high_top_of_page_bid 对结果进行降序排序;默认值:relevance

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.keyword
string

POST 数组中的关键词

tasks.result.location_code
integer

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

tasks.result.language_code
string

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

tasks.result.search_partners
boolean

是否包含 Google 搜索合作伙伴 此值为设置任务时指定的值 如果为 true,则返回 Google 自有、自营网络以及托管 Google 搜索的合作伙伴网站联合网络中的结果;如果为 false,则仅返回 Google 搜索网站中的结果

tasks.result.competition
string

competition 表示给定关键词在付费 SERP 中的相对竞争程度;仅可能为以下值:LOW、MEDIUM、HIGH。如果竞争程度未知,则值为 null;有关此指标的更多信息,请参阅此帮助中心文章

tasks.result.competition_index
integer

竞争指数,表示查询关键词的广告位竞争程度;取值范围为 0 到 100。0 到 100 的竞争程度由已填充广告位数量除以可用广告位总数确定。如果没有足够的数据,该值为 null;有关此指标的更多信息,请参阅帮助中心文章

tasks.result.search_volume
integer

月均搜索量,表示给定关键词创意在 google.com 或 google.com 及其合作伙伴上的(近似)搜索次数,具体取决于用户的定向设置。如果没有数据,该值为 null。

tasks.result.low_top_of_page_bid
number

广告在第一页顶部展示的最低出价,表示高于约 20% 的广告实际展示最低出价(基于 Google Ads 的广告主统计数据)。该值可能因 POST 请求中指定的位置而异

tasks.result.high_top_of_page_bid
number

广告在第一页顶部展示的最高出价,表示高于约 80% 的广告实际展示最低出价(基于 Google Ads 的广告主统计数据)。该值可能因 POST 请求中指定的位置而异

tasks.result.cpc
number

每次点击费用,表示针对给定关键词展示的广告每次被点击时支付的金额(美元)

tasks.result.monthly_searches
string[]

月度搜索量,表示此关键词创意在过去十二个月内的大致搜索次数,并以指定地理位置为目标;如果没有数据,则值为 null

tasks.result.monthly_searches.year
integer

tasks.result.monthly_searches.month
integer

tasks.result.monthly_searches.search_volume
integer

月平均搜索量

tasks.result.keyword_annotations
object

关键词的注释

tasks.result.concepts
string[]

关键词的概念列表

tasks.result.concepts.name
string

concept_group 中关键词的概念名称

tasks.result.concepts.concept_group
object

概念详情的概念组

tasks.result.concepts.concept_group.name
string

概念组名称

tasks.result.concepts.concept_group.type
string

概念组类型