Instagram automation numbers over a period
const url = 'https://app.whatsetter.com/api/v1/instagram/stats?days=7&tz=Europe%2FParis';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://app.whatsetter.com/api/v1/instagram/stats?days=7&tz=Europe%2FParis' \ --header 'Authorization: Bearer <token>'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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Required when the workspace has several Instagram accounts.
Example
Europe/ParisIANA time zone the days are read in (default the account’s agent’s).
Responses
Section titled “Responses”The numbers
object
object
object
object
The start of the period before (it ends at from).
object
object
First private messages of an automation.
People who answered that message.
E-mail addresses captured.
People the agent qualified (once each).
object
First private messages of an automation.
People who answered that message.
E-mail addresses captured.
People the agent qualified (once each).
The same numbers over the period before.
object
object
First private messages of an automation.
People who answered that message.
E-mail addresses captured.
People the agent qualified (once each).
object
First private messages of an automation.
People who answered that message.
E-mail addresses captured.
People the agent qualified (once each).
object
YYYY-MM-DD in tz; the first day is partial.
object
object
object
Null for an automation deleted since.
object
First private messages of an automation.
People who answered that message.
E-mail addresses captured.
People the agent qualified (once each).
object
First private messages of an automation.
People who answered that message.
E-mail addresses captured.
People the agent qualified (once each).
object
The Instagram media id
First private messages of an automation.
People who answered that message.
E-mail addresses captured.
People the agent qualified (once each).
The journal was read up to a ceiling; the numbers are a floor.
Example
{ "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 }}Missing, unknown or revoked API key
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}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)
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Resource not found in this workspace
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Invalid parameter or body (also an invalid or expired cursor)
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}