Skip to content

Interface: InsightsApi ​

Insights of a professional (business or creator) account's own media.

Methods ​

account() ​

ts
account(range?): Promise<{
[key: string]: unknown;
  account_views_by_content_type?:   | {
   [key: string]: unknown;
     entries?: object[];
     total?: number | null;
   }
     | null;
  account_views_count?:   | {
   [key: string]: unknown;
     follow_type_breakdown?:   | {
      [key: string]: unknown;
        follower?:   | {
         [key: string]: unknown;
           value?: number | null;
         }
           | null;
        non_follower?:   | {
         [key: string]: unknown;
           value?: number | null;
         }
           | null;
      }
        | null;
     total?:   | {
      [key: string]: unknown;
        format?: string;
        formatted_value?: string;
        id: string;
        label: string;
        value?: number | null;
      }
        | null;
   }
     | null;
  bio_link_taps?:   | {
   [key: string]: unknown;
     value?: number | null;
   }
     | null;
  business_address_taps?:   | {
   [key: string]: unknown;
     value?: number | null;
   }
     | null;
  interactions_by_content_type?:   | {
   [key: string]: unknown;
     sub_breakdowns?: unknown[];
     total_breakdown?:   | {
      [key: string]: unknown;
        entries?: object[];
        total?: number | null;
      }
        | null;
   }
     | null;
  interactions_count?:   | {
   [key: string]: unknown;
     follower?:   | {
      [key: string]: unknown;
        value?: number | null;
      }
        | null;
     non_follower?:   | {
      [key: string]: unknown;
        value?: number | null;
      }
        | null;
     total?:   | {
      [key: string]: unknown;
        format?: string;
        formatted_value?: string;
        id: string;
        label: string;
        value?: number | null;
      }
        | null;
   }
     | null;
  interactions_over_time?: unknown;
  link_page_views?:   | {
   [key: string]: unknown;
     value?: number | null;
   }
     | null;
  net_followers_over_time?: unknown;
  profile_visits?:   | {
   [key: string]: unknown;
     value?: number | null;
   }
     | null;
  viewers_or_reach?:   | {
   [key: string]: unknown;
     format?: string;
     formatted_value?: string;
     id: string;
     label: string;
     value?: number | null;
   }
     | null;
  views_over_time?: unknown;
}>;

The account overview for a date range (default: the last 30 days).

Parameters ​

ParameterType
range?InsightsRange

Returns ​

Promise<{ [key: string]: unknown; account_views_by_content_type?: | { [key: string]: unknown; entries?: object[]; total?: number | null; } | null; account_views_count?: | { [key: string]: unknown; follow_type_breakdown?: | { [key: string]: unknown; follower?: | { [key: string]: unknown; value?: number | null; } | null; non_follower?: | { [key: string]: unknown; value?: number | null; } | null; } | null; total?: | { [key: string]: unknown; format?: string; formatted_value?: string; id: string; label: string; value?: number | null; } | null; } | null; bio_link_taps?: | { [key: string]: unknown; value?: number | null; } | null; business_address_taps?: | { [key: string]: unknown; value?: number | null; } | null; interactions_by_content_type?: | { [key: string]: unknown; sub_breakdowns?: unknown[]; total_breakdown?: | { [key: string]: unknown; entries?: object[]; total?: number | null; } | null; } | null; interactions_count?: | { [key: string]: unknown; follower?: | { [key: string]: unknown; value?: number | null; } | null; non_follower?: | { [key: string]: unknown; value?: number | null; } | null; total?: | { [key: string]: unknown; format?: string; formatted_value?: string; id: string; label: string; value?: number | null; } | null; } | null; interactions_over_time?: unknown; link_page_views?: | { [key: string]: unknown; value?: number | null; } | null; net_followers_over_time?: unknown; profile_visits?: | { [key: string]: unknown; value?: number | null; } | null; viewers_or_reach?: | { [key: string]: unknown; format?: string; formatted_value?: string; id: string; label: string; value?: number | null; } | null; views_over_time?: unknown; }>


audience() ​

ts
audience(range?): Promise<{
[key: string]: unknown;
  active_follower_count?:   | {
   [key: string]: unknown;
     format?: string;
     formatted_value?: string;
     id: string;
     label: string;
     value?: number | null;
   }
     | null;
  active_times?:   | {
   [key: string]: unknown;
     slots?: object[];
   }
     | null;
  age_demographics?:   | {
   [key: string]: unknown;
     entries?: object[];
   }
     | null;
  follower_count?:   | {
   [key: string]: unknown;
     format?: string;
     formatted_value?: string;
     id: string;
     label: string;
     value?: number | null;
   }
     | null;
  follower_growth_delta?:   | {
   [key: string]: unknown;
     sentiment?: string;
     value?: string;
   }
     | null;
  gender_demographics?: unknown;
  net_followers_over_time?: unknown;
  top_cities?: object[];
  top_countries?: object[];
  top_languages?: object[];
}>;

The audience: followers, ages, places and active times.

Parameters ​

ParameterType
range?InsightsRange

Returns ​

Promise<{ [key: string]: unknown; active_follower_count?: | { [key: string]: unknown; format?: string; formatted_value?: string; id: string; label: string; value?: number | null; } | null; active_times?: | { [key: string]: unknown; slots?: object[]; } | null; age_demographics?: | { [key: string]: unknown; entries?: object[]; } | null; follower_count?: | { [key: string]: unknown; format?: string; formatted_value?: string; id: string; label: string; value?: number | null; } | null; follower_growth_delta?: | { [key: string]: unknown; sentiment?: string; value?: string; } | null; gender_demographics?: unknown; net_followers_over_time?: unknown; top_cities?: object[]; top_countries?: object[]; top_languages?: object[]; }>


content() ​

ts
content(options?): Promise<Page<{
[key: string]: unknown;
  metrics?: object[];
  thumbnail: {
   [key: string]: unknown;
     caption_text?: string | null;
     creation_time?: number;
     media_id: string;
     media_type?: string;
     media_url?: string | null;
  };
}>>;

One page of the account's posts, reels or stories ranked by a figure.

Parameters ​

ParameterType
options?ContentInsightsOptions

Returns ​

Promise<Page<{ [key: string]: unknown; metrics?: object[]; thumbnail: { [key: string]: unknown; caption_text?: string | null; creation_time?: number; media_id: string; media_type?: string; media_url?: string | null; }; }>>


paginateContent() ​

ts
paginateContent(options?): AsyncGenerator<{
[key: string]: unknown;
  metrics?: object[];
  thumbnail: {
   [key: string]: unknown;
     caption_text?: string | null;
     creation_time?: number;
     media_id: string;
     media_type?: string;
     media_url?: string | null;
  };
}>;

Walks the content list, one item at a time across pages.

Parameters ​

ParameterType
options?Omit<ContentInsightsOptions, "cursor">

Returns ​

AsyncGenerator<{ [key: string]: unknown; metrics?: object[]; thumbnail: { [key: string]: unknown; caption_text?: string | null; creation_time?: number; media_id: string; media_type?: string; media_url?: string | null; }; }>


post() ​

ts
post(mediaId): Promise<{
[key: string]: unknown;
  avg_watch_time?:   | {
   [key: string]: unknown;
     format?: string;
     formatted_value?: string;
     id: string;
     label: string;
     value?: number | null;
   }
     | null;
  comments?: number | null;
  demographics?:   | {
   [key: string]: unknown;
     age_breakdown?: unknown[];
     country_breakdown?: unknown[];
     gender_breakdown?: unknown[];
     status?: string;
   }
     | null;
  followers_views?: number | null;
  follows?: number | null;
  likes?: number | null;
  media_id: string;
  non_followers_views?: number | null;
  performance_factors?: object[];
  profile_visits?: number | null;
  reposts?: number | null;
  saves?: number | null;
  shares?: number | null;
  thumbnail_url?: string | null;
  total_views?: number | null;
  viewers_or_reach?:   | {
   [key: string]: unknown;
     format?: string;
     formatted_value?: string;
     id: string;
     label: string;
     value?: number | null;
   }
     | null;
  views_over_time?: unknown;
  views_sources?: object[];
}>;

Views, reach, interactions and view sources of one of the account's posts.

Parameters ​

ParameterType
mediaIdstring

Returns ​

Promise<{ [key: string]: unknown; avg_watch_time?: | { [key: string]: unknown; format?: string; formatted_value?: string; id: string; label: string; value?: number | null; } | null; comments?: number | null; demographics?: | { [key: string]: unknown; age_breakdown?: unknown[]; country_breakdown?: unknown[]; gender_breakdown?: unknown[]; status?: string; } | null; followers_views?: number | null; follows?: number | null; likes?: number | null; media_id: string; non_followers_views?: number | null; performance_factors?: object[]; profile_visits?: number | null; reposts?: number | null; saves?: number | null; shares?: number | null; thumbnail_url?: string | null; total_views?: number | null; viewers_or_reach?: | { [key: string]: unknown; format?: string; formatted_value?: string; id: string; label: string; value?: number | null; } | null; views_over_time?: unknown; views_sources?: object[]; }>


reel() ​

ts
reel(mediaId): Promise<{
[key: string]: unknown;
  avg_watch_time?:   | {
   [key: string]: unknown;
     format?: string;
     formatted_value?: string;
     id: string;
     label: string;
     value?: number | null;
   }
     | null;
  comments?: number | null;
  demographics?:   | {
   [key: string]: unknown;
     age_breakdown?: unknown[];
     country_breakdown?: unknown[];
     gender_breakdown?: unknown[];
     status?: string;
   }
     | null;
  followers_views?: number | null;
  follows?: number | null;
  likes?: number | null;
  media_id: string;
  non_followers_views?: number | null;
  performance_factors?: object[];
  profile_visits?: number | null;
  reposts?: number | null;
  saves?: number | null;
  shares?: number | null;
  thumbnail_url?: string | null;
  total_views?: number | null;
  viewers_or_reach?:   | {
   [key: string]: unknown;
     format?: string;
     formatted_value?: string;
     id: string;
     label: string;
     value?: number | null;
   }
     | null;
  views_over_time?: unknown;
  views_sources?: object[];
}>;

The same for one of the account's reels, plus watch time and the rates of each reaction.

Parameters ​

ParameterType
mediaIdstring

Returns ​

Promise<{ [key: string]: unknown; avg_watch_time?: | { [key: string]: unknown; format?: string; formatted_value?: string; id: string; label: string; value?: number | null; } | null; comments?: number | null; demographics?: | { [key: string]: unknown; age_breakdown?: unknown[]; country_breakdown?: unknown[]; gender_breakdown?: unknown[]; status?: string; } | null; followers_views?: number | null; follows?: number | null; likes?: number | null; media_id: string; non_followers_views?: number | null; performance_factors?: object[]; profile_visits?: number | null; reposts?: number | null; saves?: number | null; shares?: number | null; thumbnail_url?: string | null; total_views?: number | null; viewers_or_reach?: | { [key: string]: unknown; format?: string; formatted_value?: string; id: string; label: string; value?: number | null; } | null; views_over_time?: unknown; views_sources?: object[]; }>

MIT License. Not affiliated with, endorsed or sponsored by Meta or Instagram.