Best times to post on an Instagram account
const url = 'https://app.whatsetter.com/api/v1/instagram/insights/best-times?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/best-times?tz=Europe%2FParis' \ --header 'Authorization: Bearer <token>'On which days and at what hours the account’s posts of the last 90
days do better than the average of their kind (each post against
its kind, a viral post counted as 3× at most), and the next three
moments to post (next_slots, one per day, in the next 7 days, at
least 30 minutes ahead). With too few posts (basis: usual,
reason: few), nothing above the average (flat) or no insights
permission (none), next_slots are usual hours (12:30, 19:00).
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 and hours are read in (default the account’s agent’s).
Responses
Section titled “Responses”The best times
object
object
object
object
object
object
object
object
The wall time in tz, YYYY-MM-DDTHH:mm.
The day’s and the hours’ advantage multiplied; null for a usual hour.
Example
{ "data": { "basis": "account", "reason": "few", "best_day": { "weekday": "monday" } }}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).