GETapi.synup.com/api/v4/locations/{locationId}/facebook-analytics
Get Facebook Page Analytics
This API retrieves profile analytics data from Facebook for a specific location.
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/facebook-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/facebook-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/facebook-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/facebook-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": {
"facebookInsights": {
"ctaAction": [
{
"startTime": "2018-11-13T00:00:00+00:00",
"value": 0
}
],
"directionsAction": [
{
"startTime": "2018-11-13T00:00:00+00:00",
"value": 0
}
],
"phoneAction": [
{
"startTime": "2018-11-13T00:00:00+00:00",
"value": 0
}
],
"views": [
{
"startTime": "2018-11-13T00:00:00+00:00",
"value": 0
}
],
"websiteAction": [
{
"startTime": "2018-11-13T00:00:00+00:00",
"value": 0
}
]
}
}
}Response body
| Name | Type | Required | Description |
|---|---|---|---|
data | object | optional | |
data.facebookInsights | object | optional | |
data.facebookInsights.ctaAction | array of object | optional | The number of times the CTA on the page was clicked |
data.facebookInsights.ctaAction[].startTime | string | optional | Start time of the analytics period |
data.facebookInsights.ctaAction[].value | integer | optional | Metric value for the period |
data.facebookInsights.directionsAction | array of object | optional | The number of times directions for the particular location was requested |
data.facebookInsights.directionsAction[].startTime | string | optional | Start time of the analytics period |
data.facebookInsights.directionsAction[].value | integer | optional | Metric value for the period |
data.facebookInsights.phoneAction | array of object | optional | The number of times the call number for the location was requested |
data.facebookInsights.phoneAction[].startTime | string | optional | Start time of the analytics period |
data.facebookInsights.phoneAction[].value | integer | optional | Metric value for the period |
data.facebookInsights.views | array of object | optional | The number of times the page was viewed |
data.facebookInsights.views[].startTime | string | optional | Start time of the analytics period |
data.facebookInsights.views[].value | integer | optional | Metric value for the period |
data.facebookInsights.websiteAction | array of object | optional | The number of times the website URL for the location was requested |
data.facebookInsights.websiteAction[].startTime | string | optional | Start time of the analytics period |
data.facebookInsights.websiteAction[].value | integer | optional | Metric value for the period |