Jahanzeb Khan
Jahanzeb Khan

Reputation: 19

Facebook graph api not getting post reach

I am using FB Graph API to get the post reach posted on a page. But the API always returns an empty data object (no errors).

Query:

https://graph.facebook.com/v2.10/[POST_ID]/insights?metric=post_impressions_unique&access_token=[PAGE_ACCESS_TOKEN]

Response:

{
   "data": [

   ],
   "paging": {
      "previous": "https://graph.facebook.com/v2.11/[POST_ID]/insights?access_token=[PAGE_ACCESS_TOKEN]&metric=post_impressions_unique&since=1528268400&until=1528441200",
      "next": "https://graph.facebook.com/v2.11/[POST_ID]/insights?access_token=[PAGE_ACCESS_TOKEN]&metric=post_impressions_unique&since=1528614000&until=1528786800"
   }
}

I have tried it with other API versions v2.11, v2.12 and v3.0 etc. same response. And posts do have a reach metric when checked on the page.

Anyone have any clue about whats wrong here?

Upvotes: 0

Views: 887

Answers (1)

Jahanzeb Khan
Jahanzeb Khan

Reputation: 19

Thanks to CBroe 's comment pointed me in the right direction.

My app that I used to get page access token didn't have the read_insights permission.

  1. From Graph api Explorer , from the dropdown "Graph API Explorer" in the top right, I selected my app.
  2. From "Get token" dropdown just below it, select "Get App Token".
  3. From the popup window make sure you have the read_insights permission ticked along with others.

Upvotes: 1

Related Questions