跳转到主要内容
POST
https://api.aisa.one/apis/v1
/
dataforseo
/
business_data
/
google
/
extended_reviews
/
task_post
设置 Business Data Google 扩展评论任务
curl --request POST \
  --url https://api.aisa.one/apis/v1/dataforseo/business_data/google/extended_reviews/task_post \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "keyword": "<string>",
  "cid": "<string>",
  "place_id": "<string>",
  "location_name": "<string>",
  "location_code": 123,
  "location_coordinate": "<string>",
  "language_name": "<string>",
  "language_code": "<string>",
  "priority": 123,
  "depth": 123,
  "tag": "<string>",
  "postback_url": "<string>",
  "pingback_url": "<string>"
}
'
import requests

url = "https://api.aisa.one/apis/v1/dataforseo/business_data/google/extended_reviews/task_post"

payload = {
"keyword": "<string>",
"cid": "<string>",
"place_id": "<string>",
"location_name": "<string>",
"location_code": 123,
"location_coordinate": "<string>",
"language_name": "<string>",
"language_code": "<string>",
"priority": 123,
"depth": 123,
"tag": "<string>",
"postback_url": "<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({
keyword: '<string>',
cid: '<string>',
place_id: '<string>',
location_name: '<string>',
location_code: 123,
location_coordinate: '<string>',
language_name: '<string>',
language_code: '<string>',
priority: 123,
depth: 123,
tag: '<string>',
postback_url: '<string>',
pingback_url: '<string>'
})
};

fetch('https://api.aisa.one/apis/v1/dataforseo/business_data/google/extended_reviews/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/business_data/google/extended_reviews/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([
'keyword' => '<string>',
'cid' => '<string>',
'place_id' => '<string>',
'location_name' => '<string>',
'location_code' => 123,
'location_coordinate' => '<string>',
'language_name' => '<string>',
'language_code' => '<string>',
'priority' => 123,
'depth' => 123,
'tag' => '<string>',
'postback_url' => '<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/business_data/google/extended_reviews/task_post"

payload := strings.NewReader("{\n \"keyword\": \"<string>\",\n \"cid\": \"<string>\",\n \"place_id\": \"<string>\",\n \"location_name\": \"<string>\",\n \"location_code\": 123,\n \"location_coordinate\": \"<string>\",\n \"language_name\": \"<string>\",\n \"language_code\": \"<string>\",\n \"priority\": 123,\n \"depth\": 123,\n \"tag\": \"<string>\",\n \"postback_url\": \"<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/business_data/google/extended_reviews/task_post")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"keyword\": \"<string>\",\n \"cid\": \"<string>\",\n \"place_id\": \"<string>\",\n \"location_name\": \"<string>\",\n \"location_code\": 123,\n \"location_coordinate\": \"<string>\",\n \"language_name\": \"<string>\",\n \"language_code\": \"<string>\",\n \"priority\": 123,\n \"depth\": 123,\n \"tag\": \"<string>\",\n \"postback_url\": \"<string>\",\n \"pingback_url\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.aisa.one/apis/v1/dataforseo/business_data/google/extended_reviews/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 \"keyword\": \"<string>\",\n \"cid\": \"<string>\",\n \"place_id\": \"<string>\",\n \"location_name\": \"<string>\",\n \"location_code\": 123,\n \"location_coordinate\": \"<string>\",\n \"language_name\": \"<string>\",\n \"language_code\": \"<string>\",\n \"priority\": 123,\n \"depth\": 123,\n \"tag\": \"<string>\",\n \"postback_url\": \"<string>\",\n \"pingback_url\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "version": "<string>",
  "version.status_code": 123,
  "version.status_message": "<string>",
  "version.time": "<string>",
  "version.cost": 123,
  "version.tasks_count": 123,
  "version.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": {},
  "result": [
    "<string>"
  ]
}

授权

Authorization
string
header
必填

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

请求体

application/json
keyword
string
必填

keyword 如果未指定 cidplace_id,则为必填字段 您指定的关键词应表示本地商家的名称;keyword 字段最多可指定 700 个字符;所有 %## 都将被解码(加号字符 ‘+’ 将被解码为空格字符)如果需要在 keyword 中使用“%”字符,请将其指定为“%25”;如果此字段包含 ‘allinanchor:’、‘allintext:’、‘allintitle:’、‘allinurl:’、‘define:’、‘filetype:’、‘id:’、‘inanchor:’、‘info:’、‘intext:’、‘intitle:’、‘inurl:’、‘link:’、‘related:’、‘site:’ 等参数,每个任务的费用将乘以 5 注意:不支持包含 ‘cache:’ 参数的查询,这类查询将返回验证错误;有关 DataForSEO API 中 keywordkeywords 字段的规则和限制,请参阅此帮助中心文章 注意:如果使用此字段,涉及 Google Reviews API 的任务将按标准费率的三倍向您的账户收费

cid
string
必填

由 Google 定义的商家实体唯一 id 如果未指定 keywordplace_id,则为必填字段 示例:194604053573767737 有关此标识符的更多信息,请参阅此帮助中心文章注意:如果使用此字段,涉及 Google Reviews API 的任务将按标准费率的两倍向您的账户收费

place_id
string
必填

Google Maps 中商业实体的标识符 如果未指定 keywordcid,则此字段为必填字段 示例:GhIJQWDl0CIeQUARxks3icF8U8A。有关该标识符的更多信息,请参阅此帮助中心文章注意:如果使用此字段,对于涉及 Google Reviews API 的任务,您的账户将按标准费率的两倍收费

location_name
string
必填

搜索引擎位置的完整名称 如果未指定 location_code location_coordinate则此字段为必填字段。如果使用此字段,则无需指定 location_codelocation_coordinate。您可以单独请求 https://api.dataforseo.com/v3/business_data/google/locations,获取包含 location_name 的可用位置列表。示例:London,England,United Kingdom

location_code
integer
必填

搜索引擎位置代码 如果未指定 location_namelocation_coordinate则为必填字段;如果使用此字段,则无需指定 location_namelocation_coordinate。您可以通过向 https://api.dataforseo.com/v3/business_data/google/locations 单独发送请求,获取包含 location_code 的可用位置列表。示例:2840

location_coordinate
string
必填

位置的 GPS 坐标 如果未指定 location_namelocation_code则为必填字段;如果使用此字段,则无需指定 location_namelocation_codelocation_coordinate 参数应以 “latitude,longitude,radius” 格式指定;“latitude”“longitude” 的最大小数位数:7;“radius” 的最小值:199.9。示例:53.476225,-2.243572,200

language_name
string
必填

搜索引擎语言的完整名称 未指定 language_code 时为必填字段;如果使用此字段,则无需指定 language_code;您可以通过向 https://api.dataforseo.com/v3/business_data/google/languages 单独发送请求,获取包含 language_name 的可用语言列表;示例:English

language_code
string
必填

搜索引擎语言代码 未指定 language_name 时为必填字段;如果使用此字段,则无需指定 language_name;您可以通过向 https://api.dataforseo.com/v3/business_data/google/languages 单独发送请求,获取包含 language_code 的可用语言列表;示例:en

priority
integer

任务优先级 可选字段 可采用以下值:1 – 普通执行优先级(默认设置)2 – 高执行优先级 使用高执行优先级的任务将额外收费。费用可在定价页面计算。

depth
integer

解析深度 可选字段 SERP 中的评论数量;强烈建议将解析深度设置为二十的倍数,因为我们的系统每次连续处理二十条评论;默认值:20;最大值:1000每个包含最多 20 条结果的 SERP 都会向您的账户收费;如果搜索引擎返回超过 20 条结果,将深度设置为 20 以上可能会产生额外费用;费用可在 Pricing 页面计算。

tag
string

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

postback_url
string

用于发送任务结果的返回 URL,可选字段。任务完成后,我们会向您指定的 postback_url 发送 POST 请求,结果将以 gzip 格式压缩。您可以将字符串 ‘$id’ 用作 $id 变量,并将 ‘$tag’ 用作经过 URL 编码的 $tag 变量。我们将在发送请求前设置必要的值。示例:http://your-server.com/postbackscript?id=$id http://your-server.com/postbackscript?id=$id&tag=$tag 注意:postback_url 中的特殊字符将经过 URL 编码;例如,# 字符将编码为 %23。有关更多信息,请参阅我们的帮助中心

pingback_url
string

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

响应

成功响应

version
string

API 的当前版本

version.status_code
integer

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

version.status_message
string

一般信息消息 你可以在此处查看一般信息消息的完整列表

version.time
string

执行时间(秒)

version.cost
number

任务总成本(美元)

version.tasks_count
integer

tasks数组中的任务数量

version.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

result 数组中的元素数量

tasks.path
string[]

URL 路径

tasks.data
object

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

result
string[]

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