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.
{
"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
| Network | Impressions | Likes | Comments | Shares | Eng. |
|---|---|---|---|---|---|
| TikTok | 41,300 | 3,880 | 129 | 402 | 10.7% |
| 24,310 | 1,102 | 64 | 51 | 5.0% | |
| X | 9,870 | 143 | 17 | 29 | 1.9% |
| 6,410 | 188 | 22 | 14 | 3.5% | |
| All networks | 81,890 | 5,313 | 232 | 496 | 7.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.
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?…" }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" }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.
| Call | What it does | Endpoint | Credits |
|---|---|---|---|
| Post analytics | One post: impressions, reach, views, likes, comments, shares, saves, clicks and engagement rate, per network | GET /v1/analytics?postId= | 1 (X: 2 per post returned) |
| Account posts | Recent posts for an account with live metrics, sorted by any metric, between two dates | GET /v1/analytics?accountId= | 1 (X: 2 per post returned) |
| Followers | Follower count for Facebook, Instagram, LinkedIn pages, YouTube and Pinterest | GET /v1/analytics/followers | 1 |
| Instagram insights | Account reach, views and more over a date range | GET /v1/analytics/instagram/account-insights | 1 |
| Instagram audience | Audience breakdowns for an Instagram account | GET /v1/analytics/instagram/demographics | 1 |
Other agents
Analytics API questions
Something not here? Email hello@postkey.dev. I answer every one myself.
Book a 15-minute callYes. 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.