# Analytics

> 2 endpoints: retrieve an account's analytics summary, retrieve a post's metrics.

- [Retrieve an account's analytics summary](#retrieve-an-account-s-analytics-summary): `GET /v1/accounts/{account_id}/analytics`
- [Retrieve a post's metrics](#retrieve-a-post-s-metrics): `GET /v1/posts/{post_id}/metrics`

### Retrieve an account's analytics summary

`GET /v1/accounts/{account_id}/analytics`

Reads the account's current counters from the network. YouTube and Instagram answer for the chosen range; TikTok and Facebook answer lifetime counters.

Permission: `analytics:read` · Counts 5 requests

#### Path parameters

| Name | Description |
| --- | --- |
| `account_id` | The account's id. |

#### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `range` | `7`, `28`, `90` | No | Days, for networks that report a range. (default "28") |

#### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | `"account_analytics"` | Yes |  |
| `account_id` | string | Yes |  (up to 128 characters) |
| `network` | `youtube`, `tiktok`, `instagram`, `facebook`, `threads`, `bluesky`, `mastodon`, `pinterest`, `telegram`, `twitch`, `x`, `discord` | Yes |  |
| `range_days` | integer or null | Yes |  |
| `data` | object | Yes |  |

```bash
curl https://api.nowscale.com/v1/accounts/ACCOUNT_ID/analytics \
  -H "Authorization: Bearer $NOWSCALE_API_KEY"
```

### Retrieve a post's metrics

`GET /v1/posts/{post_id}/metrics`

Reads lifetime views, likes, comments and shares of each published copy from its network. A copy the network cannot report returns nulls.

Permission: `analytics:read` · Counts 5 requests

#### Path parameters

| Name | Description |
| --- | --- |
| `post_id` | The post's id. |

#### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | `"list"` | Yes |  |
| `data` | array of object | Yes |  |
| `data[].object` | `"post_metrics"` | Yes |  |
| `data[].target_id` | string | Yes |  (up to 128 characters) |
| `data[].account_id` | string | Yes |  (up to 128 characters) |
| `data[].network` | `youtube`, `tiktok`, `instagram`, `facebook`, `threads`, `bluesky`, `mastodon`, `pinterest`, `telegram`, `twitch`, `x`, `discord` | Yes |  |
| `data[].external_id` | string | Yes |  |
| `data[].views` | number or null | Yes |  |
| `data[].likes` | number or null | Yes |  |
| `data[].comments` | number or null | Yes |  |
| `data[].shares` | number or null | Yes |  |
| `data[].url` | string or null | Yes |  |

```bash
curl https://api.nowscale.com/v1/posts/POST_ID/metrics \
  -H "Authorization: Bearer $NOWSCALE_API_KEY"
```
