Endpoints
Get Analytics
Get the latest post metrics and audience counts for one Mallary profile.
GET
/
api
/
v1
/
analytics
Get latest post metrics and audience counts
curl --request GET \
--url https://mallary.ai/api/v1/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://mallary.ai/api/v1/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://mallary.ai/api/v1/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mallary.ai/api/v1/analytics",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mallary.ai/api/v1/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mallary.ai/api/v1/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://mallary.ai/api/v1/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"profile_id": "<string>",
"analytics": [
{
"post_id": 123,
"platform": "twitter",
"status": "available",
"status_message": "<string>",
"reconnect_required": true,
"captured_at": "2023-11-07T05:31:56Z",
"impressions": 123,
"reach": 123,
"likes": 123,
"comments": 123,
"shares": 123,
"clicks": 123,
"views": 123,
"saves": 123,
"bookmarks": 123,
"outbound_clicks": 123,
"pin_clicks": 123,
"url_clicks": 123,
"profile_clicks": 123,
"engaged_users": 123,
"engagementRate": 123,
"engagementRatePercent": 123,
"engagementRateDenominator": "views",
"metric_window": "lifetime",
"metric_semantics_version": 123
}
],
"audience": [
{
"platform": "x",
"label": "<string>",
"account": {
"id": "<string>",
"username": "<string>",
"avatar_url": "<string>"
},
"metric": "followers",
"count": 1,
"status": "available",
"status_message": "<string>",
"captured_at": "2023-11-07T05:31:56Z",
"last_attempt_at": "2023-11-07T05:31:56Z",
"next_update_at": "2023-11-07T05:31:56Z"
}
]
}
}Use
profile_id to read analytics for a non-default connection profile. Omit it to read analytics for the default profile.
The response has two lists:
data.analyticshas the latest metrics for recent posts. Usepost_idto limit this list to one post.data.audiencehas the latest saved follower or subscriber count for each connected account in the profile. It uses the same fields and statuses as Get Audience Counts. Thepost_idfilter does not change this list.
user.info.stats and Mallary saves its first count. Existing connections without that permission return permission_required for their audience count. They keep working as before.
Metrics keep the meaning supplied by each platform. Impressions, reach, and views are separate measurements. A metric the platform did not supply is null, while a reported zero remains 0. Check captured_at and metric_window to see when Mallary saved a metric and whether it covers a lifetime or rolling period.
engagementRate remains a ratio for existing API clients. engagementRatePercent is the same value shown as a percentage. engagementRateDenominator names the base used for the calculation when a rate is available.
If an older LinkedIn connection needs the analytics permission, the response uses status: "reconnect_required" and says Reconnect to get analytics. Reconnect LinkedIn once from the Platforms page. Mallary will then start collecting those post results.Query Parameters
Last modified on October 7, 2026
Was this page helpful?
Get latest post metrics and audience counts
curl --request GET \
--url https://mallary.ai/api/v1/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://mallary.ai/api/v1/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://mallary.ai/api/v1/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mallary.ai/api/v1/analytics",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mallary.ai/api/v1/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mallary.ai/api/v1/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://mallary.ai/api/v1/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"profile_id": "<string>",
"analytics": [
{
"post_id": 123,
"platform": "twitter",
"status": "available",
"status_message": "<string>",
"reconnect_required": true,
"captured_at": "2023-11-07T05:31:56Z",
"impressions": 123,
"reach": 123,
"likes": 123,
"comments": 123,
"shares": 123,
"clicks": 123,
"views": 123,
"saves": 123,
"bookmarks": 123,
"outbound_clicks": 123,
"pin_clicks": 123,
"url_clicks": 123,
"profile_clicks": 123,
"engaged_users": 123,
"engagementRate": 123,
"engagementRatePercent": 123,
"engagementRateDenominator": "views",
"metric_window": "lifetime",
"metric_semantics_version": 123
}
],
"audience": [
{
"platform": "x",
"label": "<string>",
"account": {
"id": "<string>",
"username": "<string>",
"avatar_url": "<string>"
},
"metric": "followers",
"count": 1,
"status": "available",
"status_message": "<string>",
"captured_at": "2023-11-07T05:31:56Z",
"last_attempt_at": "2023-11-07T05:31:56Z",
"next_update_at": "2023-11-07T05:31:56Z"
}
]
}
}
