# Normalized Social Media Analytics API

Human page: https://pubnio.com/social-media-analytics

## Summary

PubNio's post analytics API normalizes lifetime totals and daily metric deltas across Facebook Pages, Instagram, and TikTok into one typed schema. Observations are stored in PubNio and linked to the exact publish attempt so dashboards and agents can read performance immediately without hitting live provider rate limits.

## Capabilities & contract

| Capability | PubNio contract |
| --- | --- |
| Live analytics providers | Facebook Pages, Instagram (Feed, Carousel, Reel, Story), and TikTok |
| Returned metrics | Normalized impressions, reach, likes, comments, shares, saves, clicks, and daily delta series |
| Attempt-level attribution | Every observation links to the exact publish attempt ID so retried posts never blur metrics |
| Read latency & rate limits | Reads serve stored observations directly from PubNio without consuming live social API quotas |
| Scope isolation | Missing optional analytics scopes never block publishing or invalidate connected accounts |
| History retention by plan | 30 days (Pay as you go), 1 year (Pro), 2 years (Platform), Custom (Enterprise) |

## Pain points PubNio analytics removes

- Translating Facebook Insights, Instagram Media Insights, and TikTok video query fields into compatible column names.
- Hitting Meta or TikTok API rate limits whenever customers or agents reload a campaign dashboard.
- Losing attribution when a failed post is retried and gets a second external provider ID.
- Analytics read add-on fees: reads are included in your PubNio plan at $0 per query.

## Honest coverage & roadmap clarity

- Post analytics support is implemented for Facebook Pages, Instagram, and TikTok; availability depends on provider approval and account permissions.
- Analytics for LinkedIn, Pinterest, X, and YouTube are on the roadmap; publishing availability depends on provider approval and account permissions.
- Every analytics response includes observation timestamps so agents know exact data freshness.
- Available via REST API, TypeScript SDK, CLI, and hosted MCP.

## TypeScript SDK example

```ts
const report = await ws.analytics.getPost(postId);

console.log({
  impressions: report.totals.impressions,
  engagements: report.totals.engagements,
  channels: report.targets.map((t) => ({
    provider: t.provider,
    placement: t.placement,
    impressions: t.totals.impressions,
    dailySeries: t.dailySeries,
  })),
});
```

## Hosted MCP example

```sh
# Prompt inside Claude Code, Codex, Cursor, or OpenCode:
"Pull 7-day normalized analytics for our last 5 published posts across Instagram,
TikTok, and Facebook Pages and rank them by engagement rate."
```

## CLI example

```sh
pnio analytics post --post-id pst_01j9k4 --json
```

## FAQs

### Which platforms support post analytics today?

Facebook Pages, Instagram, and TikTok support normalized lifetime totals and daily series today. LinkedIn, Pinterest, X, and YouTube support full publishing today, with post analytics on the roadmap.

### Do analytics API reads cost extra?

No. Reading stored post analytics is included on Pay as you go (30-day history), Pro (1-year history), and Platform (2-year history) at $0 per read.

### What happens if a connected account lacks insights permissions?

PubNio isolates analytics scopes from publishing scopes. Missing insights permissions surface as a clean status on the analytics read without interrupting publishing or disconnecting the account.
