# Analytics

Source: https://ampost.io/docs/analytics · Full reference: https://ampost.io/llms-full.txt

## Analytics

The numbers the dashboard shows, with scope `analytics:read`. Every platform fills the same fields (`views`, `reach`, `likes`, `comments`, `shares`, `saves`, `quotes`, followers); a metric a platform does not report is `null`.

| Platform | Post metrics | Followers | Notes |
| --- | --- | --- | --- |
| Facebook Page, Instagram | views, reach, likes, comments, shares, saves | yes | Meta can lag 24-48 hours |
| Threads, TikTok | views, likes, comments, shares | yes | |
| LinkedIn (coming soon) | none | no | LinkedIn is coming soon; its analytics are not part of it |
| Bluesky | likes, comments, shares (reposts), quotes | yes | no views |
| X | views (impressions), likes, comments, shares (reposts), quotes, saves | yes | opt-in per account with `accounts_set_analytics`, Max and Scale only; posts published through Ampost, up to 29 days old; every read counts against the plan's X units |
| YouTube | views, likes, comments | yes (subscribers, unless hidden) | posts published through Ampost |
| Pinterest | views (impressions), likes (reactions), comments, saves | yes | posts published through Ampost; Pins older than 90 days report their last 90 days |
| Telegram | none | yes (members) | |
| Discord | none | none | 422 `ANALYTICS_NOT_AVAILABLE_ON_PLATFORM` |

Ampost reads analytics in the background and serves the stored numbers: each account about hourly (daily on the Free plan), a post's metrics hourly in its first 48 hours, every 6 hours up to 14 days and daily up to 90 days. X posts are read daily in their first 3 days and weekly up to 29 days, which costs the plan's X units. Meta itself can lag 24-48 hours. `syncedAt` says when each number was read. When none of the matching accounts has analytics enabled, the call answers 403 `ANALYTICS_NOT_ENABLED` instead of an empty list; `details.accounts[]` gives each account's `reason` (`opt_in_required`, `platform_disabled`, `page_not_selected`, `account_inactive` or `not_available_on_platform`; LinkedIn, which is coming soon, is `platform_disabled`). Relay it; retrying does not help unless the reason is `opt_in_required` and the user agrees to turn X analytics on.

### Post analytics

`GET /api/analytics/posts` · MCP tool `analytics_posts` · scope `analytics:read` · rate limit `apiRead` · success `200`

Metrics of your published posts, newest first: one `platformPosts` entry per account the post went to, with views, reach, likes, comments, shares and saves (null when the platform does not report one). Pass `postId` for one post. `analyticsStatus` says why an entry has no metrics. Use it for per-post numbers; for totals per account over a date range use analytics_overview, for follower counts over time analytics_followers, and for a post's publish status posts_get. Filter by `postId`, `platform`, `platformSetId` or `accountId`; paginated with `limit` and `offset`. 404 POST_NOT_FOUND or ACCOUNT_NOT_FOUND for an id that is not yours.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `postId` | query | string | no | Only this post (`id` from posts_list). Default: every published post. |
| `platform` | query | instagram \| facebook \| linkedin \| tiktok \| threads \| twitter \| discord \| telegram \| bluesky \| youtube \| pinterest | no | Only accounts on this platform. Default: every platform with analytics. |
| `platformSetId` | query | string | no | Only accounts in this platform set (`id` from platform_sets_list). Default: every set the key can see. |
| `accountId` | query | string | no | Only this account (`id` from accounts_list). Default: every matching account. |
| `limit` | query | integer | no | Page size, 1-100. Default 20. |
| `offset` | query | integer | no | Number of items to skip. Default 0. |

Example response:

```json
{
  "data": [
    {
      "postId": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
      "status": "published",
      "text": "Launch day: Ampost publishes everywhere from one API.",
      "createdAt": "2026-10-06T09:00:00.000Z",
      "platformPosts": [
        {
          "platform": "instagram",
          "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
          "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
          "platformPostId": "17912345678901234",
          "publishedUrl": "https://www.instagram.com/p/C9xYz12AbCd/",
          "publishedAt": "2026-10-06T09:00:04.000Z",
          "contentType": "image",
          "analyticsStatus": "available",
          "metrics": {
            "views": 1840,
            "reach": 1210,
            "likes": 96,
            "comments": 12,
            "shares": 7,
            "saves": 15,
            "quotes": null
          },
          "syncedAt": "2026-10-08T10:12:00.000Z"
        },
        {
          "platform": "facebook",
          "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
          "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
          "platformPostId": "104857600000000_122100000000000",
          "publishedUrl": "https://www.facebook.com/104857600000000/posts/122100000000000",
          "publishedAt": "2026-10-06T09:00:04.000Z",
          "contentType": "image",
          "analyticsStatus": "available",
          "metrics": {
            "views": 920,
            "reach": 640,
            "likes": 41,
            "comments": 3,
            "shares": 5,
            "saves": null,
            "quotes": null
          },
          "syncedAt": "2026-10-08T10:14:00.000Z"
        }
      ]
    }
  ],
  "pagination": {
    "limit": 20,
    "offset": 0,
    "total": 1,
    "hasMore": false
  }
}
```

### Analytics overview

`GET /api/analytics/overview` · MCP tool `analytics_overview` · scope `analytics:read` · rate limit `apiRead` · success `200`

Per account and in total, for posts published between `from` and `to` (UTC days, default the last 30): post count, summed views, reach, likes, comments, shares and saves, followers and their change, and sync state. These are the dashboard's numbers. `unavailableAccounts` lists matching accounts without analytics and why. Use it for a summary or a period comparison (call it twice with different ranges); for each post's own metrics use analytics_posts, and for the day-by-day follower curve analytics_followers. Filter by `platform`, `platformSetId` or `accountId`; not paginated. A range longer than 90 days or with `from` after `to` is 400 VALIDATION_FAILED.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `from` | query | string | no | First day (UTC), YYYY-MM-DD. Default: 29 days before `to`. At most 90 days with `to`. |
| `to` | query | string | no | Last day (UTC), YYYY-MM-DD, included. Default: today. |
| `platform` | query | instagram \| facebook \| linkedin \| tiktok \| threads \| twitter \| discord \| telegram \| bluesky \| youtube \| pinterest | no | Only accounts on this platform. Default: every platform with analytics. |
| `platformSetId` | query | string | no | Only accounts in this platform set (`id` from platform_sets_list). Default: every set the key can see. |
| `accountId` | query | string | no | Only this account (`id` from accounts_list). Default: every matching account. |

Example response:

```json
{
  "from": "2026-09-09",
  "to": "2026-10-08",
  "totals": {
    "posts": 14,
    "followers": 5320,
    "followersChange": 142,
    "metrics": {
      "views": 21800,
      "reach": 15400,
      "likes": 1130,
      "comments": 96,
      "shares": 61,
      "saves": 140,
      "quotes": null
    }
  },
  "accounts": [
    {
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platform": "instagram",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "username": "ampost",
      "posts": 9,
      "followers": 4100,
      "followersChange": 120,
      "metrics": {
        "views": 16200,
        "reach": 11300,
        "likes": 870,
        "comments": 71,
        "shares": 40,
        "saves": 140,
        "quotes": null
      },
      "syncState": "up_to_date",
      "syncedAt": "2026-10-08T10:12:00.000Z",
      "nextSyncAt": "2026-10-08T11:12:00.000Z"
    },
    {
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platform": "facebook",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "username": "Ampost",
      "posts": 5,
      "followers": 1220,
      "followersChange": 22,
      "metrics": {
        "views": 5600,
        "reach": 4100,
        "likes": 260,
        "comments": 25,
        "shares": 21,
        "saves": null,
        "quotes": null
      },
      "syncState": "up_to_date",
      "syncedAt": "2026-10-08T10:14:00.000Z",
      "nextSyncAt": "2026-10-08T11:14:00.000Z"
    }
  ],
  "unavailableAccounts": [
    {
      "accountId": "5e9a1c3d-7b2f-4d8e-a6c1-3f9b2e7d4a60",
      "platform": "linkedin",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "reason": "platform_disabled"
    }
  ]
}
```

### Follower history

`GET /api/analytics/followers` · MCP tool `analytics_followers` · scope `analytics:read` · rate limit `apiRead` · success `200`

Follower count per account with one daily snapshot per day between `from` and `to` (UTC days, default the last 30). History starts when Ampost first read the account; a day without a snapshot is missing. Use it to chart follower growth; for the start, end and change of a range in one number per account use analytics_overview, and for post metrics analytics_posts. Filter by `platform`, `platformSetId` or `accountId`; paginated by account with `limit` and `offset`. A range longer than 90 days or with `from` after `to` is 400 VALIDATION_FAILED.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `from` | query | string | no | First day (UTC), YYYY-MM-DD. Default: 29 days before `to`. At most 90 days with `to`. |
| `to` | query | string | no | Last day (UTC), YYYY-MM-DD, included. Default: today. |
| `platform` | query | instagram \| facebook \| linkedin \| tiktok \| threads \| twitter \| discord \| telegram \| bluesky \| youtube \| pinterest | no | Only accounts on this platform. Default: every platform with analytics. |
| `platformSetId` | query | string | no | Only accounts in this platform set (`id` from platform_sets_list). Default: every set the key can see. |
| `accountId` | query | string | no | Only this account (`id` from accounts_list). Default: every matching account. |
| `limit` | query | integer | no | Page size, 1-100. Default 20. |
| `offset` | query | integer | no | Number of items to skip. Default 0. |

Example response:

```json
{
  "data": [
    {
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platform": "instagram",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "username": "ampost",
      "followers": 4100,
      "syncedAt": "2026-10-08T10:12:00.000Z",
      "totalLikes": null,
      "totalPosts": null,
      "history": [
        {
          "date": "2026-10-06",
          "followers": 4062,
          "syncedAt": "2026-10-06T10:05:00.000Z"
        },
        {
          "date": "2026-10-07",
          "followers": 4081,
          "syncedAt": "2026-10-07T10:09:00.000Z"
        },
        {
          "date": "2026-10-08",
          "followers": 4100,
          "syncedAt": "2026-10-08T10:12:00.000Z"
        }
      ]
    }
  ],
  "pagination": {
    "limit": 20,
    "offset": 0,
    "total": 1,
    "hasMore": false
  }
}
```
