Skip to content

Social media analytics API

Views, likes, comments, shares, saves and engagement rate for every post, on every network, in one response shape. Plus follower counts and Instagram audience insights.

No card required.

GET /v1/analytics?postId=post_8Zp3c200 OK
{
  "post": {
    "postId": "post_8Zp3c",
    "aggregated": {
      "impressions": 81890, "likes": 5313,
      "comments": 232, "shares": 496,
      "saves": 233, "engagementRate": 0.074
    },
    "platforms": [
      { "platform": "tiktok", "views": 41300, … },
      { "platform": "instagram", "saves": 233, … },
      { "platform": "linkedin", "saves": null, … }
    ]
  }
}

Spring trail shoes are in.

Published 3 days ago on 4 networks

NetworkImpressionsLikesCommentsSharesEng.
TikTok41,3003,88012940210.7%
Instagram24,3101,10264515.0%
X9,87014317291.9%
LinkedIn6,41018822143.5%
All networks81,8905,3132324967.4%

Numbers for any post in three calls

Post through Postkey and keep the post id. Posts published outside Postkey work too: pass the network's own post id.

  1. Connect the account

    Your user connects once. The same connection posts, reads comments and reads analytics.

    GET /v1/connect/instagram
      ?profileId=prof_northwind
    { "url": "https://www.instagram.com/oauth/authorize?…" }
  2. Post and keep the id

    Every post you publish through Postkey has one id across all its networks.

    POST /v1/posts
    { "content": "Spring trail shoes are in.", … }
    { "postId": "post_8Zp3c", "status": "published" }
  3. Read the numbers

    One call returns totals across networks and the numbers for each network. Metrics a network doesn't report come back as null, never as zero.

    GET /v1/analytics?postId=post_8Zp3c
    { "aggregated": { "impressions": 81890, "likes": 5313, … },
      "platforms": [ … ] }

Analytics endpoints

Same key, same connected accounts and same response shape on every network. Failed calls cost nothing.

Analytics endpoints: endpoints and credit costs
CallWhat it doesEndpointCredits
Post analyticsOne post: impressions, reach, views, likes, comments, shares, saves, clicks and engagement rate, per networkGET /v1/analytics?postId=1 (X: 2 per post returned)
Account postsRecent posts for an account with live metrics, sorted by any metric, between two datesGET /v1/analytics?accountId=1 (X: 2 per post returned)
FollowersFollower count for Facebook, Instagram, LinkedIn pages, YouTube and PinterestGET /v1/analytics/followers1
Instagram insightsAccount reach, views and more over a date rangeGET /v1/analytics/instagram/account-insights1
Instagram audienceAudience breakdowns for an Instagram accountGET /v1/analytics/instagram/demographics1

Analytics is one of 6 APIs

Every API uses the same key, profiles and connected accounts.

Which networks each Postkey API supports
APIXInstagramYouTubeFacebookTikTokLinkedInPinterestGoogle Business
Publishing
Scheduling
AnalyticsYou're here
Comments
Comment to DM
Reviews

Analytics API questions

Something not here? Email hello@postkey.dev. I answer every one myself.

Book a 15-minute call
  • Yes. Pass the network's own post id and the account id. Postkey reads the numbers live from the network.

  • Each network reports different numbers. LinkedIn has no saves, for example. Postkey keeps one shape for every network and returns null when a network doesn't report a metric, so you never show a fake zero.

  • 1 credit per call. On X it's 2 credits per post returned, because X charges for every read. Failed calls are free.

  • They are fetched from the network when you call, not from a nightly copy.

Get your key and make the first call.

$ curl -X POST api.postkey.dev/v1/posts -H "x-access-key: …"

No card required.