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": "<string>",
"impressions": 123,
"reach": 123,
"likes": 123,
"comments": 123,
"shares": 123,
"clicks": 123,
"views": 123,
"engagementRate": 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.
For LinkedIn Page posts, Mallary shows LinkedIn impressions as views. LinkedIn likes and comments use the same fields as your other platforms, so your results stay easy to compare.
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.Authorizations
Use Authorization: Bearer {api_key}
Query Parameters
Filter post metrics to a single post/job ID owned by the authenticated user. Audience counts still cover the whole selected profile.
Select the connection profile for both post metrics and audience counts. Omit to use the default profile.
Random public connection profile ID returned by GET /api/v1/profiles.
Pattern:
^[A-Za-z0-9]{6,32}$Example:
"AbC123xYz90"
Last modified on September 23, 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": "<string>",
"impressions": 123,
"reach": 123,
"likes": 123,
"comments": 123,
"shares": 123,
"clicks": 123,
"views": 123,
"engagementRate": 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"
}
]
}
}
