# Instagram posts with their numbers and their funnel

`GET https://app.whatsetter.com/api/v1/instagram/insights/posts`

The posts published in the period (7, 30 or 90 days) with
Instagram's numbers (views, reach, likes, comments, saves, shares,
interactions, engagement = interactions / reach), each post's views
against the average of its kind (`views_vs_average`: reels against
reels, photos and carousels together; the average is the last 20
posts of the kind older than 48 h, so a post younger than that is
`still_growing` and has none), its rank by views, and what the
workspace's automations made of it: comments seen, private
messages sent, links sent and opened, people who replied, qualified
leads and meetings booked by the agent. Instagram's numbers arrive
up to 48 h late and are cached an hour. Without the insights
permission (`access.reconnect_required`), likes and comments only.
Requires scope `instagram:read`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | query | string | no | Required when the workspace has several Instagram accounts. |
| `days` | query | 7 \| 30 \| 90 | no |  |
| `tz` | query | string | no | IANA time zone of the period (default the account's agent's). |

## Example request

```bash
curl --request GET \
  --url 'https://app.whatsetter.com/api/v1/instagram/insights/posts' \
  --header 'Authorization: Bearer ws_live_…'
```

## Responses

### 200: The period's posts

```json
{
  "data": {
    "account": {
      "id": "",
      "username": ""
    },
    "period": {
      "days": 0,
      "from": "",
      "to": "",
      "tz": ""
    },
    "access": {
      "insights": false,
      "reconnect_required": false,
      "reason": "scope"
    },
    "averages": {
      "reels": {
        "posts": 0,
        "views": 0,
        "reach": 0,
        "engagement": 0
      },
      "photos_and_carousels": {
        "posts": 0,
        "views": 0,
        "reach": 0,
        "engagement": 0
      }
    },
    "posts": [
      {
        "id": "",
        "kind": "reel",
        "caption": "",
        "permalink": "",
        "published_at": "",
        "views": 0,
        "reach": 0,
        "likes": 0,
        "comments": 0,
        "saves": 0,
        "shares": 0,
        "interactions": 0,
        "engagement": 0,
        "views_vs_average": 0,
        "rank_by_views": 0,
        "still_growing": false,
        "funnel": {
          "comments": 0,
          "messages_sent": 0,
          "links_sent": 0,
          "link_clicks": 0,
          "replied": 0,
          "qualified": 0,
          "meetings_booked": 0
        }
      }
    ],
    "fetched_at": "",
    "stale": false
  }
}
```

### 401: Missing, unknown or revoked API key

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 403: The key lacks the required scope (`insufficient_scope`), the plan does not have this part of the API (`not_in_plan`), or Instagram is not enabled on the workspace (`instagram_not_enabled`, Instagram routes)

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 404: Resource not found in this workspace

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 422: Invalid parameter or body (also an invalid or expired `cursor`)

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 429: Instagram limits the reads for this account right now (`instagram_rate_limited`).

### 502: Instagram does not answer right now (`instagram_unavailable`).


Source: https://docs.whatsetter.com/api-reference/operations/listinstagrampostinsights/
