# Instagram automation numbers over a period

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

What the account's automations did over 7, 30 or 90 days, and the
same for the period just before (to compare): comments received,
first private messages sent, people who replied to them, links sent
and opened, e-mail addresses captured, qualified leads. In `totals`,
`by_day` (in `tz`), `by_automation` and `by_post` (`media_id`), each
split by network: `instagram`, and `facebook` for the copy of the
automations on the linked Facebook Page. Read from the account's own
journal, like the dashboard's « Statistiques »; `capped: true` means
the account is so busy the numbers are a floor. 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 the days are read in (default the account's agent's). |

## Example request

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

## Responses

### 200: The numbers

```json
{
  "data": {
    "account": {
      "id": "68f1c2d3e4f5a6b7c8d9e0f1",
      "username": "acme.studio"
    },
    "period": {
      "days": 7,
      "from": "2026-10-23T18:00:00.000Z",
      "to": "2026-10-30T18:00:00.000Z",
      "previous_from": "2026-10-16T18:00:00.000Z",
      "tz": "Europe/Paris"
    },
    "totals": {
      "instagram": {
        "comments": 214,
        "messages_sent": 188,
        "replied": 61,
        "links_sent": 54,
        "link_clicks": 39,
        "emails": 12,
        "qualified": 9
      },
      "facebook": {
        "comments": 12,
        "messages_sent": 10,
        "replied": 3,
        "links_sent": 3,
        "link_clicks": 2,
        "emails": 0,
        "qualified": 1
      }
    },
    "previous": {
      "instagram": {
        "comments": 150,
        "messages_sent": 131,
        "replied": 40,
        "links_sent": 37,
        "link_clicks": 25,
        "emails": 8,
        "qualified": 5
      },
      "facebook": {
        "comments": 0,
        "messages_sent": 0,
        "replied": 0,
        "links_sent": 0,
        "link_clicks": 0,
        "emails": 0,
        "qualified": 0
      }
    },
    "by_day": [
      {
        "date": "2026-10-30",
        "instagram": {
          "comments": 31,
          "messages_sent": 27,
          "replied": 9,
          "qualified": 2
        },
        "facebook": {
          "comments": 2,
          "messages_sent": 2,
          "replied": 1,
          "qualified": 0
        }
      }
    ],
    "by_automation": [
      {
        "automation_id": "6900a1b2c3d4e5f6a7b8c9d0",
        "name": "Buyer's guide",
        "instagram": {
          "comments": 0,
          "messages_sent": 188,
          "replied": 61,
          "links_sent": 54,
          "link_clicks": 39,
          "emails": 12,
          "qualified": 9
        },
        "facebook": {
          "comments": 0,
          "messages_sent": 10,
          "replied": 3,
          "links_sent": 3,
          "link_clicks": 2,
          "emails": 0,
          "qualified": 1
        }
      }
    ],
    "by_post": [
      {
        "media_id": "18034567890123456",
        "network": "instagram",
        "comments": 214,
        "messages_sent": 188,
        "replied": 61,
        "links_sent": 54,
        "link_clicks": 39,
        "emails": 12,
        "qualified": 9
      }
    ],
    "capped": 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": ""
  }
}
```


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