Rafia Taqdees
Rafia Taqdees

Reputation: 1

Get facebook insight of facebook page using graph api

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.

Upvotes: 0

Views: 4068

Answers (3)

Bachan Joseph
Bachan Joseph

Reputation: 357

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

Upvotes: 0

Muhammad Imran Ashraf
Muhammad Imran Ashraf

Reputation: 21

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

Upvotes: 2

John Huh
John Huh

Reputation: 9

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

Upvotes: 0

Related Questions