Analytics API

A social media analytics API for your reports, dashboards and agents

The OnlySocial social media analytics API gives you the same numbers as the analytics pages in the app, as JSON. Read follower growth, reach and engagement for every connected account, see how each post did, and ask for the best time to post, all with one workspace key.

One key for 11 networksInstagram, Facebook, TikTok, YouTube, LinkedIn, Threads, Pinterest, Bluesky, Mastodon and Google Business Profile, read through the same endpoints and the same key.
Post analytics includedSee how one post did on every account it went out to, with daily trends that switch to weekly and monthly as the post gets older.
Best times, already scoredAsk for the best time to post and get scored weekday and hour slots from your own last 180 days, ready to schedule into.

What the social media analytics API returns

The social media analytics API is part of the OnlySocial Publishing API. It reads the analytics your workspace already collects for its connected accounts, so there is nothing extra to set up: connect an account, let the first import finish, and the numbers are there. Every answer is JSON, and charts come back as simple lists of dates and values that drop straight into a spreadsheet or a chart library.

Five read-only endpoints cover the whole workspace, one account, one post, the best times to post across accounts and the next best time for each account. They work for the 11 networks that report analytics, and the same figures power the social media analytics pages your team already uses in the app.

  • A workspace summary with follower growth, a leaderboard and posting activity
  • Per-account analytics in the tabs each network supports
  • Post analytics for every account a post went out to
  • Scored posting times and the next best time per account

Workspace analytics reports in one call

The summary endpoint looks at every account in the workspace over one period and returns what a weekly report needs: total followers, follower growth and posts with their change against the period before, the best-growing account and any account losing followers, a leaderboard, the most and least active accounts, each account's share of followers, total followers per day and how many days had a post.

Pick a period such as this week, last month, the last three months or this year, or send your own start and end dates. That makes analytics reports for a client or a manager one request, and the shape stays the same for every workspace, which keeps a reporting script simple.

Instagram analytics API and the other networks

For one account, ask for a type and get the data behind that tab in the app. The answer lists which types the account supports, because each network reports different things. Instagram offers overview, engagement, audience, reach, content, hashtags, insights and competitors, so the Instagram analytics API side covers the questions most social teams get asked about first.

Facebook Pages add video. Google Business Profile adds search terms and reviews. Threads, Bluesky, Mastodon and LinkedIn Pages report overview, engagement, content, hashtags and insights. Pinterest, TikTok and YouTube report the types their APIs share. The content type lists the period's posts with their metrics, paged and sortable by any metric, so you can pull the top posts of the month in one sorted call.

Insights in one answer

The insights type gives the best day, hour and post type, how often the account posts, its top post and the engagement trend, so a dashboard card needs no extra maths on your side.

First import status

While an account's first import is still running, the answer says so, which lets your report show a note instead of figures that are still filling in.

Post analytics for every account a post went out to

Post analytics answer the question every client asks after a campaign: how did that post do? Send the post's id and get a summary plus the figures for each account it was published to. Accounts it never went out to are left out, so a post that is still scheduled simply returns empty figures until it is live.

Trends are daily at first. Once a post has been tracked for 60 days the points are grouped by week, and after 180 days by month, so long-lived posts stay readable in a chart. Trashed posts can still be read, which keeps old campaign reports intact after someone tidies the calendar.

A best time to post API scored on your own history

The posting times endpoint scores every weekday and hour for the accounts you choose. Each post of the last 180 days with views counts by its engagement rate against its own account's average, and every account weighs the same, so one busy account does not drown out the others. A slot scores from 0 to 100, where 50 is average for these accounts and 100 is twice the average or better.

The answer names up to three best slots, at most one per weekday, with a confidence level based on how many posts sit behind each one. The best times endpoint goes one step further: it scores each account on its own history and returns its next best time within the coming week, never in the past. That is the best time to post API call a scheduling tool or an agent needs before it books a post.

What teams build with the social media analytics API

Agencies schedule a monthly job that reads each client workspace and fills a branded report. In-house teams pull the figures into the same warehouse as their sales data, so a campaign can be judged on orders as well as likes. Developers add a social card to an internal dashboard that shows follower growth and the top post of the week.

Because the social media analytics API returns the same figures as the app, nobody has to explain why a report and the dashboard show different numbers. Example: Marlow Studio, a sample shop, reads its Instagram and TikTok post analytics every Monday and schedules the week at each account’s next best time.

One workspace key with an analytics permission

Create a workspace API key in OnlySocial and give it the read analytics permission. The key can only read figures; it cannot post, delete or change anything, which makes it a safe key to hand to a reporting tool or a contractor. Personal access tokens can call the same endpoints with any workspace role, viewers included.

Every request sends the key as a bearer token. Limits are 60 requests per minute per key across the APIs, and a 429 answer tells you how many seconds to wait. The full reference, with every field and example answer, lives in the OnlySocial API docs.

  • Base URL: https://app.onlysocial.io/os/api
  • Header: Authorization: Bearer osk_YOUR_SECRET
  • Permission: read analytics (publishing:analytics:read)
  • X accounts have no analytics and return a clear 422
# Claude Code
claude mcp add --transport http onlysocial https://app.onlysocial.io/mcp

# Cursor: ~/.cursor/mcp.json
{
  "mcpServers": {
    "onlysocial": { "url": "https://app.onlysocial.io/mcp" }
  }
}

Analytics for AI agents through the MCP server

The same analytics are available to AI assistants as four tools on the OnlySocial MCP server. Ask Claude or ChatGPT which posts did best last month, or to schedule next week's posts at each account's best time, and the agent reads the figures before it acts. Actions you mark for approval still wait for a person.

Use the social media analytics API when you want figures in your own code, dashboards or a data warehouse, and the MCP tools when you want an assistant to read and act in plain words. Both read the same data with the same permissions, so a report and an agent never disagree about the numbers.

How to start with the social media analytics API

  1. Step 1

    Connect your accounts

    Connect Instagram, Facebook, TikTok, LinkedIn or any of the networks that report analytics, and let OnlySocial import their history.

  2. Step 2

    Create a key

    Create a workspace API key with the read analytics permission. Keep it on your server and never in a browser or a public repository.

  3. Step 3

    Call an endpoint

    Request the workspace summary, one account's tab, a post's analytics or the best times, and read the JSON answer.

  4. Step 4

    Build your report

    Feed the figures into a dashboard, a spreadsheet, a client report or an AI agent, and refresh them on a schedule.

What OnlySocial customers say

Rated 4.4 out of 5 from 61 reviews on Trustpilot. Read every review

GOOD

Infinite accounts, API endpoint, all good.

Alessandro SmedileItaly · Apr 2026 on Trustpilot
OnlySocial is Truly a Blessing!!!

I switched to OnlySocial from a major competitor and I have had the best experience in the world. Their customer service is top tier and they're adding new features all the time. I'd recommend OnlySocial to anyone looking to automate their social media experience.

Alvin HillUnited States · Nov 2023 on Trustpilot
OnlySocial Software has impressed me

The variety of available integrations is impressive, allowing the consolidation of many services, saving costs, and simplifying management.

Michael HemmersbachGermany · Jul 2024 on Trustpilot

Social media analytics API FAQ

Something else? The help and API docs cover every feature.

What is a social media analytics API?

A social media analytics API lets your own software read the figures a social tool collects, such as followers, reach, engagement and post performance, without opening the dashboard. With OnlySocial you call a handful of read-only endpoints with a workspace key and get JSON back for every connected account that reports analytics.

Which networks does the OnlySocial analytics API cover?

It covers the 11 networks that report analytics in OnlySocial: Instagram, Facebook Pages, Google Business Profile, Threads, Bluesky, Mastodon, LinkedIn Pages and profiles, Pinterest, TikTok and YouTube. X accounts have no analytics and return a 422, so your code can skip them cleanly.

Can I get post analytics for one post across every network?

Yes. Send the post's id and you get a summary plus the figures for each account it went out to. Trends are daily, then weekly after 60 days and monthly after 180 days. You can also read the scheduled and published posts themselves through the social media API.

Is there a best time to post API?

Yes. One endpoint scores every weekday and hour from 0 to 100 using your own posts from the last 180 days, and names up to three best slots. Another returns each account's next best time within the coming week, which is what a scheduler or an agent needs before booking a post.

Does the Instagram analytics API include audience and reach?

Yes. Instagram accounts support overview, engagement, audience, reach, content, hashtags, insights and competitors. Competitors needs the account to be connected through Facebook. Each answer lists the types the account supports, so your code can build its menu from the answer.

Can I build analytics reports for clients with it?

Yes. Agencies use the workspace summary for weekly analytics reports, with follower growth, a leaderboard and posting activity per period. Give each client its own workspace, create a read-only key per workspace, and the same script produces every report. See how agencies use OnlySocial for client work.

How much does the social media analytics API cost?

The analytics endpoints come with your OnlySocial plan, with no separate API fee. Every plan includes the Publishing, Messaging and Link in Bio APIs on one workspace key. Compare the limits on the pricing page.

Put your social numbers to work

Connect your accounts, create a read-only key and pull your first report from the social media analytics API today.

Scroll to Top