GETapi.synup.com/api/v4/locations/{locationId}/google-analytics
Get Google My Business Analytics
This API retrieves a specific location's profile analytics data from Google Business Profile (GBP).
Requires an API key. Send it as
Authorization: API <your-key> — see Getting started.Parameters
Path
| Name | Type | Required | Description |
|---|---|---|---|
locationId | string | required | Location ID |
Query
| Name | Type | Required | Description |
|---|---|---|---|
fromDate | string | optional | Start date of date range filter (YYYY-MM-DD) |
toDate | string | optional | End date of date range filter (YYYY-MM-DD) |
Request
Request
curl -X GET 'https://api.synup.com/api/v4/locations/:locationId/google-analytics?fromDate=&toDate=' \
-H 'Authorization: API YOUR_API_KEY' \
-H 'Content-Type: application/json'const res = await fetch('https://api.synup.com/api/v4/locations/:locationId/google-analytics?fromDate=&toDate=', {
method: 'GET',
headers: {
Authorization: 'API YOUR_API_KEY',
'Content-Type': 'application/json',
},
});
const data = await res.json();import requests
res = requests.get(
"https://api.synup.com/api/v4/locations/:locationId/google-analytics?fromDate=&toDate=",
headers={
"Authorization": "API YOUR_API_KEY",
"Content-Type": "application/json",
},
)
data = res.json()req, _ := http.NewRequest("GET", "https://api.synup.com/api/v4/locations/:locationId/google-analytics?fromDate=&toDate=", nil)
req.Header.Set("Authorization", "API YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Responses
| Status | Description |
|---|---|
200 | Successful response |
401 | Unauthorized |
404 | Location not found |
Example response (generated from the schema)
{
"data": {
"googleInsights": {
"directionsAction": [
{
"startTime": "2018-11-13T00:00:00+00:00",
"value": 20
}
],
"maps": [
{
"startTime": "2018-11-13T00:00:00+00:00",
"value": 20
}
],
"phoneAction": [
{
"startTime": "2018-11-13T00:00:00+00:00",
"value": 20
}
],
"search": [
{
"startTime": "2018-11-13T00:00:00+00:00",
"value": 20
}
],
"websiteAction": [
{
"startTime": "2018-11-13T00:00:00+00:00",
"value": 20
}
],
"total": [
{
"startTime": "2018-11-13T00:00:00+00:00",
"value": 20
}
]
}
}
}Response body
| Name | Type | Required | Description |
|---|---|---|---|
data | object | optional | |
data.googleInsights | object | optional | |
data.googleInsights.directionsAction | array of object | optional | The number of times directions for the particular location was requested |
data.googleInsights.directionsAction[].startTime | string | optional | Start time of the analytics period |
data.googleInsights.directionsAction[].value | integer | optional | Metric value for the period |
data.googleInsights.maps | array of object | optional | The number of times the location showed up on Google Maps |
data.googleInsights.maps[].startTime | string | optional | Start time of the analytics period |
data.googleInsights.maps[].value | integer | optional | Metric value for the period |
data.googleInsights.phoneAction | array of object | optional | The number of times the call number for the location was requested |
data.googleInsights.phoneAction[].startTime | string | optional | Start time of the analytics period |
data.googleInsights.phoneAction[].value | integer | optional | Metric value for the period |
data.googleInsights.search | array of object | optional | The number of times the location showed up on Google Search results |
data.googleInsights.search[].startTime | string | optional | Start time of the analytics period |
data.googleInsights.search[].value | integer | optional | Metric value for the period |
data.googleInsights.websiteAction | array of object | optional | The number of times the website URL for the location was requested |
data.googleInsights.websiteAction[].startTime | string | optional | Start time of the analytics period |
data.googleInsights.websiteAction[].value | integer | optional | Metric value for the period |
data.googleInsights.total | array of object | optional | The total sum of all the above interactions |
data.googleInsights.total[].startTime | string | optional | Start time of the analytics period |
data.googleInsights.total[].value | integer | optional | Metric value for the period |