Skip to content
postpeg

Analytics API

A social media analytics API that doesn’t make numbers up

One shape for post and account analytics on X, Instagram, Facebook, LinkedIn, TikTok, YouTube and Pinterest. A metric a network doesn’t report is null, never a made-up zero, so what you show your users is what the network said.

Post analytics

GET /v1/posts/{id}/analytics returns one entry per account the post went to, each with a status:

  • ready: metrics holds impressions, reach, views, likes, comments, shares, saves, clicks and engagement rate, and updated_at says when the network reported them.
  • syncing: the network hasn’t reported yet. New posts take minutes to hours.
  • unavailable: there won’t be numbers, and reason says why, such as a network without post analytics or a target that never published.

Results are cached for 15 minutes per target (2 minutes while syncing), because networks refresh their numbers every few hours at best.

Account analytics

GET /v1/accounts/{id}/analytics returns the follower count now, its change over the range as a number and a percentage, and a daily series. Pass from and to as YYYY-MM-DD; the default is the last 30 days and the range can be up to 366 days. That’s enough for a “followers this month” chart without storing anything yourself.

Where analytics are available

Post and account analytics work on X, Instagram, Facebook, LinkedIn, TikTok, YouTube and Pinterest. Threads, Bluesky and Google Business don’t provide them: post analytics for those targets come back as unavailable with the reason, and account analytics return a 400 naming the network, so your UI can explain rather than show zeros.

Which metrics are filled depends on the network; any it doesn’t report are null. The response shape is the same everywhere, so one chart component covers every network.

Example: one post’s numbers

curl https://api.postpeg.com/v1/posts/post_mfz2k3v8q1w5e9r4t7y0u2i6o3/analytics \
  -H "Authorization: Bearer $POSTPEG_KEY"
Response · 200 OK
{
  "post_id": "post_mfz2k3v8q1w5e9r4t7y0u2i6o3",
  "targets": [
    {
      "account_id": "acc_mfz1x0k27d4q8vbn3c5s0a1p9e",
      "platform": "x",
      "url": "https://x.com/acme/status/1971234567890123456",
      "status": "ready",
      "metrics": {
        "impressions": 4812,
        "reach": null,
        "views": null,
        "likes": 131,
        "comments": 9,
        "shares": 22,
        "saves": 6,
        "clicks": 74,
        "engagement_rate": 5.07
      },
      "updated_at": "2026-10-01T15:20:31.000Z",
      "reason": null
    }
  ]
}

engagement_rate is a percentage: 5.07 means 5.07%. The full field list is in the analytics docs.

Questions

Why is a metric null instead of 0?
Because the network didn’t report it. A 0 would mean nobody saw or liked the post, which may not be true. Show a dash, or hide the metric for that network.
How fresh are the numbers?
As fresh as the network’s own. postpeg caches each target for 15 minutes (2 minutes while it’s syncing), so polling faster returns the same numbers.
Can I get analytics for Threads, Bluesky and Google Business?
Not today. Threads, Bluesky and Google Business targets come back as unavailable with the reason, so your product can say so instead of showing zeros.
Is analytics charged per request?
No. Analytics, like posts, comments and DMs, is unlimited on every paid plan. Plans are priced by connected accounts.

The rest of the API

Send your first post in a few minutes

The 7-day trial has every feature and 3 connected accounts, with no card. The quickstart takes you from a key to a published post.