# CLI Analytics Commands

Pull post-level and account-level analytics, workspace overviews, and recommended
posting times. All analytics commands require the `analytics:read` scope on your
API key.

## Commands

| Command | Description |
|---------|-------------|
| `analytics:post <post-id>` | Per-post analytics aggregated across platforms: impressions, engagements, likes, comments, shares, plus per-platform breakdowns |
| `analytics:posts <id,id,...>` | Bulk analytics for up to 100 posts in one call (comma- or space-separated ids) |
| `analytics:overview` | Workspace-level overview: totals, average engagement rate, top platform. Flags: `--period <7d\|30d\|90d>`, `--start-date <YYYY-MM-DD>`, `--end-date <YYYY-MM-DD>` |
| `analytics:accounts` | Account-level analytics such as followers and subscribers. Flags: `--platform`, `--date <YYYY-MM-DD>` |
| `analytics:best-times` | Recommended posting slots (top 3 plus per-day scores) computed from your own posting history. Flags: `--platform` (required), `--timezone <IANA tz>` |

`analytics:best-times` needs history to work with: below 15 analyzed posts it falls
back to labeled industry defaults instead of your own data.

## Examples

How did last week go?

```bash
omnisocials analytics:overview --period 7d
```

Check a specific post across every platform it went to:

```bash
omnisocials analytics:post 58105759
```

Bulk-check a campaign:

```bash
omnisocials analytics:posts 58105759,58105760,58105761
```

When should we post on TikTok?

```bash
omnisocials analytics:best-times --platform tiktok --timezone Europe/Amsterdam
```

Combine with `--json` and `jq` for reporting pipelines:

```bash
omnisocials analytics:overview --period 30d --json | jq '.data.totals'
```
