Analytics

Read post-level analytics and workspace-wide summaries, or trigger a fresh sync from the platforms. Numbers come from the same pipeline that powers the ShortSync dashboard. Covers Instagram, YouTube, TikTok, Facebook, LinkedIn, Threads, Bluesky, Pinterest, Snapchat, Mastodon, Pixelfed, Reddit and Tumblr.

X posts have analytics once the workspace adds its own X API key (see X analytics); until then they come back with fetch_status unavailable. Google Business Profile has no per-post stats, so its posts are also unavailable. Telegram and Discord have no analytics.

Reads (GET) return whatever's currently in our store; the per-row fetched_at field tells you how stale each row is. To refresh, POST /analytics/sync and poll the returned status_url until the job reports completed.

Base path: https://api.shortsync.app/v1

EndpointMethodPathScopePurpose
SummaryGET/analytics/summaryanalytics:readWorkspace-wide totals + per-platform breakdown
List post analyticsGET/analytics/postsanalytics:readCursor-paginated per-post rows
Get post analyticsGET/analytics/posts/{post_id}analytics:readOne post's latest metrics snapshot
Compare Instagram accountsGET/analytics/instagram-compareanalytics:readYour Instagram next to up to 5 other public accounts
Account growthGET/analytics/account-growthanalytics:readFollowers and post counts per account, with growth
Trigger syncPOST/analytics/syncanalytics:writeForce a fresh pull from every platform
Get sync jobGET/analytics/sync/{job_id}analytics:readPoll a running sync's status

Summary

GET/analytics/summary·analytics:read

Per-platform breakdown for a time window. Numbers are post-summed from our store. The dashboard additionally overlays account-level API numbers for Instagram, YouTube, and TikTok for "matches the number in the app" accuracy, which we haven't plumbed through here yet.

Query parameters

FieldTypeDescription
fromstringISO 8601 lower bound for published_at. Defaults to the beginning of time when omitted.
tostringISO 8601 upper bound. Defaults to now.
platformPlatform[]Comma-separated filter. Values: instagram, youtube, tiktok, facebook, linkedin, threads, bluesky, pinterest, snapchat, mastodon, pixelfed, reddit, tumblr, twitter.

Example request

bash
curl "https://api.shortsync.app/v1/analytics/summary?from=2026-06-01T00:00:00Z&to=2026-07-01T00:00:00Z" \
  -H "Authorization: Bearer $TOKEN"

Example response

json
{
  "data": {
    "workspace_id": "bbdeeb40-...",
    "window": {
      "from": "2026-06-01T00:00:00.000Z",
      "to":   "2026-07-01T00:00:00.000Z"
    },
    "last_synced_at": "2026-07-08T08:04:56.891Z",
    "per_platform": [
      {
        "platform": "instagram",
        "views": 5015409,
        "likes": 84213,
        "comments": 4102,
        "shares": 1121,
        "saves": 812,
        "engagement_rate": 1.78,
        "watch_time_seconds": null,
        "posts_tracked": 88
      },
      {
        "platform": "youtube",
        "views": 43951226,
        "likes": 118201,
        "comments": 6002,
        "shares": 2810,
        "saves": 0,
        "engagement_rate": 0.29,
        "watch_time_seconds": 2451820,
        "posts_tracked": 132
      }
    ]
  }
}

Response fields

FieldTypeDescription
data.window.fromstring | nullEcho of the request's from param (or null).
data.last_synced_atstring | nullNewest fetched_at across every row that fed the response. Null when the workspace has no synced data yet.
data.per_platform[].viewsnumber | nullNull (not zero) when the platform's insights scope isn't granted on the current connection. We can't tell "zero views" from "unknown", so we return null and let you distinguish.

Account growth

GET/analytics/account-growth·analytics:read

Follower, subscriber, following and post counts for each connected account, plus the growth since from when you pass it. YouTube, Facebook and Instagram growth comes live from the platform (Instagram covers at most 30 days, shown in growth_window_days); the others come from daily snapshots.

Query parameters

FieldTypeDescription
fromstring (ISO 8601)Window start. Leave it out for current counts without growth.
tostring (ISO 8601)Window end. Defaults to now.
platformstringComma-separated filter, e.g. instagram,tiktok.

Example request

bash
curl "https://api.shortsync.app/v1/analytics/account-growth?from=2026-10-01T00:00:00Z" \
  -H "Authorization: Bearer $TOKEN"

Compare Instagram accounts

GET/analytics/instagram-compare·analytics:read

Your workspace's Instagram account next to up to five other public Business or Creator accounts, read live from Instagram. Averages cover each account's last 12 posts. Needs Facebook Login for Instagram on the workspace; without it the response is 428 FACEBOOK_LOGIN_REQUIRED. Personal or age-gated accounts come back with ok: false and an error.

Query parameters

FieldTypeDescription
usernamesstringComma-separated Instagram usernames, up to 5 (with or without @, or profile links). Omit to get only your own account.

Example request

bash
curl "https://api.shortsync.app/v1/analytics/instagram-compare?usernames=natgeo,instagram" \
  -H "Authorization: Bearer $TOKEN"

Example response

json
{
  "data": {
    "workspace_id": "bbdeeb40-...",
    "own": {
      "ok": true,
      "account": {
        "username": "yourbrand",
        "followers_count": 12840,
        "media_count": 412,
        "recent": {
          "posts": 12,
          "avg_likes": 384,
          "avg_comments": 21,
          "avg_reel_views": 9120,
          "engagement_rate": 3.15,
          "posts_per_week": 3.5
        }
      }
    },
    "accounts": [
      { "ok": true, "account": { "username": "natgeo", "followers_count": 268300000, "...": "..." } },
      { "ok": false, "username": "someprivateuser", "error": "Instagram can't show this account. It may not exist, or it's a personal account." }
    ]
  }
}

Response fields

FieldTypeDescription
data.own / data.accounts[].account.recent.engagement_ratenumber | null(average likes + average comments) / followers, in percent.
...recent.avg_reel_viewsnumber | nullReels only; null when none of the recent posts is a Reel.

List post analytics

GET/analytics/posts·analytics:read

Per-post analytics rows, cursor-paginated. Each row is the latest snapshot for that post. How stale it is depends on when the platform sync last ran (visible on the per-row fetched_at).

Query parameters

FieldTypeDescription
platformPlatform[]Comma-separated: e.g. instagram,youtube.
connection_idstringNarrow to one connection.
published_afterstringISO 8601 lower bound on the post's published_at.
published_beforestringISO 8601 upper bound on the post's published_at.
sortstringOne of fetched_at_desc (default), published_at_desc, views_desc. The cursor is bound to the current sort, so don't switch sort keys mid-pagination.
cursorstringOpaque cursor from the previous response.
limitinteger1-100. Defaults to 25.

Example request

bash
curl "https://api.shortsync.app/v1/analytics/posts?platform=tiktok&sort=views_desc&limit=10" \
  -H "Authorization: Bearer $TOKEN"

Example response

json
{
  "data": [
    {
      "post_id": "97d1b3d6-...",
      "platform": "tiktok",
      "platform_post_id": "7345678901234567890",
      "connection_id": "con_tiktok_...",
      "published_at": "2026-06-24T13:12:00Z",
      "permalink": "https://www.tiktok.com/@cookwithhilma/video/7345678901234567890",
      "title": null,
      "caption": "5 things I wish I knew before starting to bake bread…",
      "thumbnail_url": "https://cdn.shortsync.app/thumbs/…",
      "metrics": {
        "views": 452189,
        "likes": 12034,
        "comments": 203,
        "shares": 671,
        "saves": null,
        "reach": null,
        "impressions": null,
        "watch_time_seconds": null,
        "avg_watch_time_seconds": null,
        "engagement_rate": 2.86
      },
      "fetch_status": "success",
      "fetched_at": "2026-07-08T08:04:56.891Z"
    }
  ],
  "pagination": { "next_cursor": "eyJ0aW1lc3RhbXAiOiIyMDI2LTA3LTA4Li..." }
}

Response fields

FieldTypeDescription
data[].post_idstringUUID of the post row this analytics snapshot belongs to. Matches the id returned by POST /posts.
data[].platform_post_idstring | nullThe upstream platform's id for the post (e.g. TikTok's video_id, YouTube's videoId).
data[].permalinkstring | nullBest-effort link to the post on the source platform. Null when we can't construct one from what we have.
data[].metricsobjectNumeric fields all use null to mean "unknown / scope missing / not applicable" and 0 to mean "genuinely zero". Don't coalesce null to 0 in aggregations you display.
data[].fetch_statusstringsuccess when the row has any live data; failed when the last sync couldn't get anything for it (e.g. the post was deleted on the platform).
data[].fetched_atstring | nullWhen we last successfully talked to the platform for this row.

Get post analytics

GET/analytics/posts/{post_id}·analytics:read

The same shape as one row of GET /analytics/posts, for a specific post. Returns 404 when the post doesn't belong to the resolved workspace so integrators can't probe for arbitrary ids.

Example request

bash
curl https://api.shortsync.app/v1/analytics/posts/$POST_ID \
  -H "Authorization: Bearer $TOKEN"

Trigger sync

POST/analytics/sync·analytics:write

Asynchronous. Returns 202 Accepted immediately with a job_id; the actual multi-minute work happens in the background so your HTTP connection isn't held open. Poll status_url until status: "completed", then refresh from /analytics/summary or /analytics/posts.

One in-flight sync per workspace. A second POST while a queued/running job exists returns 409 SYNC_IN_PROGRESS with the existing job_id, so your client can rebind to it.

Idempotency. Send an Idempotency-Key header. Replaying the same key inside the retention window returns the original 202 payload instead of enqueueing a duplicate.

Request body

FieldTypeDescription
platformPlatformOptional. Narrow the sync to one platform. Values: instagram, youtube, tiktok, facebook, linkedin, threads, bluesky, pinterest, snapchat, mastodon, pixelfed, reddit, tumblr, twitter, google_business. Omit to sync every supported connected platform.

Example request

bash
curl -X POST https://api.shortsync.app/v1/analytics/sync \
  -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: sync-$(date +%s)" \
  -H "Content-Type: application/json" \
  -d '{}'

Example response (202)

json
{
  "data": {
    "job_id": "42f7d1b3-c106-4ed6-95b5-c0e76086c957",
    "status": "queued",
    "status_url": "https://api.shortsync.app/v1/analytics/sync/42f7d1b3-...",
    "estimated_seconds": 300,
    "requested_at": "2026-07-08T14:11:34.221Z"
  }
}

Polling pattern

ts
const { data } = await fetch('/v1/analytics/sync', {
  method: 'POST',
  headers: { Authorization: 'Bearer ' + TOKEN, 'Content-Type': 'application/json' },
  body: '{}',
}).then(r => r.json());

// Poll every 15s. Longest sync we've seen is ~4min → ~16 polls in the worst case.
while (true) {
  await new Promise(r => setTimeout(r, 15_000));
  const { data: job } = await fetch(data.status_url, {
    headers: { Authorization: 'Bearer ' + TOKEN },
  }).then(r => r.json());
  if (job.status === 'completed') break;
  if (job.status === 'failed')    throw new Error(job.error);
}
// Fresh numbers now available on /analytics/summary and /analytics/posts

Errors

FieldTypeDescription
409 SYNC_IN_PROGRESSerrorA sync is already queued or running for this workspace. The response body's details field carries the existing job_id + status_url so you can attach to it instead of retrying.
429 QUOTA_EXCEEDEDerrorYour organization's monthly API request quota is exhausted. See GET /me for the counter.

Get sync job

GET/analytics/sync/{job_id}·analytics:read

Poll a sync job's status. Scope is analytics:read; reading a job's state is a read operation, so you don't need analytics:write to observe your own jobs.

Example request

bash
curl https://api.shortsync.app/v1/analytics/sync/$JOB_ID \
  -H "Authorization: Bearer $TOKEN"

Example response

json
{
  "data": {
    "job_id": "42f7d1b3-...",
    "status": "running",
    "platform": null,
    "requested_at": "2026-07-08T14:11:34.221Z",
    "started_at":   "2026-07-08T14:11:36.501Z",
    "completed_at": null,
    "progress": {
      "posts_synced": 82,
      "posts_total": 293
    },
    "per_platform": [
      { "platform": "tiktok",    "posts_synced": 25, "total_posts": 25, "has_more": false, "next_offset": 25 },
      { "platform": "instagram", "posts_synced": 40, "total_posts": 88, "has_more": true,  "next_offset": 40 },
      { "platform": "youtube",   "posts_synced": 17, "total_posts": 132,"has_more": true,  "next_offset": 17 }
    ],
    "error": null
  }
}

Response fields

FieldTypeDescription
data.statusstringOne of queued, running, completed, failed, canceled. Stop polling on any of the last three.
data.progress.posts_syncedintegerRunning total across every platform in the sync. Updates as each platform finishes its chunk.
data.progress.posts_totalintegerBest-known denominator. May grow mid-sync if video discovery finds new posts.
data.per_platform[].has_morebooleanTrue when the platform still has posts beyond this batch. Trigger another POST /analytics/sync after this one completes to page further.
data.errorstring | nullHuman-readable summary of any per-platform errors. Non-null when at least one platform in the sync reported an error.