0

I am using Facebook graph API to get specific Instagram post likes, I get user meta data and media and ... but I can't get users who had liked my instagram post. here is my php code:

  $postLikesEndpoint = 'https://graph.facebook.com/v7.0/{object_id}; // object_id = 17859297607958330;


  // endpoint params
  $igParams = array(
     'fields' => 'likes.summary(true)',
     'access_token'=> env('ACCESS_TOKEN')
  );

  $client = new Client();
  $response = $client->request('GET', $postLikesEndpoint, ['query' => $igParams]);
  $body = $response->getBody();

  $responseArray =  json_decode($body,true);
  var_dump($responseArray);
Pouya Ak
  • 171
  • 1
  • 10
  • _“but I can't get users who had liked my instagram post”_ - and what exactly in the API documentation made you think that was possible? – CBroe Jul 13 '20 at 07:05
  • @CBroe here is the documentation : https://developers.facebook.com/docs/graph-api/reference/v7.0/object/likes – Pouya Ak Jul 13 '20 at 09:19
  • 1
    That is the Facebook API, this applies to objects on Facebook. (And even for those, it does not fully allow what you want, limitations such as _“Due to privacy concerns, a User or Page can only query their own likes.”_, _“Only aggregated counts using total_count with the summary parameter are available for Post likes.”_ are mentioned right on that page.) – CBroe Jul 13 '20 at 11:00

0 Answers0