import { OctosparkClient } from '@octospark/sdk'
const client = new OctosparkClient({
token: process.env.OCTOSPARK_TOKEN
})
const response = await client.social.getScheduledPostPerformance({
teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
scheduledPostId: process.env.OCTOSPARK_SCHEDULED_POST_ID ?? "scheduledPostId",
})import os
from octospark_sdk import OctosparkClient
client = OctosparkClient(token=os.environ["OCTOSPARK_TOKEN"])
response = client.social.get_scheduled_post_performance(
teamId=os.environ.get("OCTOSPARK_TEAM_ID", "teamId"),
scheduledPostId=os.environ.get("OCTOSPARK_SCHEDULED_POST_ID", "scheduledPostId")
)octospark analytics scheduled-post \
--request '{"path":{"teamId":"teamId","scheduledPostId":"scheduledPostId"}}'use reqwest::Client;
use std::env;
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let base_url = env::var("OCTOSPARK_API_URL").unwrap_or_else(|_| "https://api.octospark.ai".to_string());
let team_id = env::var("OCTOSPARK_TEAM_ID").unwrap_or_else(|_| "teamId".to_string());
let scheduled_post_id = env::var("OCTOSPARK_SCHEDULED_POST_ID").unwrap_or_else(|_| "scheduledPostId".to_string());
let url = format!("{}/v1/teams/{}/scheduled-posts/{}/performance", base_url.trim_end_matches('/'), team_id, scheduled_post_id);
let token = env::var("OCTOSPARK_TOKEN").expect("OCTOSPARK_TOKEN");
let mut request = client.get(url).bearer_auth(token);
let response = request.send().await?;
println!("{}", response.text().await?);
Ok(())
}import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
Future<void> main() async {
final baseUrl = Platform.environment['OCTOSPARK_API_URL'] ?? 'https://api.octospark.ai';
final token = Platform.environment['OCTOSPARK_TOKEN'];
final teamId = Platform.environment['OCTOSPARK_TEAM_ID'] ?? 'teamId';
final scheduledPostId = Platform.environment['OCTOSPARK_SCHEDULED_POST_ID'] ?? 'scheduledPostId';
final url = '${baseUrl.replaceFirst(RegExp(r'/$'), '')}/v1/teams/$teamId/scheduled-posts/$scheduledPostId/performance';
final uri = Uri.parse(url);
final headers = {
'Authorization': 'Bearer $token',
};
final response = await http.get(
uri,
headers: headers,
);
print(response.body);
}curl --request GET \
--url https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance",
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-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance"
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-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance")
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$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$response = Invoke-WebRequest -Uri 'https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance' -Method GET -Headers $headersimport Foundation
let url = URL(string: "https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["Authorization": "Bearer <token>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
using RestSharp;
var options = new RestClientOptions("https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val request = Request.Builder()
.url("https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance")
.get()
.addHeader("Authorization", "Bearer <token>")
.build()
val response = client.newCall(request).execute(){
"scheduledPostId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"platform": "x",
"collectionStatus": "pending",
"current": {
"likeCount": 123,
"commentCount": 123,
"shareCount": 123,
"saveCount": 123,
"impressionCount": 123,
"reachCount": 123,
"linkClickCount": 123
},
"derivedMetrics": {
"engagementRate": 123,
"performanceScore": 50,
"viralityScore": 123,
"qualityScore": 123,
"banditReward": 123
},
"content": {
"contentType": "text_post",
"isThread": true,
"caption": "<string>",
"title": "<string>",
"assetCount": 123,
"assetTypes": [
"<string>"
],
"assetCategories": [
"<string>"
],
"aiTags": [
"<string>"
],
"categories": [
"<string>"
],
"emotions": [
"<string>"
],
"purposes": [
"<string>"
],
"titles": [
"<string>"
],
"descriptions": [
"<string>"
],
"durationSecondsMax": 123,
"durationSecondsTotal": 123,
"widthMax": 123,
"heightMax": 123,
"fps": 123,
"assets": [
{
"assetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assetType": "<string>",
"aiTitle": "<string>",
"aiDescription": "<string>",
"aiTags": [
"<string>"
],
"contentCategory": "<string>",
"emotion": {},
"purpose": [
"<string>"
],
"durationSeconds": 123,
"width": 123,
"height": 123,
"fps": 123,
"analysis": {}
}
]
},
"snapshots": [
{
"hoursSincePost": 123,
"snapshotTakenAt": "<string>",
"likeCount": 123,
"commentCount": 123,
"shareCount": 123,
"saveCount": 123,
"impressionCount": 123,
"reachCount": 123,
"linkClickCount": 123,
"collectionError": "<string>"
}
],
"lastCollectedAt": "<string>"
}{
"issues": [
{
"_tag": "Pointer",
"path": [
"<string>"
],
"message": "<string>"
}
],
"message": "<string>",
"_tag": "HttpApiDecodeError"
}{
"message": "<string>",
"_tag": "Unauthorized"
}{
"message": "<string>",
"_tag": "PaymentRequired"
}{
"message": "<string>",
"_tag": "Forbidden"
}{
"message": "<string>",
"_tag": "NotFound"
}{
"message": "<string>",
"_tag": "Conflict",
"code": "<string>",
"currentRevision": 123
}{
"message": "<string>",
"code": "<string>",
"_tag": "UnprocessableEntity"
}{
"message": "<string>",
"_tag": "TooManyRequests",
"code": "<string>",
"retryAfterSeconds": 123
}{
"message": "<string>",
"_tag": "InternalError"
}Scheduled post performance
Return stored performance metrics for one published scheduled-post leg. Performance rows are collected per leg, so this is the exact drill-down for listPostPerformance rows (which carry scheduledPostId). Free: reads stored metrics only, with no live provider calls.
import { OctosparkClient } from '@octospark/sdk'
const client = new OctosparkClient({
token: process.env.OCTOSPARK_TOKEN
})
const response = await client.social.getScheduledPostPerformance({
teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
scheduledPostId: process.env.OCTOSPARK_SCHEDULED_POST_ID ?? "scheduledPostId",
})import os
from octospark_sdk import OctosparkClient
client = OctosparkClient(token=os.environ["OCTOSPARK_TOKEN"])
response = client.social.get_scheduled_post_performance(
teamId=os.environ.get("OCTOSPARK_TEAM_ID", "teamId"),
scheduledPostId=os.environ.get("OCTOSPARK_SCHEDULED_POST_ID", "scheduledPostId")
)octospark analytics scheduled-post \
--request '{"path":{"teamId":"teamId","scheduledPostId":"scheduledPostId"}}'use reqwest::Client;
use std::env;
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let base_url = env::var("OCTOSPARK_API_URL").unwrap_or_else(|_| "https://api.octospark.ai".to_string());
let team_id = env::var("OCTOSPARK_TEAM_ID").unwrap_or_else(|_| "teamId".to_string());
let scheduled_post_id = env::var("OCTOSPARK_SCHEDULED_POST_ID").unwrap_or_else(|_| "scheduledPostId".to_string());
let url = format!("{}/v1/teams/{}/scheduled-posts/{}/performance", base_url.trim_end_matches('/'), team_id, scheduled_post_id);
let token = env::var("OCTOSPARK_TOKEN").expect("OCTOSPARK_TOKEN");
let mut request = client.get(url).bearer_auth(token);
let response = request.send().await?;
println!("{}", response.text().await?);
Ok(())
}import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
Future<void> main() async {
final baseUrl = Platform.environment['OCTOSPARK_API_URL'] ?? 'https://api.octospark.ai';
final token = Platform.environment['OCTOSPARK_TOKEN'];
final teamId = Platform.environment['OCTOSPARK_TEAM_ID'] ?? 'teamId';
final scheduledPostId = Platform.environment['OCTOSPARK_SCHEDULED_POST_ID'] ?? 'scheduledPostId';
final url = '${baseUrl.replaceFirst(RegExp(r'/$'), '')}/v1/teams/$teamId/scheduled-posts/$scheduledPostId/performance';
final uri = Uri.parse(url);
final headers = {
'Authorization': 'Bearer $token',
};
final response = await http.get(
uri,
headers: headers,
);
print(response.body);
}curl --request GET \
--url https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance",
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-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance"
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-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance")
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$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$response = Invoke-WebRequest -Uri 'https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance' -Method GET -Headers $headersimport Foundation
let url = URL(string: "https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["Authorization": "Bearer <token>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
using RestSharp;
var options = new RestClientOptions("https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val request = Request.Builder()
.url("https://api-staging.octospark.ai/v1/teams/{teamId}/scheduled-posts/{scheduledPostId}/performance")
.get()
.addHeader("Authorization", "Bearer <token>")
.build()
val response = client.newCall(request).execute(){
"scheduledPostId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"platform": "x",
"collectionStatus": "pending",
"current": {
"likeCount": 123,
"commentCount": 123,
"shareCount": 123,
"saveCount": 123,
"impressionCount": 123,
"reachCount": 123,
"linkClickCount": 123
},
"derivedMetrics": {
"engagementRate": 123,
"performanceScore": 50,
"viralityScore": 123,
"qualityScore": 123,
"banditReward": 123
},
"content": {
"contentType": "text_post",
"isThread": true,
"caption": "<string>",
"title": "<string>",
"assetCount": 123,
"assetTypes": [
"<string>"
],
"assetCategories": [
"<string>"
],
"aiTags": [
"<string>"
],
"categories": [
"<string>"
],
"emotions": [
"<string>"
],
"purposes": [
"<string>"
],
"titles": [
"<string>"
],
"descriptions": [
"<string>"
],
"durationSecondsMax": 123,
"durationSecondsTotal": 123,
"widthMax": 123,
"heightMax": 123,
"fps": 123,
"assets": [
{
"assetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assetType": "<string>",
"aiTitle": "<string>",
"aiDescription": "<string>",
"aiTags": [
"<string>"
],
"contentCategory": "<string>",
"emotion": {},
"purpose": [
"<string>"
],
"durationSeconds": 123,
"width": 123,
"height": 123,
"fps": 123,
"analysis": {}
}
]
},
"snapshots": [
{
"hoursSincePost": 123,
"snapshotTakenAt": "<string>",
"likeCount": 123,
"commentCount": 123,
"shareCount": 123,
"saveCount": 123,
"impressionCount": 123,
"reachCount": 123,
"linkClickCount": 123,
"collectionError": "<string>"
}
],
"lastCollectedAt": "<string>"
}{
"issues": [
{
"_tag": "Pointer",
"path": [
"<string>"
],
"message": "<string>"
}
],
"message": "<string>",
"_tag": "HttpApiDecodeError"
}{
"message": "<string>",
"_tag": "Unauthorized"
}{
"message": "<string>",
"_tag": "PaymentRequired"
}{
"message": "<string>",
"_tag": "Forbidden"
}{
"message": "<string>",
"_tag": "NotFound"
}{
"message": "<string>",
"_tag": "Conflict",
"code": "<string>",
"currentRevision": 123
}{
"message": "<string>",
"code": "<string>",
"_tag": "UnprocessableEntity"
}{
"message": "<string>",
"_tag": "TooManyRequests",
"code": "<string>",
"retryAfterSeconds": 123
}{
"message": "<string>",
"_tag": "InternalError"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Team (workspace) id (UUID). Discover ids via the list teams endpoint or the agent context.
Scheduled-post leg id (UUID). One post fans out to one leg per target account; the leg carries the provider + platform post id used to read its comments.
Response
Success
a Universally Unique Identifier
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$Social platform identifier: x, tiktok, instagram, facebook, youtube, linkedin, threads, or pinterest.
x, tiktok, instagram, facebook, youtube, linkedin, threads, pinterest "x"
pending, collecting, completed, failed, stale Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes