analytics.read permission for its history, its live post metrics, and its platform insights, and the posts.read permission for POST /v1/accounts/{id}/sync. Platform-specific insight endpoints, such as Instagram’s account summary and Google Business Profile performance metrics, are on the platform pages linked in Platform insights.
Endpoints
Read stored history
All 3 history endpoints take the same query parameters and return the same shape.
Read
subjects_counted before you chart a sum. A day on which fewer subjects reported adds up lower, and without the count a gap looks like a decline.
A range longer than 400 days returns 400 validation.range_too_wide. A from or to that is not YYYY-MM-DD returns 400 validation.from_invalid or 400 validation.to_invalid, and to before from returns 400 validation.range_inverted. A metrics name SocialAPI does not store returns no series for it. A range with no stored points returns "series": [].
What SocialAPI stores
- Post history: SocialAPI adds a point each time it syncs the post’s account: when you connect it, and when you call
POST /v1/accounts/{id}/sync. An account withoutanalytics.readadds no points. SocialAPI also refreshes post metrics in the background for every platform except X, LinkedIn, WhatsApp, and Pinterest. History starts when SocialAPI first tracks the post, so a post that was published long ago has no earlier points. A post with 2 or more targets returns one series per metric, summed across its targets. Pinterest posts are not synced, so they have no history. - Action counts: SocialAPI counts the replies, DMs, and moderation actions you send through the API, MCP tools, and Automations, per account and per day (UTC). Today’s count can be up to 24 hours behind. An account without
analytics.readis not counted. - Platform metrics: follower, reach, and view history from the platforms is not stored. Read current figures from the platform insight endpoints below.
Account, brand, and post history
- Account:
GET /v1/accounts/{id}/analyticsreturns the account’s series and, for an account with Pages, the series of its Pages summed. Addpage_idfor one Page. An unknown account returns404 account.not_found, an unknown Page returns404 resource.not_found, and an account withoutanalytics.readreturns403 account.permission_missing. - Brand:
GET /v1/brands/{id}/analyticssums every account and Page in the brand per metric and day. The sum includes accounts you disconnected, so history does not disappear when an account disconnects. An account withoutanalytics.readis left out of the sum. A brand-restricted key reads only its own brands. An unknown brand returns404 resource.not_found.day_tzismixedwhen platforms cut days differently. - Post:
GET /v1/posts/{pid}/analyticstakes the SocialAPI post ID (a UUID), not the platform’s post ID. A post that does not exist, or one your key cannot see, returns404 resource.not_found. A target whose account lacksanalytics.readis left out of the total, and a post with no target left returns403 account.permission_missing.
Read live post metrics
GET /v1/posts/{pid}/metrics asks each platform for the post’s current figures. It accepts the SocialAPI post ID or a platform post ID. A platform post ID that matches more than one post returns 409 ambiguous_post_id: use the SocialAPI post ID.
metrics or, when its platform cannot report them, an error. The HTTP status stays 200 whatever the targets return. A target whose status is not published does not appear. The figures are written to the post, so GET /v1/posts/{pid} shows the latest values and metrics_synced_at.
A figure a platform does not report is
0, except Instagram insights, which are absent when Instagram does not report them. A target that cannot be read returns the platform’s error, for example 404 resource.not_found when the platform no longer returns the post. A target whose account lacks analytics.read returns resource.not_found in its error, with a message that says the account could not be loaded.
Refresh an account’s posts
POST /v1/accounts/{id}/sync pulls the account’s posts from the platform now, so new posts and fresh counts appear without waiting for the background sync. It returns when the refresh finishes.
- Depth: Instagram covers up to the 500 most recent posts, Facebook up to the 500 most recent per Page, TikTok and Zalo the 20 most recent, and other platforms the 25 most recent. The TikTok platform route has its own cooldown: see TikTok.
- Cooldown: SocialAPI allows 1 sync per account every 5 minutes. The 5-minute window starts when you connect the account and on every sync request, including one that returns
501. A request inside the window returns429 accounts.sync_rate_limited, withRetry-Afteranderror.meta.retry_after_secondsset to the seconds left. - Unsupported platforms: a platform that cannot list posts, such as a LinkedIn member or profile connection or WhatsApp, returns
501 resource.not_supported. - Pinterest:
POST /v1/accounts/{id}/syncreturns 200{"success": true}and refreshes nothing: Pins are read live. - Other errors:
404 account.not_foundfor an account your key cannot reach,403 account.permission_missingfor an account withoutposts.read, and502with aplatform.{platform}.*code when the platform fails.
Platform insights
These endpoints return live figures from one platform:Scopes
A brand-restricted key can read history for its own brands only. See Scoped API keys.
Exports
Analytics exports build a report of an account’s videos and their metrics. Exports per billing period, videos per export, and the wait between exports depend on your plan. See History and export allowances.Use from an AI agent
POST /v1/accounts/{id}/sync has no tool. See MCP tools.
Related
- Track post delivery: post and target fields, including
metrics - Publish a post: create the posts you measure
- Plans and usage: export allowances
- Account permissions: the
analytics.readandposts.readpermissions - Scoped API keys: scopes for analytics
- Errors: every analytics error code