Get one post's analytics
curl --request GET \
--url https://postonce.to/api/public/v1/posts/{id}/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://postonce.to/api/public/v1/posts/{id}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://postonce.to/api/public/v1/posts/{id}/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://postonce.to/api/public/v1/posts/{id}/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://postonce.to/api/public/v1/posts/{id}/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://postonce.to/api/public/v1/posts/{id}/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://postonce.to/api/public/v1/posts/{id}/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{
"data": {
"id": "<string>",
"media_url": "<string>",
"targets": [
{
"account_id": "<string>",
"platform": "<string>",
"platform_post_id": "<string>",
"url": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"metrics_status": "<string>",
"views": 123,
"likes": 123,
"comments": 123,
"shares": 123,
"saves": 123,
"engagement_rate": 123,
"last_updated": "2023-11-07T05:31:56Z"
}
]
}
}{
"error": {
"code": "workflow_limit_reached",
"message": "You have reached the maximum number of workflows for your plan.",
"hint": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key.",
"hint": "<string>"
}
}{
"error": {
"code": "workflow_limit_reached",
"message": "You have reached the maximum number of workflows for your plan.",
"hint": "<string>"
}
}Analytics
Get one post's analytics
Current views, likes, comments, shares and saves for each platform copy of one post that is published on TikTok, Instagram, YouTube or Facebook. Numbers are cached for up to an hour; last_updated says when each was read from the platform. Targets on other platforms, or not published yet, are left out. Works for posts created through the API or dashboard and for workflow posts.
GET
https://postonce.to/api/public
/
v1
/
posts
/
{id}
/
analytics
Get one post's analytics
curl --request GET \
--url https://postonce.to/api/public/v1/posts/{id}/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://postonce.to/api/public/v1/posts/{id}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://postonce.to/api/public/v1/posts/{id}/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://postonce.to/api/public/v1/posts/{id}/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://postonce.to/api/public/v1/posts/{id}/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://postonce.to/api/public/v1/posts/{id}/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://postonce.to/api/public/v1/posts/{id}/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{
"data": {
"id": "<string>",
"media_url": "<string>",
"targets": [
{
"account_id": "<string>",
"platform": "<string>",
"platform_post_id": "<string>",
"url": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"metrics_status": "<string>",
"views": 123,
"likes": 123,
"comments": 123,
"shares": 123,
"saves": 123,
"engagement_rate": 123,
"last_updated": "2023-11-07T05:31:56Z"
}
]
}
}{
"error": {
"code": "workflow_limit_reached",
"message": "You have reached the maximum number of workflows for your plan.",
"hint": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key.",
"hint": "<string>"
}
}{
"error": {
"code": "workflow_limit_reached",
"message": "You have reached the maximum number of workflows for your plan.",
"hint": "<string>"
}
}