Get a post's analytics
curl --request GET \
--url https://postsyncer.com/api/v1/analytics/posts/{post} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://postsyncer.com/api/v1/analytics/posts/{post}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://postsyncer.com/api/v1/analytics/posts/{post}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://postsyncer.com/api/v1/analytics/posts/{post}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"post_id": 4182,
"total": {
"comments": 19,
"likes": 312,
"shares": 14,
"impressions": 4970,
"quotes": 0,
"saves": 34,
"views": 0,
"reach": 4270,
"clicks": 41,
"profile_visits": 56,
"engagement_rate": 8.45
},
"accounts": [
{
"platform_post_id": 7801,
"post_id": 4182,
"account_id": 301,
"platform": "instagram",
"status": "PUBLISHED",
"post_url": "https://www.instagram.com/p/DHk2mQ7sLtA/",
"analytics": {
"comments": 12,
"likes": 248,
"shares": 9,
"impressions": 3120,
"quotes": null,
"saves": 31,
"views": null,
"reach": 2870,
"clicks": null,
"profile_visits": 44,
"engagement_rate": 9.62,
"pending": false,
"synced_at": "2030-03-16T09:00:00+00:00"
},
"account": {
"workspace_id": 12,
"avatar": "https://cdn.postsyncer.com/examples/halden-coffee-logo.png",
"has_expired": false,
"needs_reconnect": false,
"reconnect_reason": null,
"platform_hold": null,
"renewal_failing": null,
"sign_in_ends_at": null,
"is_default": true,
"support_threads": false,
"is_verified": false,
"plan_allows_posting": true,
"analytics_unavailable": null,
"id": 301,
"platform": "instagram",
"username": "haldencoffee",
"name": "Halden Coffee",
"profile_url": "https://www.instagram.com/haldencoffee/"
}
},
{
"platform_post_id": 7802,
"post_id": 4182,
"account_id": 302,
"platform": "linkedin",
"status": "PUBLISHED",
"post_url": "https://www.linkedin.com/feed/update/urn:li:share:7306000000000000001/",
"analytics": {
"comments": 7,
"likes": 64,
"shares": 5,
"impressions": 1850,
"quotes": null,
"saves": 3,
"views": 0,
"reach": 1400,
"clicks": 41,
"profile_visits": 12,
"engagement_rate": 6.49,
"pending": false,
"synced_at": "2030-03-16T09:00:00+00:00"
},
"account": {
"workspace_id": 12,
"avatar": "https://cdn.postsyncer.com/examples/halden-coffee-logo.png",
"has_expired": false,
"needs_reconnect": false,
"reconnect_reason": null,
"platform_hold": null,
"renewal_failing": null,
"sign_in_ends_at": "2031-01-20T10:15:00+00:00",
"is_default": true,
"support_threads": false,
"is_verified": false,
"plan_allows_posting": true,
"analytics_unavailable": null,
"id": 302,
"platform": "linkedin",
"username": "halden-coffee",
"name": "Halden Coffee",
"profile_url": "https://www.linkedin.com/company/88412345",
"is_page": true
}
}
]
}Analytics
Get a post's analytics
Get one post’s totals, and each copy’s numbers with its account.
GET
/
analytics
/
posts
/
{post}
Get a post's analytics
curl --request GET \
--url https://postsyncer.com/api/v1/analytics/posts/{post} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://postsyncer.com/api/v1/analytics/posts/{post}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://postsyncer.com/api/v1/analytics/posts/{post}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://postsyncer.com/api/v1/analytics/posts/{post}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"post_id": 4182,
"total": {
"comments": 19,
"likes": 312,
"shares": 14,
"impressions": 4970,
"quotes": 0,
"saves": 34,
"views": 0,
"reach": 4270,
"clicks": 41,
"profile_visits": 56,
"engagement_rate": 8.45
},
"accounts": [
{
"platform_post_id": 7801,
"post_id": 4182,
"account_id": 301,
"platform": "instagram",
"status": "PUBLISHED",
"post_url": "https://www.instagram.com/p/DHk2mQ7sLtA/",
"analytics": {
"comments": 12,
"likes": 248,
"shares": 9,
"impressions": 3120,
"quotes": null,
"saves": 31,
"views": null,
"reach": 2870,
"clicks": null,
"profile_visits": 44,
"engagement_rate": 9.62,
"pending": false,
"synced_at": "2030-03-16T09:00:00+00:00"
},
"account": {
"workspace_id": 12,
"avatar": "https://cdn.postsyncer.com/examples/halden-coffee-logo.png",
"has_expired": false,
"needs_reconnect": false,
"reconnect_reason": null,
"platform_hold": null,
"renewal_failing": null,
"sign_in_ends_at": null,
"is_default": true,
"support_threads": false,
"is_verified": false,
"plan_allows_posting": true,
"analytics_unavailable": null,
"id": 301,
"platform": "instagram",
"username": "haldencoffee",
"name": "Halden Coffee",
"profile_url": "https://www.instagram.com/haldencoffee/"
}
},
{
"platform_post_id": 7802,
"post_id": 4182,
"account_id": 302,
"platform": "linkedin",
"status": "PUBLISHED",
"post_url": "https://www.linkedin.com/feed/update/urn:li:share:7306000000000000001/",
"analytics": {
"comments": 7,
"likes": 64,
"shares": 5,
"impressions": 1850,
"quotes": null,
"saves": 3,
"views": 0,
"reach": 1400,
"clicks": 41,
"profile_visits": 12,
"engagement_rate": 6.49,
"pending": false,
"synced_at": "2030-03-16T09:00:00+00:00"
},
"account": {
"workspace_id": 12,
"avatar": "https://cdn.postsyncer.com/examples/halden-coffee-logo.png",
"has_expired": false,
"needs_reconnect": false,
"reconnect_reason": null,
"platform_hold": null,
"renewal_failing": null,
"sign_in_ends_at": "2031-01-20T10:15:00+00:00",
"is_default": true,
"support_threads": false,
"is_verified": false,
"plan_allows_posting": true,
"analytics_unavailable": null,
"id": 302,
"platform": "linkedin",
"username": "halden-coffee",
"name": "Halden Coffee",
"profile_url": "https://www.linkedin.com/company/88412345",
"is_page": true
}
}
]
}Needs
analytics:read. See Permissions.accounts one row per copy with that copy’s numbers and its account. A copy that isn’t published has analytics: null and counts for nothing. pending: true means the copy’s numbers haven’t been read once yet.
The numbers are the latest PostSyncer read: on paid plans for 90 days after the post goes out, hourly on its first day and less often after; on Free once a day while the post is 1 to 7 days old. This route isn’t limited on Free. Refresh a post’s analytics asks for a fresh read on paid plans.
Errors
| Status | error | When | Retry? |
|---|---|---|---|
| 401 | No API key, or not a valid one. | No: fix the key. | |
| 403 | The key lacks analytics:read, or its user is inactive. | No: grant it in Settings → API. | |
| 404 | No post with that id in the workspaces the key can reach. | No. | |
| 429 | More than 60 requests a minute. | Yes, after Retry-After seconds. |
Related
- Refresh a post’s analytics: read the numbers again.
- Read analytics: when numbers refresh.
Authorizations
Response
The post's totals and its copies.
Was this page helpful?