跳转到主要内容
POST
https://api.aisa.one/apis/v1
/
dataforseo
/
business_data
/
google
/
questions_and_answers
/
live
设置实时 Google My Business 问题与回答任务
curl --request POST \
  --url https://api.aisa.one/apis/v1/dataforseo/business_data/google/questions_and_answers/live \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "keyword": "<string>",
  "location_name": "<string>",
  "location_code": 123,
  "location_coordinate": "<string>",
  "language_name": "<string>",
  "language_code": "<string>",
  "depth": 123,
  "tag": "<string>"
}
'
import requests

url = "https://api.aisa.one/apis/v1/dataforseo/business_data/google/questions_and_answers/live"

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

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

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

url = URI("https://api.aisa.one/apis/v1/dataforseo/business_data/google/questions_and_answers/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 \"keyword\": \"<string>\",\n \"location_name\": \"<string>\",\n \"location_code\": 123,\n \"location_coordinate\": \"<string>\",\n \"language_name\": \"<string>\",\n \"language_code\": \"<string>\",\n \"depth\": 123,\n \"tag\": \"<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>"
  ],
  "result.keyword": "<string>",
  "result.se_domain": "<string>",
  "result.location_code": 123,
  "result.language_code": "<string>",
  "result.check_url": "<string>",
  "result.datetime": "<string>",
  "result.cid": "<string>",
  "result.feature_id": "<string>",
  "result.item_types": [
    "<string>"
  ],
  "items_without_answers": [
    "<string>"
  ],
  "items_without_answers.type": "<string>",
  "items_without_answers.rank_group": 123,
  "items_without_answers.rank_absolute": 123,
  "items_without_answers.question_id": "<string>",
  "items_without_answers.url": "<string>",
  "items_without_answers.profile_image_url": "<string>",
  "items_without_answers.profile_url": "<string>",
  "items_without_answers.profile_name": "<string>",
  "items_without_answers.question_text": "<string>",
  "items_without_answers.original_question_text": "<string>",
  "items_without_answers.time_ago": "<string>",
  "items_without_answers.timestamp": "<string>",
  "items_without_answers.items": [
    "<string>"
  ],
  "items_without_answers.items_count": 123,
  "items": [
    "<string>"
  ],
  "items.type": "<string>",
  "items.rank_group": 123,
  "items.rank_absolute": 123,
  "items.question_id": "<string>",
  "items.url": "<string>",
  "items.profile_image_url": "<string>",
  "items.profile_url": "<string>",
  "items.profile_name": "<string>",
  "items.question_text": "<string>",
  "items.original_question_text": "<string>",
  "items.time_ago": "<string>",
  "items.timestamp": "<string>",
  "items.items": [
    "<string>"
  ],
  "items.answer_id": "<string>",
  "items.answer_text": "<string>",
  "items.original_answer_text": "<string>"
}

授权

Authorization
string
header
必填

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

请求体

application/json
keyword
string
必填

keyword 必填字段 你指定的关键词应表示本地商家的名称,最多可指定 700 个字符。在 keyword 字段中,所有 %## 都会被解码(加号字符“+”会被解码为空格字符)。如果需要在 keyword 中使用“%”字符,请将其指定为“%25”;此字段还可用于传递以下参数:cid——由 Google 定义的唯一商家实体 ID;place_id——Google Maps 中商家实体的标识符;spp——Google SERP 的 local_pack 元素中所展示本地服务的唯一标识符。示例:cid:194604053573767737 place_id:GhIJQWDl0CIeQUARxks3icF8U8A spp:CgsvZy8xdGN4cWRraBoUChIJPZDrEzLsZIgRoNrpodC5P30。有关 cidplace_id 标识符的更多信息,请参阅此帮助中心文章。有关 DataForSEO API 中 keywordkeywords 字段的规则与限制,请参阅此帮助中心文章

location_name
string
必填

搜索引擎位置的完整名称 如果未指定 location_codelocation_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_code location_coordinate 参数应以 “latitude,longitude,radius” 格式指定 “latitude”“longitude” 的最大小数位数:7 “radius” 的最小值:199.9 (mm) “radius” 的最大值:199999 (mm) 示例: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

depth
integer

解析深度 可选字段;SERP 中的结果数量;默认值:20;最大值:100对于每个最多包含 20 条结果的 SERP,您的账户都将被计费; 如果将深度设置为 20 以上,且搜索引擎返回超过 20 条结果,可能会产生额外费用;如果指定的深度高于响应中的问题数量,差额将自动退还至您的账户余额;可在定价页面计算费用。

tag
string

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

响应

成功响应

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

结果数组

result.keyword
string

在 POST 数组中收到的关键词 返回关键词时,将解码 %##(加号字符‘+’将被解码为空格字符)。如果您在设置任务时于 keyword 字段中指定了 cid 参数,此字段将包含该参数;示例:cid:2946633002421908862。有关此参数的更多信息,请参阅此帮助中心文章

result.se_domain
string

POST 数组中指定的搜索引擎域名

result.location_code
integer

POST 数组中的位置代码

result.language_code
string

POST 数组中的语言代码

result.check_url
string

搜索引擎结果的直接 URL,你可以使用它确认我们提供的结果是否准确

result.datetime
string

收到结果的日期和时间,采用 UTC 格式:“yyyy-mm-dd hh-mm-ss +00:00”;示例:2019-11-15 12:57:46 +00:00

result.cid
string

Google 定义的客户端 id,本地商家的唯一 id;有关此标识符的更多信息,请参阅此帮助中心文章

result.feature_id
string

SERP 功能的唯一标识符

result.item_types
string[]

项目类型 items 数组中出现的搜索引擎结果类型;可能的项目类型:google_business_question_item

items_without_answers
string[]

不含答案的 Google 商家问题项数组

items_without_answers.type
string

元素类型 = ‘google_business_question_item’

items_without_answers.rank_group
integer

在具有相同 type 值的一组元素中的位置 具有不同 type 值的元素的位置不计入 rank_group

items_without_answers.rank_absolute
integer

在所有元素中的绝对排名

items_without_answers.question_id
string

问题 ID

items_without_answers.url
string

问题的 URL

items_without_answers.profile_image_url
string

用户个人资料图片的 URL

items_without_answers.profile_url
string

用户个人资料的 URL

items_without_answers.profile_name
string

用户的显示名称

items_without_answers.question_text
string

问题的当前文本

items_without_answers.original_question_text
string

问题的原始文本

items_without_answers.time_ago
string

问题发布的估计时间

items_without_answers.timestamp
string

问题发布的确切时间

items_without_answers.items
string[]

项目数组 google_business_question_item 中的项目

items_without_answers.items_count
integer

items 数组中的项目数量

items
string[]

包含答案的 Google 商家问题项数组 可能的项类型:google_business_question_item

items.type
string

元素类型 = ‘google_business_answer_element’

items.rank_group
integer

在具有相同 type 值的一组元素中的位置 具有不同 type 值的元素的位置不计入 rank_group

items.rank_absolute
integer

在所有元素中的绝对排名

items.question_id
string

问题 ID

items.url
string

问题的 URL

items.profile_image_url
string

用户个人资料图片的 URL

items.profile_url
string

用户个人资料的 URL

items.profile_name
string

用户的显示名称

items.question_text
string

问题的当前文本

items.original_question_text
string

问题的原始文本

items.time_ago
string

答案发布的估计时间

items.timestamp
string

回答发布的确切时间

items.items
string[]

google_business_question_item 中的项目数组 包含 Google 商家问题的回答;可能的项目类型:google_business_answer_element

items.answer_id
string

答案 ID

items.answer_text
string

答案的当前文本

items.original_answer_text
string

回答的原始文本