Get facebook insight of facebook page using graph api

4k Views Asked by At

I am already getting insight's data for facebook application by using appid and secret key to get access token now i want get insight data for my facebook page , I don't know what I use in the place of secret key to access token. I send request by this url to get app insights data https://graph.facebook.com/"+appId+"/insights?access_token="+token now i need to know what i use intead of appId and how find access token of facebook page.

3

There are 3 best solutions below

0
On

Insert pageid instead of appid, in this way you will be able to get facebook page insights

https://graph.facebook.com/"+pageId+"/insights?access_token="+token
0
On

The Facebook graph API has changed the URL pattern for the page insights, In the latest version they required at least on matrix otherwise they will throw the error like below

"error_user_msg": "No metric was specified to be fetched. Please specify one or more metrics to be fetched and try again.",

The new format is like below

/{post-id}/insights/{metric} (Posts on a Page only)*

Please refer the below link for more information

https://developers.facebook.com/docs/graph-api/reference/v3.0/insights

2
On

Take a look at here. You will be able to list all pages for account and pull stats for a page_id.

https://github.com/facebook/insights-api-sample