> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ugc.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Dashboard Daily Statistics

> Retrieve pre-aggregated daily statistics for dashboard charts

## Endpoint

```
POST https://api.ugc.inc/stats/dashboard/daily
```

## Overview

Get pre-aggregated daily statistics with all 8 metrics combined into a single response. Returns one record per day with total changes across all filtered accounts and posts.

This endpoint is optimized for rendering dashboard charts — it returns \~30-90 rows covering the entire date range instead of per-account or per-post granular data.

**Metrics included:**

* **Followers/Following** — daily changes from account statistics
* **Views/Likes/Comments/Shares/Saves** — daily changes from post statistics
* **Posts** — count of posts created per day

## Request Body

<ParamField body="startDate" type="string" required>
  Start date in ISO 8601 format (e.g., `2024-01-01T00:00:00Z`).
</ParamField>

<ParamField body="endDate" type="string" required>
  End date in ISO 8601 format (e.g., `2024-01-31T23:59:59Z`).
</ParamField>

<ParamField body="accountIds" type="string[]">
  Array of account IDs to filter by. Omit to include all accounts.
</ParamField>

<ParamField body="tag" type="string">
  Filter by account tag
</ParamField>

<ParamField body="org_group" type="string">
  Filter by organization group
</ParamField>

<ParamField body="user_group" type="string">
  Filter by user group
</ParamField>

<ParamField body="hosts" type="string[]">
  Filter by account device type (e.g., `physical_iphone`, `physical_android`, `emulated_android`)
</ParamField>

<ParamField body="postType" type="string">
  Filter by post type. One of `video` or `slideshow`.
</ParamField>

<ParamField body="audioIds" type="string[]">
  Filter by audio IDs. Use `none` to include posts without audio.
</ParamField>

## Response

<ResponseField name="data" type="DashboardDailyStat[]">
  Array of daily aggregated statistics objects

  <Expandable title="DashboardDailyStat properties">
    <ResponseField name="date" type="string">
      Date in ISO 8601 format
    </ResponseField>

    <ResponseField name="followers" type="number">
      Net change in followers across all filtered accounts for this day
    </ResponseField>

    <ResponseField name="following" type="number">
      Net change in following across all filtered accounts for this day
    </ResponseField>

    <ResponseField name="views" type="number">
      Total new views across all filtered posts for this day
    </ResponseField>

    <ResponseField name="likes" type="number">
      Total new likes across all filtered posts for this day
    </ResponseField>

    <ResponseField name="comments" type="number">
      Total new comments across all filtered posts for this day
    </ResponseField>

    <ResponseField name="shares" type="number">
      Total new shares across all filtered posts for this day
    </ResponseField>

    <ResponseField name="posts" type="number">
      Number of posts created on this day
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.ugc.inc/stats/dashboard/daily \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "startDate": "2024-01-01T00:00:00Z",
      "endDate": "2024-01-31T23:59:59Z",
      "hosts": ["physical_iphone"]
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.ugc.inc/stats/dashboard/daily',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'startDate': '2024-01-01T00:00:00Z',
          'endDate': '2024-01-31T23:59:59Z',
          'hosts': ['physical_iphone']
      }
  )

  data = response.json()

  if data['ok']:
      for day in data['data']:
          print(f"{day['date']}: +{day['followers']} followers, +{day['views']} views")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.ugc.inc/stats/dashboard/daily', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      startDate: '2024-01-01T00:00:00Z',
      endDate: '2024-01-31T23:59:59Z',
      hosts: ['physical_iphone']
    })
  });

  const data = await response.json();

  if (data.ok) {
    data.data.forEach(day => {
      console.log(`${day.date}: +${day.followers} followers, +${day.views} views`);
    });
  }
  ```

  ```typescript React theme={null}
  import { UGCClient } from 'ugcinc';

  const client = new UGCClient({
    apiKey: 'YOUR_API_KEY'
  });

  const response = await client.stats.getDashboardDailyStats({
    startDate: '2024-01-01T00:00:00Z',
    endDate: '2024-01-31T23:59:59Z',
    hosts: ['physical_iphone']
  });

  if (response.ok) {
    response.data.forEach(day => {
      console.log(`${day.date}: +${day.followers} followers, +${day.views} views, +${day.likes} likes`);
    });
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "ok": true,
    "code": 200,
    "message": "Success",
    "data": [
      {
        "date": "2024-01-01T00:00:00.000Z",
        "followers": 245,
        "following": 12,
        "views": 18500,
        "likes": 1240,
        "comments": 89,
        "shares": 156,
        "posts": 3
      },
      {
        "date": "2024-01-02T00:00:00.000Z",
        "followers": 310,
        "following": 8,
        "views": 22100,
        "likes": 1580,
        "comments": 112,
        "shares": 198,
        "posts": 5
      }
    ]
  }
  ```
</ResponseExample>
