# Get an analytics dashboard

Fetches an analytics dashboard.

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

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

## Query parameters

- `profileId` (string)
- `platform` (string)
- `fromDate` (string (date), required)
- `toDate` (string (date), required)
- `compare` (string): one of previous_period
- `topPosts` (integer)
- `recentPosts` (integer)

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/analytics/dashboard?fromDate=2026-10-01&toDate=2026-10-01" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/analytics/dashboard?fromDate=2026-10-01&toDate=2026-10-01", {
  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/dashboard",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    params={
        "fromDate": "2026-10-01",
        "toDate": "2026-10-01",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `dateRange`, object, required
  - `fromDate`, string (date)
  - `toDate`, string (date)
- `totals`, object, required
  - `impressions`, integer
  - `reach`, integer
  - `likes`, integer
  - `comments`, integer
  - `shares`, integer
  - `saves`, integer
  - `clicks`, integer
  - `views`, integer
  - `engagementRate`, number
- `previousTotals`, object
  - `impressions`, integer
  - `reach`, integer
  - `likes`, integer
  - `comments`, integer
  - `shares`, integer
  - `saves`, integer
  - `clicks`, integer
  - `views`, integer
  - `engagementRate`, number
- `followers`, object, required
  - `current`, integer
  - `gained`, integer
  - `byAccount`, array of object
    - `accountId`, string
    - `platform`, string
    - `current`, integer
    - `gained`, integer
- `previousFollowers`, object
  - `current`, integer
  - `gained`, integer
  - `byAccount`, array of object
    - `accountId`, string
    - `platform`, string
    - `current`, integer
    - `gained`, integer
- `daily`, array of object, required
  - `date`, string (date)
  - `impressions`, integer
  - `reach`, integer
  - `engagement`, integer
  - `views`, integer
  - `followersGained`, integer
- `topPosts`, array of object, required
  - `postId`, string
  - `platform`, string
  - `publishedAt`, string (date-time)
  - `metrics`, object
    - `impressions`, integer
    - `reach`, integer
    - `likes`, integer
    - `comments`, integer
    - `shares`, integer
    - `saves`, integer
    - `clicks`, integer
    - `views`, integer
    - `engagementRate`, number
- `recentPosts`, array of object, required
  - `postId`, string
  - `platform`, string
  - `publishedAt`, string (date-time)
  - `metrics`, object
    - `impressions`, integer
    - `reach`, integer
    - `likes`, integer
    - `comments`, integer
    - `shares`, integer
    - `saves`, integer
    - `clicks`, integer
    - `views`, integer
    - `engagementRate`, number
- `dataAsOf`, string (date-time), required: Can be null

```json
{
  "dateRange": {
    "fromDate": "2026-10-01",
    "toDate": "2026-10-01"
  },
  "totals": {
    "impressions": 1,
    "reach": 1,
    "likes": 1,
    "comments": 1,
    "shares": 1,
    "saves": 1,
    "clicks": 1,
    "views": 1,
    "engagementRate": 12.5
  },
  "previousTotals": {
    "impressions": 1,
    "reach": 1,
    "likes": 1,
    "comments": 1,
    "shares": 1,
    "saves": 1,
    "clicks": 1,
    "views": 1,
    "engagementRate": 12.5
  },
  "followers": {
    "current": 1,
    "gained": 1,
    "byAccount": [
      {
        "accountId": "696e0b682d0a31188e7a2ba9",
        "platform": "instagram",
        "current": 1,
        "gained": 1
      }
    ]
  },
  "previousFollowers": {
    "current": 1,
    "gained": 1,
    "byAccount": [
      {
        "accountId": "696e0b682d0a31188e7a2ba9",
        "platform": "instagram",
        "current": 1,
        "gained": 1
      }
    ]
  },
  "daily": [
    {
      "date": "2026-10-02T09:00:00.000Z",
      "impressions": 1,
      "reach": 1,
      "engagement": 1,
      "views": 1,
      "followersGained": 1
    }
  ],
  "topPosts": [
    {
      "postId": "6108a2cc742cb4e991051e0c",
      "platform": "instagram",
      "publishedAt": "2026-10-02T09:00:00.000Z",
      "metrics": {
        "impressions": 1,
        "reach": 1,
        "likes": 1,
        "comments": 1,
        "shares": 1,
        "saves": 1,
        "clicks": 1,
        "views": 1,
        "engagementRate": 12.5
      }
    }
  ],
  "recentPosts": [
    {
      "postId": "6108a2cc742cb4e991051e0c",
      "platform": "instagram",
      "publishedAt": "2026-10-02T09:00:00.000Z",
      "metrics": {
        "impressions": 1,
        "reach": 1,
        "likes": 1,
        "comments": 1,
        "shares": 1,
        "saves": 1,
        "clicks": 1,
        "views": 1,
        "engagementRate": 12.5
      }
    }
  ],
  "dataAsOf": "2026-10-02T09:00:00.000Z"
}
```
