Instagram posts with their numbers and their funnel
const url = 'https://app.whatsetter.com/api/v1/instagram/insights/posts?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/insights/posts?days=7&tz=Europe%2FParis' \ --header 'Authorization: Bearer <token>'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.
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 of the period (default the account’s agent’s).
Responses
Section titled “Responses”The period’s posts
object
object
object
object
object
object
object
Posts the average is made of (3 at least to compare).
object
Posts the average is made of (3 at least to compare).
object
The first 600 characters.
Interactions over accounts reached.
2.3 = 2.3× the average of its kind.
Published less than 48 h ago.
object
Instagram did not answer; these are the last numbers received.
Example
{ "data": { "access": { "reason": "scope" }, "posts": [ { "kind": "reel" } ] }}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" }}Instagram limits the reads for this account right now (instagram_rate_limited).
Instagram does not answer right now (instagram_unavailable).