# Get analytics

> Read engagement counts for published posts.

**Source:** https://postprism.app/docs/api/get-analytics  
**Updated:** 2026-10-10

---

`GET https://studio.postprism.app/api/v1/analytics`

Returns analytics records for posts in the workspace, most recent first. Each record holds views, likes, comments and shares for one post on one platform.

## Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `post_id` | query | uuid | Only records for this post. |
| `platform` | query | string | Only records for this platform key. |
| `limit` | query | integer | How many records to return. Default 50, maximum 100. |
| `workspace_id` | query | uuid | Act on another workspace you belong to. Defaults to the workspace your API key was created in. |

## Example

```bash
curl "https://studio.postprism.app/api/v1/analytics?post_id=3f1c2a9e-0000-4000-8000-00000000a001" \
  -H "Authorization: Bearer pp_live_your_api_key"
```

## Response

Status `200`.

`data` is an array of `AnalyticsRecord`: Engagement counts for one post on one platform.

| Field | Type | Description |
| --- | --- | --- |
| `id` | uuid | The record ID. |
| `post_id` | uuid | The post it belongs to. |
| `platform` | string | The platform key the counts are for. |
| `views` | integer | Views or impressions. |
| `likes` | integer | Likes or reactions. |
| `comments` | integer | Comments. |
| `shares` | integer | Shares or reposts. |
| `recorded_at` | date-time | When these counts were recorded. |

```json
{
  "data": [
    {
      "id": "5c6d7e8f-0000-4000-8000-00000000e001",
      "post_id": "3f1c2a9e-0000-4000-8000-00000000a001",
      "platform": "linkedin",
      "views": 2410,
      "likes": 86,
      "comments": 12,
      "shares": 7,
      "recorded_at": "2026-10-17T09:00:00Z"
    }
  ],
  "error": null
}
```

## Errors

| Status | Message | When |
| --- | --- | --- |
| 401 | `Invalid or revoked API key` | The `Authorization` header is missing, malformed, or the key was revoked. |
| 404 | `Workspace not found, or you are not a member of it.` | The `workspace_id` you passed (or your key’s default workspace) is not one you belong to. |
| 429 | `Too many requests` | You went over the hourly limit. See Rate limits. |
