Get post group metrics
curl --request GET \
--url https://api.postflow.app/v1/posts/{postId}/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.postflow.app/v1/posts/{postId}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.postflow.app/v1/posts/{postId}/metrics', 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://api.postflow.app/v1/posts/{postId}/metrics",
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://api.postflow.app/v1/posts/{postId}/metrics"
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://api.postflow.app/v1/posts/{postId}/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.postflow.app/v1/posts/{postId}/metrics")
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[
{
"id": "<string>",
"post_id": "<string>",
"post_detail_id": "<string>",
"social_account_id": "<string>",
"social_post_id": "<string>",
"score": 123,
"views": 123,
"reach": 123,
"likes": 123,
"dislikes": 123,
"shares": 123,
"quotes": 123,
"replies": 123,
"saves": 123,
"follows": 123,
"user_profile_clicks": 123,
"post_link_clicks": 123,
"post_other_clicks": 123,
"engagements": 123,
"engagement_rate_impressions": 123,
"engagement_rate_reach": 123,
"video_views": 123,
"video_watch_time_total": 123,
"video_watch_time_avg": 123,
"score_1": 123,
"score_2": 123,
"score_3": 123,
"score_4": 123,
"score_5": 123,
"score_6": 123,
"score_7": 123,
"score_8": 123,
"score_9": 123,
"score_10": 123,
"updated_at": "2023-11-07T05:31:56Z",
"published_at": "2023-11-07T05:31:56Z",
"poll_results": [
"<string>"
],
"poll_votes": 123,
"postDetail": {
"id": "<string>",
"social_network": "twitter",
"post_type": "text",
"post_id": "<string>",
"social_account_id": "<string>",
"enabled": true,
"is_customized": true,
"status": 1,
"stories": [
"<string>"
],
"is_story": true,
"published_at": "2023-11-07T05:31:56Z",
"user_error_message": "<string>",
"content": "<string>",
"link_preview": {
"url": "<string>",
"host": "<string>",
"title": "<string>",
"description": "<string>",
"image_url": "<string>"
},
"post_link": "<string>",
"firstComment": {
"id": "<string>",
"condition_type": 1,
"condition_value": 123,
"publishing_failed": true,
"user_error_message": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
},
"items": []
}
]{
"message": "<string>"
}{
"message": ""
}Post metrics
Get post group metrics
Returns performance metrics for all posts within a post group, keyed by post detail ID.
GET
/
posts
/
{postId}
/
metrics
Get post group metrics
curl --request GET \
--url https://api.postflow.app/v1/posts/{postId}/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.postflow.app/v1/posts/{postId}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.postflow.app/v1/posts/{postId}/metrics', 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://api.postflow.app/v1/posts/{postId}/metrics",
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://api.postflow.app/v1/posts/{postId}/metrics"
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://api.postflow.app/v1/posts/{postId}/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.postflow.app/v1/posts/{postId}/metrics")
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[
{
"id": "<string>",
"post_id": "<string>",
"post_detail_id": "<string>",
"social_account_id": "<string>",
"social_post_id": "<string>",
"score": 123,
"views": 123,
"reach": 123,
"likes": 123,
"dislikes": 123,
"shares": 123,
"quotes": 123,
"replies": 123,
"saves": 123,
"follows": 123,
"user_profile_clicks": 123,
"post_link_clicks": 123,
"post_other_clicks": 123,
"engagements": 123,
"engagement_rate_impressions": 123,
"engagement_rate_reach": 123,
"video_views": 123,
"video_watch_time_total": 123,
"video_watch_time_avg": 123,
"score_1": 123,
"score_2": 123,
"score_3": 123,
"score_4": 123,
"score_5": 123,
"score_6": 123,
"score_7": 123,
"score_8": 123,
"score_9": 123,
"score_10": 123,
"updated_at": "2023-11-07T05:31:56Z",
"published_at": "2023-11-07T05:31:56Z",
"poll_results": [
"<string>"
],
"poll_votes": 123,
"postDetail": {
"id": "<string>",
"social_network": "twitter",
"post_type": "text",
"post_id": "<string>",
"social_account_id": "<string>",
"enabled": true,
"is_customized": true,
"status": 1,
"stories": [
"<string>"
],
"is_story": true,
"published_at": "2023-11-07T05:31:56Z",
"user_error_message": "<string>",
"content": "<string>",
"link_preview": {
"url": "<string>",
"host": "<string>",
"title": "<string>",
"description": "<string>",
"image_url": "<string>"
},
"post_link": "<string>",
"firstComment": {
"id": "<string>",
"condition_type": 1,
"condition_value": 123,
"publishing_failed": true,
"user_error_message": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
},
"items": []
}
]{
"message": "<string>"
}{
"message": ""
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Array of PostMetricData, the keys are the IDs of individual posts.
Each post receives a score from 0 to 10.
The score is based on 60% engagements and 40% impressions.
More info: https://postflow.app/blog/postflow-analytics#post-score
Show child attributes
Show child attributes
Used for Stories posts. Each story has its own item with metrics