Get Google My Business Questions and Answers Results by id

 

This endpoint will provide you with a detailed overview of questions and answers associated with a specific business entity listed on Google My Business. By submitting a request to this endpoint, you can access comprehensive data on the inquiries and responses related to a particular business, including the full text of the questions and answers, as well as metadata such as timestamps, user information.

checked GET
Pricing

Your account will be charged only for setting a task. You can get the results of the task within the next 30 days for free.
The cost can be calculated on the Pricing page.

Description of the fields for sending a request:

Field name Type Description
id string task identifier
unique task identifier in our system in the UUID format
you will be able to use it within 30 days to request the results of the task at any time

‌‌‌‌
‌‌As a response of the API server, you will receive JSON-encoded data containing a tasks array with the information specific to the set tasks.

You can also get all available SERP features by making a request to the following Sandbox URL:
https://sandbox.dataforseo.com/v3/business_data/google/questions_and_answers/task_get/00000000-0000-0000-0000-000000000000
The response will include all available items in the Google My Business Info endpoint with the fields containing dummy data.
You won’t be charged for using Sandbox endpoints.

Description of the fields in the results array:

Field name Type Description
version string the current version of the API
status_code integer general status code
you can find the full list of the response codes here
Note: we strongly recommend designing a necessary system for handling related exceptional or error conditions
status_message string general informational message
you can find the full list of general informational messages here
time string execution time, seconds
cost float total tasks cost, USD
tasks_count integer the number of tasks in the tasks array
tasks_error integer the number of tasks in the tasks array that were returned an error
tasks array array of tasks
        id string task identifier
unique task identifier in our system in the UUID format
        status_code integer status code of the task
generated by DataForSEO; can be within the following range: 10000-60000
you can find the full list of the response codes here
        status_message string informational message of the task
you can find the full list of general informational messages here
        time string execution time, seconds
        cost float cost of the task, USD
        result_count integer number of elements in the result array
        path array URL path
        data object contains the same parameters that you specified in the POST request
        result array array of results
            keyword string keyword received in a POST array
keyword is returned with decoded %## (plus character ‘+’ will be decoded to a space character)
this field will contain the cid parameter if you specified it in the keyword field when setting a task;
example:
cid:2946633002421908862
learn more about the parameter in this help center article
            se_domain string search engine domain as specified in a POST array
            location_code integer location code in a POST array
            language_code string language code in a POST array
            check_url string direct URL to search engine results
you can use it to make sure that we provided accurate results
            datetime string date and time when the result was received
in the UTC format: “yyyy-mm-dd hh-mm-ss +00:00”
example:
2019-11-15 12:57:46 +00:00
            cid string google-defined client id
unique id of a local establishment;
learn more about the identifier in this help center article
            feature_id string unique identifier of the SERP feature
            item_types array item types
types of search engine results encountered in the items array;
possible item types: google_business_question_item
            items_without_answers array array of google business question items without answers
                type string type of element = ‘google_business_question_item’
                rank_group integer position within a group of elements with identical type values
positions of elements with different type values are omitted from rank_group
                rank_absolute integer absolute rank among all the elements
                question_id string ID of the question
                url string URL of the question
                profile_image_url string URL of the user’s profile image
                profile_url string URL of the user’s profile
                profile_name string displayed name of the user
                question_text string current text of the question
                original_question_text string original text of the question
                time_ago string estimated time when the question was posted
                timestamp string exact time when the question was posted
                items array array of items
items within google_business_question_item
            items_count integer the number of items in the items array
            items array array of google business question items with answers
possible item types: google_business_question_item
                type string type of element = ‘google_business_question_item’
                rank_group integer position within a group of elements with identical type values
positions of elements with different type values are omitted from rank_group
                rank_absolute integer absolute rank among all the elements
                question_id string ID of the question
                url string URL of the question
                profile_image_url string URL of the user’s profile image
                profile_url string URL of the user’s profile
                profile_name string displayed name of the user
                question_text string current text of the question
                original_question_text string original text of the question
                time_ago string estimated time when the question was posted
                timestamp string exact time when the question was posted
                items array array of items within google_business_question_item
contains answers to the google business questions;
the maximum number of answers returned for each question: 5
possible item types google_business_answer_element
                    type string type of the element = ‘google_business_answer_element’
                    answer_id string ID of the answer
                    profile_image_url string URL of the user’s profile image
                    profile_url string URL of the user’s profile
                    profile_name string displayed name of the user
                    answer_text string current text of the answer
                    original_answer_text string original text of the answer
                    time_ago string estimated time when the answer was posted
                    timestamp string exact time when the answer was posted

‌‌

Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-access

# Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access 
login="login" 
password="password" 
cred="$(printf ${login}:${password} | base64)" 
id="04261229-1535-0577-0000-e3c2f0a46daf" 
curl --location --request GET "https://api.dataforseo.com/v3/business_data/google/questions_and_answers/task_get/${id}" 
--header "Authorization: Basic ${cred}"  
--header "Content-Type: application/json" 
--data-raw ""
<?php
// You can download this file from here https://cdn.dataforseo.com/v3/examples/php/php_RestClient.zip
require('RestClient.php');
$api_url = 'https://api.dataforseo.com/';
// Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access
$client = new RestClient($api_url, null, 'login', 'password');

try {
	// get the task results by id
	// GET /v3/business_data/google/questions_and_answers/task_get/$id
	// use the task identifier that you recieved upon setting a task
	$id = "09161101-0696-0242-0000-22d3e5db7c45";
	$result = $client->get('/v3/business_data/google/questions_and_answers/task_get/' . $id);
	print_r($result);
	// do something with result
} catch (RestClientException $e) {
	echo "n";
	print "HTTP code: {$e->getHttpCode()}n";
	print "Error code: {$e->getCode()}n";
	print "Message: {$e->getMessage()}n";
	print  $e->getTraceAsString();
	echo "n";
}
$client = null;
?>
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://api.dataforseo.com/v3/business_data/google/questions_and_answers/task_get/04261229-1535-0577-0000-e3c2f0a46daf',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic c3VwcG9ydEBkYXRhZm9yc2VvLmNvbTpTUnJYVHp2UGtFSjgzdXlz'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
from client import RestClient
# You can download this file from here https://cdn.dataforseo.com/v3/examples/python/python_Client.zip
client = RestClient("login", "password")
# get the task results by id
# GET /v3/business_data/google/questions_and_answers/task_get/$id
id = "09151804-0696-0242-1000-94020b2b7bf5"
response = client.get("/v3/business_data/google/questions_and_answers/task_get/" + id)
# you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
if response["status_code"] == 20000:
    print(response)
    # do something with result
else:
    print("error. Code: %d Message: %s" % (response["status_code"], response["status_message"]))
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

namespace DataForSeoDemos
{
    public static partial class Demos
    {
        public static async Task business_data_questions_and_answers_task_get_by_id()
        {
            var httpClient = new HttpClient
            {
                BaseAddress = new Uri("https://api.dataforseo.com/"),
                // Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access
                DefaultRequestHeaders = { Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes("login:password"))) }
            };
            // get the task results by id
            // GET /v3/business_data/google/questions_and_answers/task_get/$id
            // use the task identifier that you recieved upon setting a task

            string id = "09151609-0696-0242-0000-e54466d0bdb2";
            var taskGetResponse = await httpClient.GetAsync("/v3/business_data/google/questions_and_answers/task_get/" + id);
            var result = JsonConvert.DeserializeObject&lt:dynamic>(await taskGetResponse.Content.ReadAsStringAsync());

            if (result.tasks != null)
            {
                var fst = result.tasks.First;
                // you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
                if (fst.status_code gt;= 40000 || fst.result == null)
                    Console.WriteLine($"error. Code: {fst.status_code} Message: {fst.status_message}");
                else
                    // do something with result
                    Console.WriteLine(String.Join(Environment.NewLine, fst));
            }
            else
                Console.WriteLine($"error. Code: {result.status_code} Message: {result.status_message}");
        }
    }
}