Skip to content

IG Media Insights

Justin Stolpe edited this page May 21, 2022 · 2 revisions

Get insights on a media post.

use Instagram\Media\Insights;

$config = array( // instantiation config params
    'user_id' => '<IG_USER_ID>',
    'media_id' => '<MEDIA_ID>', // id of post to get insights on
    'media_type' => '<MEDIA_TYPE>',  // type of media CAROUSEL_ALBUM|VIDEO|IMAGE|STORY
    'access_token' => '<ACCESS_TOKEN>',
);

// instantiate insights for use
$insights = new Insights( $config );

// get insights on the specified media
$mediaInsights = $insights->getSelf();
Clone this wiki locally