NAVNavbar
Logo
cURL php NodeJS Python cSharp

Get Google My Business Updates Results by id

 

My Business Updates API will provide you with the content of posts publicly shared by any business entity on its Google My Business profile.

The returned results are specific to the indicated cid (client ID) or keyword, location and language parameters. We emulate all the parameters with the highest accuracy so that the results you receive will match the actual search results for the specified parameters at the time of task setting. You can always check the returned results accessing the check_url in the Incognito mode to make sure the received data is accurate.

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

<?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-dashboard
$client = new RestClient($api_url, null, 'login', 'password');

try {
	$result = array();
	// #1 - using this method you can get a list of completed tasks
	// GET /v3/business_data/google/my_business_updates/tasks_ready
	$tasks_ready = $client->get('/v3/business_data/google/my_business_updates/tasks_ready');
	// you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
	if (isset($tasks_ready['status_code']) AND $tasks_ready['status_code'] === 20000) {
		foreach ($tasks_ready['tasks'] as $task) {
			if (isset($task['result'])) {
				foreach ($task['result'] as $task_ready) {
					// #2 - using this method you can get results of each completed task
					// GET /v3/business_data/google/my_business_updates/task_get/$id
					if (isset($task_ready['endpoint'])) {
						$result[] = $client->get($task_ready['endpoint']);
					}
					// #3 - another way to get the task results by id
					// GET /v3/business_data/google/my_business_updates/task_get/$id
					/*
					if (isset($task_ready['id'])) {
						$result[] = $client->get('/v3/business_data/google/my_business_updates/task_get/' . $task_ready['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;
?>

The above command returns JSON structured like this:

{
  "version": "0.1.20200909",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.1259 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "09202135-1535-0243-0000-a6230b72c28e",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.0424 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v3",
        "business_data",
        "google",
        "my_business_updates",
        "task_get",
        "09202135-1535-0243-0000-a6230b72c28e"
      ],
      "data": {
        "se_type": "business_updates",
        "se": "google",
        "api": "business_data",
        "function": "my_business_updates",
        "language_code": "en",
        "location_name": "New York,New York,United States",
        "keyword": "RustyBrick, Inc.",
        "device": "desktop",
        "os": "windows"
      },
      "result": [
        {
          "keyword": "RustyBrick, Inc.",
          "se_domain": "google.com",
          "location_code": 1023191,
          "language_code": "en",
          "check_url": "https://www.google.com/search?q=RustyBrick%2C%20Inc.&num=10&hl=en&gl=US&gws_rd=cr&uule=w+CAIQIFISCTsIP9OlT8KJEWL-d-EGjwvI",
          "datetime": "2020-09-20 18:35:29 +00:00",
          "business_updates_id": "lph_7KBnX7-VBoK6ad3rvYAN56",
          "cid": "2946633002421908862",
          "feature_id": "0x89c2e830ac1a4c3f:0x28e48b1a90ccf57e",
          "item_types": [
            "google_business_post"
          ],
          "items_count": 10,
          "items": [
            {
              "type": "google_business_post",
              "rank_group": 1,
              "rank_absolute": 1,
              "position": "right",
              "xpath": "/div[1]/span[1]",
              "author": "RustyBrick, Inc.",
              "snippet": null,
              "post_text": "The RustyBrick team is working from home. We are fully up and operational. But we are not physically in the office. Please be safe and stay home.",
              "url": "https://search.google.com/local/posts?q=RustyBrick,+Inc.&ludocid=2946633002421908862&lpsid=1410215436954082713&source=sh/x/localposts&lsig=AB86z5VWpF0lsMxd28ZU-_oXjiYQ",
              "images_url": "https://lh4.googleusercontent.com/-qgmI_Ron5SQ/AAAAAAAAAAI/AAAAAAAAAAA/cbSEs9rPOZE/s40-c-k-mo/photo.jpg",
              "post_date": "04/02/2020 00:00:00",
              "timestamp": "2020-04-02 00:00:00 +00:00",
              "links": null
            },
            {
              "type": "google_business_post",
              "rank_group": 2,
              "rank_absolute": 2,
              "position": "right",
              "xpath": "/div[2]/span[1]",
              "author": "RustyBrick, Inc.",
              "snippet": null,
              "post_text": "We hope everyone is safe and healthy. Virtually all of our staff will be working remotely. Thankfully, we are set up to allow for remote work. Phone calls will be returned but it is best to email. Be safe!",
              "url": "https://search.google.com/local/posts?q=RustyBrick,+Inc.&ludocid=2946633002421908862&lpsid=1037575848925112213&source=sh/x/localposts&lsig=AB86z5VWpF0lsMxd28ZU-_oXjiYQ",
              "images_url": "https://lh4.googleusercontent.com/-qgmI_Ron5SQ/AAAAAAAAAAI/AAAAAAAAAAA/cbSEs9rPOZE/s40-c-k-mo/photo.jpg",
              "post_date": "03/16/2020 00:00:00",
              "timestamp": "2020-03-16 00:00:00 +00:00",
              "links": null
            },
            {
              "type": "google_business_post",
              "rank_group": 3,
              "rank_absolute": 3,
              "position": "right",
              "xpath": "/div[3]/span[1]",
              "author": "RustyBrick, Inc.",
              "snippet": null,
              "post_text": "The RustyBrick Sukkah is now available for use",
              "url": "https://search.google.com/local/posts?q=RustyBrick,+Inc.&ludocid=2946633002421908862&lpsid=536816744311833583&source=sh/x/localposts&lsig=AB86z5VWpF0lsMxd28ZU-_oXjiYQ",
              "images_url": "https://lh4.googleusercontent.com/-qgmI_Ron5SQ/AAAAAAAAAAI/AAAAAAAAAAA/cbSEs9rPOZE/s40-c-k-mo/photo.jpg",
              "post_date": "09/27/2018 00:00:00",
              "timestamp": "2018-09-27 00:00:00 +00:00",
              "links": [
                {
                  "type": "link_element",
                  "title": "Learn more",
                  "url": "https://www.rustybrick.com/rustysukkah-is-available.html"
                }
              ]
            },
            {
              "type": "google_business_post",
              "rank_group": 4,
              "rank_absolute": 4,
              "position": "right",
              "xpath": "/div[4]/span[1]",
              "author": "RustyBrick, Inc.",
              "snippet": null,
              "post_text": "Double Header For RustyBrick's Annual Rockland Boulders Baseball Game. The stadium was pretty empty, as usual but makes it good to have it to ourselves. :)",
              "url": "https://search.google.com/local/posts?q=RustyBrick,+Inc.&ludocid=2946633002421908862&lpsid=4949232654074362515&source=sh/x/localposts&lsig=AB86z5VWpF0lsMxd28ZU-_oXjiYQ",
              "images_url": "https://lh4.googleusercontent.com/-qgmI_Ron5SQ/AAAAAAAAAAI/AAAAAAAAAAA/cbSEs9rPOZE/s40-c-k-mo/photo.jpg",
              "post_date": "08/15/2018 00:00:00",
              "timestamp": "2018-08-15 00:00:00 +00:00",
              "links": [
                {
                  "type": "link_element",
                  "title": "Learn more",
                  "url": "https://www.rustybrick.com/double-header.html"
                }
              ]
            },
            {
              "type": "google_business_post",
              "rank_group": 5,
              "rank_absolute": 5,
              "position": "right",
              "xpath": "/div[5]/span[1]",
              "author": "RustyBrick, Inc.",
              "snippet": null,
              "post_text": "Our latest Jewish software solution aims at improving the Mikvah experience - introducing MikvahCloud.com",
              "url": "https://search.google.com/local/posts?q=RustyBrick,+Inc.&ludocid=2946633002421908862&lpsid=8663089673266139268&source=sh/x/localposts&lsig=AB86z5VWpF0lsMxd28ZU-_oXjiYQ",
              "images_url": "https://lh4.googleusercontent.com/-qgmI_Ron5SQ/AAAAAAAAAAI/AAAAAAAAAAA/cbSEs9rPOZE/s40-c-k-mo/photo.jpg",
              "post_date": "07/17/2018 00:00:00",
              "timestamp": "2018-07-17 00:00:00 +00:00",
              "links": [
                {
                  "type": "link_element",
                  "title": "Learn more",
                  "url": "https://www.rustybrick.com/MikvahCloud-Revolutionizing-Mikvehs-With-Web--Mobile-Technologies-261.html"
                }
              ]
            },
            {
              "type": "google_business_post",
              "rank_group": 6,
              "rank_absolute": 6,
              "position": "right",
              "xpath": "/div[6]/span[1]",
              "author": "RustyBrick, Inc.",
              "snippet": null,
              "post_text": "Here is our recap of our big ShulCloud Conference that took place yesterday.",
              "url": "https://search.google.com/local/posts?q=RustyBrick,+Inc.&ludocid=2946633002421908862&lpsid=2533919385382650388&source=sh/x/localposts&lsig=AB86z5VWpF0lsMxd28ZU-_oXjiYQ",
              "images_url": "https://lh4.googleusercontent.com/-qgmI_Ron5SQ/AAAAAAAAAAI/AAAAAAAAAAA/cbSEs9rPOZE/s40-c-k-mo/photo.jpg",
              "post_date": "07/11/2018 00:00:00",
              "timestamp": "2018-07-11 00:00:00 +00:00",
              "links": [
                {
                  "type": "link_element",
                  "title": "Learn more",
                  "url": "https://www.rustybrick.com/2018-shulcloud-recap.html"
                }
              ]
            },
            {
              "type": "google_business_post",
              "rank_group": 7,
              "rank_absolute": 7,
              "position": "right",
              "xpath": "/div[7]/span[1]",
              "author": "RustyBrick, Inc.",
              "snippet": null,
              "post_text": "Sales people should not be cold calling on a recorded line - big turn off and another obstacle to closing a sale",
              "url": "https://search.google.com/local/posts?q=RustyBrick,+Inc.&ludocid=2946633002421908862&lpsid=410006573066419182&source=sh/x/localposts&lsig=AB86z5VWpF0lsMxd28ZU-_oXjiYQ",
              "images_url": "https://lh4.googleusercontent.com/-qgmI_Ron5SQ/AAAAAAAAAAI/AAAAAAAAAAA/cbSEs9rPOZE/s40-c-k-mo/photo.jpg",
              "post_date": "06/20/2018 00:00:00",
              "timestamp": "2018-06-20 00:00:00 +00:00",
              "links": [
                {
                  "type": "link_element",
                  "title": "Learn more",
                  "url": "https://www.rustybrick.com/cold-calling-recorded-lines.html"
                }
              ]
            },
            {
              "type": "google_business_post",
              "rank_group": 8,
              "rank_absolute": 8,
              "position": "right",
              "xpath": "/div[8]/span[1]",
              "author": "RustyBrick, Inc.",
              "snippet": null,
              "post_text": "I caught a Google street view car in my office parking lot",
              "url": "https://search.google.com/local/posts?q=RustyBrick,+Inc.&ludocid=2946633002421908862&lpsid=1558506864946704215&source=sh/x/localposts&lsig=AB86z5VWpF0lsMxd28ZU-_oXjiYQ",
              "images_url": "https://lh4.googleusercontent.com/-qgmI_Ron5SQ/AAAAAAAAAAI/AAAAAAAAAAA/cbSEs9rPOZE/s40-c-k-mo/photo.jpg",
              "post_date": "06/11/2018 00:00:00",
              "timestamp": "2018-06-11 00:00:00 +00:00",
              "links": [
                {
                  "type": "link_element",
                  "title": "Learn more",
                  "url": "https://www.rustybrick.com/google-street-view-car.html"
                }
              ]
            },
            {
              "type": "google_business_post",
              "rank_group": 9,
              "rank_absolute": 9,
              "position": "right",
              "xpath": "/div[9]/span[1]",
              "author": "RustyBrick, Inc.",
              "snippet": null,
              "post_text": "Facebook verified my personal page with a blue check mark ✔️",
              "url": "https://search.google.com/local/posts?q=RustyBrick,+Inc.&ludocid=2946633002421908862&lpsid=1143916431374546095&source=sh/x/localposts&lsig=AB86z5VWpF0lsMxd28ZU-_oXjiYQ",
              "images_url": "https://lh4.googleusercontent.com/-qgmI_Ron5SQ/AAAAAAAAAAI/AAAAAAAAAAA/cbSEs9rPOZE/s40-c-k-mo/photo.jpg",
              "post_date": "06/04/2018 00:00:00",
              "timestamp": "2018-06-04 00:00:00 +00:00",
              "links": [
                {
                  "type": "link_element",
                  "title": "Learn more",
                  "url": "https://www.rustybrick.com/facebook-profile-verified.html"
                }
              ]
            },
            {
              "type": "google_business_post",
              "rank_group": 10,
              "rank_absolute": 10,
              "position": "right",
              "xpath": "/div[10]/span[1]",
              "author": "RustyBrick, Inc.",
              "snippet": null,
              "post_text": "OMG! I figured out why people keep calling RustyBrick asking for Google support!",
              "url": "https://search.google.com/local/posts?q=RustyBrick,+Inc.&ludocid=2946633002421908862&lpsid=1563210222153809846&source=sh/x/localposts&lsig=AB86z5VWpF0lsMxd28ZU-_oXjiYQ",
              "images_url": "https://lh4.googleusercontent.com/-qgmI_Ron5SQ/AAAAAAAAAAI/AAAAAAAAAAA/cbSEs9rPOZE/s40-c-k-mo/photo.jpg",
              "post_date": "05/31/2018 00:00:00",
              "timestamp": "2018-05-31 00:00:00 +00:00",
              "links": [
                {
                  "type": "link_element",
                  "title": "Learn more",
                  "url": "https://www.rustybrick.com/rustybrick-google-support.html"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

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/hotel_searches/task_get/00000000-0000-0000-0000-000000000000
The response will include all available items in the Google Hotel Searches 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 symbol ‘+’ 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
            business_updates_id string identifier of the business updates element in SERP
            cid string google-defined client id
unique id of a local establishment
learn more about the cid identifier in this help center article
            feature_id string the unique identifier of the element in SERP
learn more about the identifier in this help center article
            item_types array item types
types of search engine results encountered in the items array;
possible item types: google_business_post
            items_count integer item types
the number of items in the items array
            items array encountered item types
types of search engine results encountered in the items array;
possible item types: google_business_info
                type string type of element = ‘google_business_post’
                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 listed updates
absolute position among all present elements
                position string the alignment of the element in SERP
can take the following values: right
                xpath string the XPath of the element
                author string author of the post
                snippet string additional content of a post
                post_text string main content of a post
                url string url of a post
                images_url string url of an image included in the post
                post_date string date when a post was published
in the following format:
"mm/dd/yyyy hh:mm:ss"
                timestamp string time when a post was published
in the UTC format: “yyyy-mm-dd hh-mm-ss +00:00”
example:
2019-11-15 12:57:46 +00:00
                links array links included in the post
                    type string type of a link element
can take the following values: link_element
                    title string anchor text
                    url string url of a page the link is pointing at

‌‌