# Get daily aggregated metrics

Fetches daily aggregated metrics.

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

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

## Query parameters

- `platform` (string)
- `profileId` (string)
- `accountId` (string)
- `fromDate` (string (date-time))
- `toDate` (string (date-time))
- `source` (string): one of all, pozy, external
- `attribution` (string): one of publish, received

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/analytics/daily-metrics" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

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

## Response 200

- `dailyData`, array of object
  - `date`, string
  - `postCount`, integer
  - `platforms`, map of integer
  - `metrics`, object
    - `impressions`, integer
    - `reach`, integer
    - `likes`, integer
    - `comments`, integer
    - `shares`, integer
    - `saves`, integer
    - `clicks`, integer
    - `views`, integer
- `platformBreakdown`, array of object
  - `platform`, string
  - `postCount`, integer
  - `impressions`, integer
  - `reach`, integer
  - `likes`, integer
  - `comments`, integer
  - `shares`, integer
  - `saves`, integer
  - `clicks`, integer
  - `views`, integer

```json
{
  "dailyData": [
    {
      "date": "2026-10-02T09:00:00.000Z",
      "postCount": 42,
      "platforms": {
        "key": 1
      },
      "metrics": {
        "impressions": 1,
        "reach": 1,
        "likes": 1,
        "comments": 1,
        "shares": 1,
        "saves": 1,
        "clicks": 1,
        "views": 1
      }
    }
  ],
  "platformBreakdown": [
    {
      "platform": "instagram",
      "postCount": 42,
      "impressions": 1,
      "reach": 1,
      "likes": 1,
      "comments": 1,
      "shares": 1,
      "saves": 1,
      "clicks": 1,
      "views": 1
    }
  ]
}
```
