# Instagram impressions in the PubNio analytics API

PubNio returns no Instagram impressions. Post and account readings both come back `unsupported` with reason `removed` and `replacedBy: "views"`, so ask for `views`. Without impressions there is no denominator, so post `engagement_rate` is unsupported too, with reason `impressions_removed`; account `engagement_rate` is `not_exposed`.

## What PubNio returns

| Metric | Scope | Instagram field | Unit | Combines by |
| --- | --- | --- | --- | --- |
| `impressions` | post | not returned: `removed` (use `views`) | count | sum |
| `impressions` | account | not returned: `removed` (use `views`) | count | sum |
| `views` | post | `views` | count | sum |
| `views` | account | `views` | count | sum |
| `engagement_rate` | post | not returned: `impressions_removed` | ratio | ratio |
| `engagement_rate` | account | not returned: `not_exposed` | ratio | ratio |

`impressions`: Times content was displayed, including repeat views.

`views`: Provider-defined content or video views.

`engagement_rate`: Engagement divided by impressions, 0 to 1.

## How PubNio reads it

- Post `views` is Meta's `views` media insight, which every placement's request includes. Account `views` is the daily `views` account insight, summed over the range.
- The account read first asks for `views`, `reach`, `profile_views`, and `website_clicks`. If Meta rejects that as an invalid request, PubNio retries once without `views`, and the metrics it could not read come back pending with reason `metric_rejected`.
- The replacement is declared in capabilities as `replacedBy: "views"` on both scopes, so an agent can switch metrics without reading this page.

## Example

The capabilities endpoint answers without calling Instagram. Under the Instagram provider, these are its entries for `impressions`.

```http
GET /api/v1/workspaces/4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b/analytics/capabilities
Authorization: Bearer pn_live_***
```

```json
[
  {
    "key": "impressions",
    "scope": "post",
    "granularity": "day",
    "unit": "count",
    "aggregation": "sum",
    "availability": "unsupported",
    "supported": false,
    "reason": "removed",
    "replacedBy": "views"
  },
  {
    "key": "impressions",
    "scope": "account",
    "granularity": "day",
    "unit": "count",
    "aggregation": "sum",
    "availability": "unsupported",
    "supported": false,
    "reason": "removed",
    "replacedBy": "views"
  }
]
```

## Limits

- A metric Instagram does not report comes back with `value: null` and an availability state that says why. A post with no stored values whose last read failed on permissions, a rate limit, or a transient error answers with that error instead.

## Related

- [Instagram analytics API: the metrics PubNio reads](https://pubnio.com/platforms/instagram/analytics)
- [Instagram OAuth scopes](https://pubnio.com/docs/providers/instagram/scopes/)
- [API reference: analytics capabilities](https://pubnio.com/docs/reference/analytics-capabilities-get/)

