Social Media Analytics APIs: What Every Platform Exposes
Compare every social media analytics API: what Instagram, Facebook, X, YouTube, TikTok, LinkedIn and Pinterest expose, who can read it, and working code.
TLDR: Every platform has its own analytics API, and they disagree on almost everything: what a view is, who may read it, and how far back it goes. Most need the account owner’s OAuth grant, X bills every read, and LinkedIn needs partner approval. A unified API normalizes them into one format. Checked against each platform’s official docs on September 30, 2026.
What is a social media analytics API?
A social media analytics API returns performance numbers for posts and accounts: views, likes, comments, shares, saves, link clicks, and follower counts. There is no single one. Each platform runs its own, with its own permissions, field names, and history limits, and that is what this guide maps.
People searching for this term usually want one of three different things:
- Native analytics APIs are first-party endpoints such as Instagram’s insights, the YouTube Analytics API, or LinkedIn’s post statistics. They cover accounts that you or your users own, require the owner’s OAuth grant, and return the private numbers: reach, saves, watch time, demographics.
- Unified analytics APIs read the native ones for you and return one format across platforms. PostZen’s social media analytics API is one of these.
- Monitoring and listening APIs track public conversation across accounts you do not own: mentions, hashtags, sentiment. They are a different product built on different data, covered in its own section below.
We built PostZen’s analytics on eight of the native APIs, so the notes below include what the documentation leaves out.
Which metrics does each platform’s analytics API expose?
This is what each platform’s official API returns for an account you are authorized to read, as of September 30, 2026. “Views” means each platform’s own view or impression count, “Own, 30 days” means your own posts from the last 30 days, and the sections below explain why those counts are not the same thing.
| Platform | Views | Reach | Likes | Comments | Shares | Saves | Link clicks |
|---|---|---|---|---|---|---|---|
| Yes | Yes | Yes | Yes | Yes | Yes | Stories | |
| Facebook Pages | Yes | No | Yes | Yes | Yes | No | Yes |
| X | Yes | No | Yes | Yes | Yes | Yes | Own, 30 days |
| YouTube | Yes | No | Yes | Yes | Yes | No | No |
| TikTok | Yes | No | Yes | Yes | Yes | No | No |
| Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
| Yes | No | Yes | Yes | No | Yes | Yes | |
| Threads | Yes | No | Yes | Yes | Yes | No | Account |
| Bluesky | No | No | Yes | Yes | Yes | Yes | No |
All nine also report follower counts. Telegram is missing on purpose. Its Bot API, which is what posting tools use, returns no metrics at all; channel statistics exist only in the MTProto client API, as described below.
Two patterns stand out. Unique reach is now rare: only Instagram and LinkedIn report it, because Facebook removed its reach metrics in 2026. And link clicks are the least portable number in social media; every platform gates them differently, from Instagram limiting them to stories to X serving them only for your own posts under 30 days old.
Who can read each analytics API, and how far back does it go?
The metrics table says what exists. This one says what it takes to get it.
| Platform | Analytics endpoint | Who can read it | What it takes | History |
|---|---|---|---|---|
/{media-id}/insights, /{ig-user-id}/insights |
The professional account’s owner | instagram_business_manage_insights; App Review for other people’s accounts |
Story metrics only 24 hours through the API | |
| Facebook Pages | /{page-id}/insights, /{post-id}/insights |
People who can do the analyze task on the Page | read_insights and pages_read_engagement; App Review |
2 years |
| X | API v2 public_metrics and non_public_metrics |
Anyone for public counts; the owner for private ones | Prepaid credits; every read is billed | Private metrics: posts from the last 30 days |
| YouTube | Analytics API reports.query; Data API videos.list |
Channel owner; anyone for public counts | yt-analytics.readonly plus youtube.readonly |
Reports run 48 to 72 hours behind |
| TikTok | Display API /v2/video/list/ and /v2/user/info/ |
The creator | video.list and user.info.stats; app review |
Current totals only |
memberCreatorPostAnalytics, organizationalEntityShareStatistics |
The member; Page administrators | Community Management API approval | Company pages: rolling 12 months | |
/pins/{pin_id}/analytics, /user_account/analytics |
The account owner | pins:read, boards:read, user_accounts:read |
Start date no more than 90 days back | |
| Threads | /{media-id}/insights, /{user-id}/threads_insights |
The account owner | threads_manage_insights; App Review |
User insights from April 13, 2024 |
| Bluesky | app.bsky.feed.getPosts |
Anyone | Nothing | Current totals only |
| Telegram | MTProto stats.getBroadcastStats |
Admins of large enough channels | A user session, not a bot token | Not available in the Bot API |
Every “current totals only” row has the same consequence. If you want a chart of views over time, you have to read the counts on a schedule and store the deltas yourself, because the platform will not give you yesterday’s number tomorrow.
What does each platform’s analytics API give you?
Instagram Insights API
Instagram’s insights endpoints are the most complete in the set. Per post you get views, reach, likes, comments, saved, shares, and total_interactions, plus watch time and a skip rate for reels. Per account you get reach, views, accounts engaged, follower counts, and demographics, the last only for accounts with at least 100 followers. Two changes matter if you are reading old tutorials: impressions was removed from every API version on April 21, 2025, so views is the replacement, and in April 2026 Meta added aggregated totals that match the numbers in the Instagram app. Story metrics disappear from the API after 24 hours, so subscribe to the story insights webhook if you need them. Our Instagram Insights explainer defines every metric and its API field.
Facebook Page Insights API
Page metrics need a Page access token from someone who can perform the analyze task, plus read_insights and pages_read_engagement. The big change is recent: Meta deprecated the Page and post impression and reach metrics, and its Page Insights docs set June 15, 2026 as the date they stopped working on every API version. The replacement is a views metric, and its name has changed more than once, which is why PostZen probes the candidate metric names on a weekly cycle instead of hard-coding one. Reaction, comment, and share counts come from post fields rather than the insights edge and need the separate pages_read_user_content permission. Meta keeps Page metrics for two years.
X API metrics
X’s metrics reference splits post metrics by who is asking. The public_metrics group, which includes impression_count alongside likes, replies, reposts, quotes, and bookmarks, is readable for any public post. The non_public_metrics group adds link clicks and profile clicks, but only for the owner’s own posts created in the last 30 days. There is no account analytics endpoint; a follower history is something you build by sampling the user object. Every read is billed under X’s pay-per-use pricing: $0.005 per post read, or $0.001 for reads of your own account’s data, with repeat reads of the same post in a 24-hour window not charged again. Our guide to X views and impressions covers what those counts mean.
YouTube Analytics API
YouTube has two layers. The Data API’s videos.list returns public viewCount, likeCount, and commentCount for any video, updated far sooner than Analytics reports. The YouTube Analytics API answers owner-only questions through one method, reports.query: watch time, average view duration, subscribers gained and lost, shares, traffic sources, geography, and devices, by day or month. Its data is not real time; Google says processing “typically introduces a latency of 48 to 72 hours”. The required scope is yt-analytics.readonly (or yt-analytics-monetary.readonly for revenue), and the method now also requires access to youtube.readonly, which catches integrations that only asked for the analytics scope. For bulk daily exports, the YouTube Reporting API schedules report jobs instead of answering queries. The next section has working code.
TikTok analytics API
For organic content, TikTok’s analytics live in the Display API. The video.list scope returns each video’s view_count, like_count, comment_count, and share_count, and user.info.stats returns follower, following, total likes, and video counts. These are lifetime totals with no date ranges, reach, or watch time, so trend lines mean storing snapshots. Both scopes need app review; PostZen’s were approved in September 2026. TikTok’s Research API returns far more public data, but its eligibility page limits it to academic and not-for-profit researchers working independently of commercial interests, so it is not an option for a product. The TikTok API guide covers the review process.
LinkedIn analytics API
LinkedIn has two endpoints. memberCreatorPostAnalytics, behind r_member_postAnalytics, returns a member’s post impressions, members reached, reshares, reactions, comments, saves, sends, link clicks, and followers and profile views gained, either daily or as totals. organizationalEntityShareStatistics, behind rw_organization_admin for Page administrators, returns impressions, unique impressions, clicks, likes, comments, shares, and an engagement rate for company pages, within a rolling 12-month window. Both sit behind Community Management API approval. PostZen’s application is still pending, so LinkedIn analytics is not available in PostZen yet; the LinkedIn API pricing guide explains what that review involves.
Pinterest analytics API
Pinterest’s v5 API reports per Pin and per account. Pin analytics take a metric_types list that includes IMPRESSION, SAVE, PIN_CLICK, OUTBOUND_CLICK, TOTAL_REACTIONS, TOTAL_COMMENTS, and video metrics such as VIDEO_MRC_VIEW. The start date cannot be more than 90 days back, so a year of Pinterest history has to be collected as you go. Pins created before March 20, 2023 only report lifetime metrics for video and Idea Pin formats.
Threads Insights API
The Threads Insights API mirrors Instagram’s shape with fewer metrics. Per post you get views, likes, replies, reposts, quotes, and shares, with views and shares still marked as in development. Per account you get profile views as a time series, totals for likes, replies, reposts, and quotes, link clicks, follower count, and demographics. User insights reject any date before April 13, 2024. The Threads API guide covers authentication.
Bluesky and Telegram
Bluesky’s public post view carries likeCount, repostCount, replyCount, quoteCount, and bookmarkCount, readable by anyone with no authentication. There is no view count at all, because the AT Protocol does not count impressions server side.
Telegram is the opposite case. The Bot API that every posting tool uses returns no statistics. Channel statistics exist in the MTProto client API through stats.getBroadcastStats, available to admins of channels above a size threshold that Telegram sets server side, and it needs a logged-in user session rather than a bot token.
How do you query the YouTube Analytics API?
YouTube Analytics is the most searched of these APIs and the most commonly misused, so here is a complete request. It asks for daily views, watch time, average view duration, likes, and subscribers gained for the authenticated channel. The OAuth token needs both yt-analytics.readonly and youtube.readonly.
const ymd = (d) => d.toISOString().slice(0, 10)
export async function channelDailyStats(accessToken, days = 28) {
const end = new Date()
const start = new Date(end.getTime() - days * 86_400_000)
const url = new URL('https://youtubeanalytics.googleapis.com/v2/reports')
url.searchParams.set('ids', 'channel==MINE')
url.searchParams.set('startDate', ymd(start))
url.searchParams.set('endDate', ymd(end))
url.searchParams.set(
'metrics',
'views,estimatedMinutesWatched,averageViewDuration,likes,subscribersGained',
)
url.searchParams.set('dimensions', 'day')
url.searchParams.set('sort', 'day')
const res = await fetch(url, { headers: { Authorization: `Bearer ${accessToken}` } })
if (!res.ok) throw new Error(`YouTube Analytics ${res.status}: ${await res.text()}`)
const { columnHeaders, rows = [] } = await res.json()
// Read column order from columnHeaders; never assume it matches your request.
const names = columnHeaders.map((h) => h.name)
return rows.map((row) => Object.fromEntries(row.map((value, i) => [names[i], value])))
}
The same request in Python:
from datetime import date, timedelta
import requests
def channel_daily_stats(access_token: str, days: int = 28) -> list[dict]:
end = date.today()
start = end - timedelta(days=days)
res = requests.get(
"https://youtubeanalytics.googleapis.com/v2/reports",
headers={"Authorization": f"Bearer {access_token}"},
params={
"ids": "channel==MINE",
"startDate": start.isoformat(),
"endDate": end.isoformat(),
"metrics": "views,estimatedMinutesWatched,averageViewDuration,likes,subscribersGained",
"dimensions": "day",
"sort": "day",
},
timeout=30,
)
res.raise_for_status()
body = res.json()
names = [h["name"] for h in body["columnHeaders"]]
return [dict(zip(names, row)) for row in body.get("rows", [])]
Three things trip people up. The last two or three days come back missing, because the response stops at the last day for which every requested metric is processed. Some metric and dimension combinations are invalid, so check the channel reports page before adding a dimension such as country or video. And Google’s data model page asks applications to refresh or delete any stored video metadata from the Data API every 30 days. Upload and quota details are in our YouTube Data API guide.
What is the difference between an analytics API and a social media monitoring API?
An analytics API answers “how did my posts do?” A social media monitoring API, also called a social listening API, answers “what is everyone saying about this brand or topic?” The second needs posts from accounts you do not own, and the official routes to that data are narrow:
- X lets an app search public posts, but every post read is billed at the same per-read rate as analytics.
- YouTube’s Data API
search.listhas its own default quota of 100 calls a day. - Instagram hashtag search works only on the Facebook Login configuration and needs Meta’s Instagram Public Content Access feature.
- TikTok’s Research API is limited to academic and not-for-profit research.
- Bluesky is the open exception: the network’s public firehose streams every post, free.
- LinkedIn has no search or listening access in its official APIs.
That gap is why commercial listening tools exist, assembling coverage from official access and data partnerships. It is also why a “social media data API” selling other people’s Instagram or LinkedIn data on a monthly plan, without a platform partnership, is collecting public pages itself, which those platforms’ terms prohibit; LinkedIn has taken two such companies to court. PostZen is not a listening tool. It reads analytics, comments, and messages for the accounts you connect.
Why don’t metrics from different platforms add up?
Putting eight platforms in one dashboard is easy. Making the numbers mean the same thing is not.
- Views are counted differently. Instagram views count every display, repeats included, and replaced impressions in 2025. Facebook replaced its impression and reach metrics with a views metric. YouTube’s metrics page says its views metric “represents different numbers in different types of reports” and adds a separate engaged views metric. X’s view count is its public impression count. Bluesky has no views.
- Reach rarely exists. Only Instagram and LinkedIn report unique reach, so a cross-platform “total reach” is a sum of a few platforms and a blank for the rest.
- Shares are split. X has reposts and quotes, Threads has reposts, quotes, and shares, and Bluesky has reposts and quotes. A unified “shares” field has to decide what to add up, and should say so.
- Engagement rate has no standard. No platform’s API returns one. Divide interactions by views, reach, or followers, pick one denominator, and label it. PostZen divides interactions by impressions, which makes the rate meaningless on Bluesky, where there are no impressions; compare raw counts there.
- A zero is not always a zero. A unified API that stores every field for every platform has to put something in the fields a platform never reports. PostZen stores zero and its dashboard labels those cells “not reported”, so check a platform’s coverage before reading a zero as no engagement.
- Timing differs. YouTube reports run two to three days behind, while most other APIs return current totals, so “this week” is not the same window on every platform.
The shorter path: one analytics API for every account
If you want these numbers in your own product, a dashboard, or a warehouse, PostZen reads the native APIs and returns one format. It covers Instagram, Facebook, X, YouTube, TikTok, Threads, Pinterest, and Bluesky; LinkedIn is waiting on LinkedIn’s approval, and Telegram has no metrics to read. Every response uses the same eight fields: impressions, reach, likes, comments, shares, saves, clicks, and views.
This pulls the last 30 days for each platform as one row per day and platform, ready for a spreadsheet or a database. The received attribution puts each day’s new activity on the day it happened; publish would put a post’s lifetime totals on its publish date instead.
const API = 'https://api.postzen.dev/v1'
const PLATFORMS = ['instagram', 'facebook', 'x', 'youtube', 'tiktok', 'threads', 'pinterest', 'bluesky']
export async function dailyRows(days = 30) {
const to = new Date()
const from = new Date(to.getTime() - days * 86_400_000)
const rows = []
for (const platform of PLATFORMS) {
const url = new URL(`${API}/analytics/daily-metrics`)
url.searchParams.set('platform', platform)
url.searchParams.set('fromDate', from.toISOString().slice(0, 10))
url.searchParams.set('toDate', to.toISOString().slice(0, 10))
url.searchParams.set('attribution', 'received')
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.POSTZEN_API_KEY}` },
})
if (!res.ok) throw new Error(`PostZen ${res.status}: ${await res.text()}`)
const { dailyData } = await res.json()
for (const day of dailyData) rows.push({ date: day.date, platform, ...day.metrics })
}
return rows // [{ date, platform, impressions, reach, likes, comments, shares, saves, clicks, views }]
}
The same in Python:
import os
from datetime import date, timedelta
import requests
API = "https://api.postzen.dev/v1"
PLATFORMS = ["instagram", "facebook", "x", "youtube", "tiktok", "threads", "pinterest", "bluesky"]
def daily_rows(days: int = 30) -> list[dict]:
to = date.today()
frm = to - timedelta(days=days)
rows = []
for platform in PLATFORMS:
res = requests.get(
f"{API}/analytics/daily-metrics",
headers={"Authorization": f"Bearer {os.environ['POSTZEN_API_KEY']}"},
params={
"platform": platform,
"fromDate": frm.isoformat(),
"toDate": to.isoformat(),
"attribution": "received",
},
timeout=30,
)
res.raise_for_status()
for day in res.json()["dailyData"]:
rows.append({"date": day["date"], "platform": platform, **day["metrics"]})
return rows
Each row maps one to one onto a table keyed by date and platform, which answers the common “Instagram insights to Postgres” question for every platform at once:
create table social_daily_metrics (
date date not null,
platform text not null,
impressions bigint, reach bigint, likes bigint, comments bigint,
shares bigint, saves bigint, clicks bigint, views bigint,
primary key (date, platform)
);
The same API also returns per-post analytics sorted by engagement, a daily timeline for any single post, follower history by day, week, or month, and the hours your posts have historically done best, in UTC. Posts published outside PostZen are imported too, so the numbers cover the whole account, not just what you scheduled. X analytics is opt-in per connected account, because X bills every read and PostZen passes those charges through at X’s rates. The endpoints are in the analytics API reference, and the same request shape publishes to all ten platforms through the social media API.
Can AI agents analyze social media analytics?
Yes. AI social media analytics is mostly this: an agent with read access to the same API, which suits the questions people actually ask better than a dashboard does. PostZen’s MCP server exposes the analytics endpoints as tools, so Claude, Cursor, or any MCP client can answer a question like this one:
How did my posts do this week on Instagram and TikTok, and what should I post more of?
The agent calls getAnalytics sorted by engagement for each platform, compares formats, checks getBestTimeToPost, and answers in plain language with the numbers attached. Because the tools return the same eight fields for every platform, one prompt works across all of them, with the caveats above about views, reach, and zeros still applying.
Which analytics API should you use?
- One platform, your own account: call that platform’s API directly. For YouTube, use the Analytics API for watch time and the Data API for fresh counts.
- Several platforms, accounts you or your customers own: a unified API saves you eight OAuth integrations, several app reviews, a renamed Facebook metric, and X’s billing. PostZen’s pricing lists the plans.
- Accounts you do not own: you need public counts or a listening product, not an analytics API.
- Academic research on TikTok: apply for the Research API, which is not open to commercial use.
Frequently asked questions
What is a social media analytics API?
An API that returns performance metrics for posts and accounts, such as views, likes, comments, shares, saves, and follower counts. Each platform has its own: the Instagram and Facebook insights endpoints, X API v2 metrics fields, the YouTube Analytics API, TikTok's Display API, LinkedIn's Community Management API, and Pinterest's analytics endpoints. A unified API reads several of them and returns one normalized format.
Is there a free social media analytics API?
Mostly, yes. Meta, Google, TikTok, LinkedIn, Pinterest, and Bluesky charge nothing for analytics reads, although most require OAuth and several require app review. X is the exception: since February 2026 every read is billed, at $0.005 per post read, or $0.001 for reads of your own account's data.
Can I get analytics for social media accounts I do not own?
Only public counts. X returns view, like, reply, repost, quote, and bookmark counts for any public post, YouTube's Data API returns view, like, and comment counts for any public video, and Bluesky returns like, repost, reply, quote, and bookmark counts. Reach, saves, link clicks, watch time, and demographics need the owner's OAuth grant.
Does the YouTube Analytics API return real-time data?
No. Google says processing typically introduces a latency of 48 to 72 hours, so reports stop at the last fully processed day. For near-real-time totals, read view, like, and comment counts from the Data API's videos.list statistics instead.
How far back can social media analytics APIs go?
It depends on the platform. Pinterest analytics cannot start more than 90 days back, LinkedIn company page statistics cover a rolling 12 months, Facebook keeps Page metrics for 2 years, X serves private metrics only for posts from the last 30 days, Threads user insights start on April 13, 2024, and Instagram story metrics last 24 hours through the API. Store snapshots if you need a longer history.
Which platforms does PostZen's analytics API cover?
Instagram, Facebook, X, YouTube, TikTok, Threads, Pinterest, and Bluesky. LinkedIn analytics is waiting on LinkedIn's approval of the required permissions, and Telegram's Bot API exposes no metrics. X analytics is opt-in per account because X bills every read; PostZen passes those charges through at X's rates.



