# Get post analytics

Fetches post analytics.

```http
GET https://api.pozy.ai/v1/analytics
```

- Area: Analytics / Analytics
- Auth: Authorization: Bearer pz_live_...

## Query parameters

- `postId` (string)
- `platform` (string)
- `profileId` (string)
- `accountId` (string)
- `source` (string): one of all, pozy, external
- `fromDate` (string (date))
- `toDate` (string (date))
- `limit` (integer)
- `page` (integer)
- `sortBy` (string): one of date, engagement, impressions, reach, likes, comments, shares, saves, clicks, views, follows, ig_reels_avg_watch_time, ig_reels_video_view_total_time, reposts, reels_skip_rate, completion_rate, profile_views, website_clicks
- `order` (string): one of asc, desc
- `tags` (string)

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/analytics?limit=50" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/analytics?limit=50", {
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.get(
    "https://api.pozy.ai/v1/analytics",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    params={
        "limit": 50,
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200


```json
{
  "postId": "6108a2cc742cb4e991051e0c",
  "pozyPostId": "65c07fe18b8de4a270f358ad",
  "status": "published",
  "content": "Hello from Pozy",
  "scheduledFor": "2026-10-02T09:00:00.000Z",
  "publishedAt": "2026-10-02T09:00:00.000Z",
  "analytics": {
    "impressions": 1,
    "reach": 1,
    "likes": 1,
    "comments": 1,
    "shares": 1,
    "saves": 1,
    "clicks": 1,
    "views": 1,
    "follows": 1,
    "igReelsAvgWatchTime": 1,
    "igReelsVideoViewTotalTime": 42,
    "reelsSkipRate": 12.5,
    "completionRate": 12.5,
    "profileViews": 1,
    "websiteClicks": 1,
    "impressionSources": {
      "key": 12.5
    },
    "audienceTypes": {
      "key": 12.5
    },
    "audienceCountries": {
      "key": 12.5
    },
    "replays": 1,
    "retentionCurve": {
      "key": 12.5
    },
    "reposts": 1,
    "videoDurationSeconds": 1,
    "engagementRate": 12.5,
    "lastUpdated": "2026-10-02T09:00:00.000Z"
  },
  "platformAnalytics": [
    {
      "platform": "instagram",
      "status": "published",
      "platformPostId": "637f799b3039e6602e83fa4f",
      "accountId": "696e0b682d0a31188e7a2ba9",
      "accountUsername": "acme",
      "analytics": {
        "impressions": 1,
        "reach": 1,
        "likes": 1,
        "comments": 1,
        "shares": 1,
        "saves": 1,
        "clicks": 1,
        "views": 1,
        "follows": 1,
        "igReelsAvgWatchTime": 1,
        "igReelsVideoViewTotalTime": 42,
        "reelsSkipRate": 12.5,
        "completionRate": 12.5,
        "profileViews": 1,
        "websiteClicks": 1,
        "impressionSources": {
          "key": 12.5
        },
        "audienceTypes": {
          "key": 12.5
        },
        "audienceCountries": {
          "key": 12.5
        },
        "replays": 1,
        "retentionCurve": {
          "key": 12.5
        },
        "reposts": 1,
        "videoDurationSeconds": 1,
        "engagementRate": 12.5,
        "lastUpdated": "2026-10-02T09:00:00.000Z"
      },
      "syncStatus": "synced",
      "platformPostUrl": "https://pozy.ai/media/example-1.jpg",
      "errorMessage": "Hello from Pozy",
      "errorCode": "post_not_found",
      "isOwner": true
    }
  ],
  "platform": "instagram",
  "platformPostUrl": "https://pozy.ai/media/example-1.jpg",
  "isExternal": true,
  "syncStatus": "synced",
  "message": "Hello from Pozy",
  "thumbnailUrl": "https://pozy.ai/media/example-1.jpg",
  "mediaType": "image",
  "mediaItems": [
    {
      "type": "image",
      "url": "https://pozy.ai/media/example-1.jpg",
      "thumbnail": "https://pozy.ai/media/example-1.jpg",
      "altText": "Hello from Pozy",
      "mediaStatus": "available",
      "unavailableReason": "platform_withheld"
    }
  ],
  "mediaProductType": "string",
  "isAiGenerated": true,
  "isSharedToFeed": true,
  "mediaAudioType": "string"
}
```
