Skip to content
BrainyShorts Docs
Esc
↑↓navigate↵open⌘Jpreview

Get analytics

Metrics for published posts that BrainyShorts has synced from the platforms. Without post_id it returns {summary, posts}. The summary totals cover only the returned posts: at most limit (default 20, max 100), newest first, after the optional filters. It is not an account total. post_id here is the id of the synced platform post, not the id or post_id from GET /api/cli/posts; take it from this endpoint’s own posts[]. With post_id it returns that one post with a metrics object.

GET/api/cli/analytics
Authorization
AuthorizationBearer token (ba_sk_...) · headerrequired

API key from /dashboard/api-keys. Keys expire after 365 days.

or
AuthorizationBearer token (ba_mcp_access_...) · headerrequired

The OAuth access token the hosted MCP server issues (brainy:read for GET routes, brainy:write for everything else). One login serves MCP, the CLI and the desktop app. A token without the needed scope gets 403 Insufficient scope.

Query parameters
platformPlatform
Allowed:tiktokinstagramyoutubelinkedinx
account_idstring
post_idstring

Id of a synced platform post, taken from posts[].post_id in this endpoint's overview. Not a scheduled-post id.

start_datestring<date-time>
end_datestring<date-time>
limitinteger

Posts to include, newest first. Summary totals cover only these posts.

min 1 · max 100 · default: 20
Responses
200

OK

One of:
object
summaryobject

Totals over the returned posts only, not the whole account

Show properties
total_postsinteger
totalViewsinteger
totalLikesinteger
totalCommentsinteger
totalSharesinteger
postsobject[]
Show properties
Array of object
post_idstring

Id of the synced platform post. Pass it as post_id to this endpoint.

platform_post_idstring

The platform's own post id

social_account_idstring<uuid>
platformPlatform
Allowed:tiktokinstagramyoutubelinkedinx
titlestring
posted_timestring<date-time>
platform_urlstring | null
viewsinteger
likesinteger
commentsinteger
sharesinteger
savesinteger
object
post_idstring

Id of the synced platform post. Pass it as post_id to this endpoint.

platform_post_idstring

The platform's own post id

social_account_idstring<uuid>
platformPlatform
Allowed:tiktokinstagramyoutubelinkedinx
titlestring
posted_timestring<date-time>
platform_urlstring | null
metricsobject
Show properties
viewsinteger
likesinteger
commentsinteger
sharesinteger
savesinteger
400

Invalid platform or date

errorstringrequired
codestring
401

Missing, invalid, expired, or revoked API key

errorstringrequired
codestring
404

Post not found

errorstringrequired
codestring
Try it
Server
Authorization
Parameters
Request
curl -X GET "https://www.brainyshorts.com/api/cli/analytics" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "summary": {
    "total_posts": 0,
    "totalViews": 0,
    "totalLikes": 0,
    "totalComments": 0,
    "totalShares": 0
  },
  "posts": [
    {
      "post_id": "string",
      "platform_post_id": "string",
      "social_account_id": "f4777757-36aa-48ee-b520-6e818e68eb51",
      "platform": "tiktok",
      "title": "string",
      "posted_time": "2019-08-24T14:15:22Z",
      "platform_url": "string",
      "views": 0,
      "likes": 0,
      "comments": 0,
      "shares": 0,
      "saves": 0
    }
  ]
}