get insights data of facebook page
10,938
Solution 1
UPDATED ANSWER:
Insights
can be retrieved only as an array. To read Insights
you need
- a generic
access_token
for the publicly availableapplication_active_users
metric - a generic app
access_token
for allInsights
for that app -
read_insights
permissions for all apps, pages and domains owned by this user
For more details on which insights are available please review the FQL Insights table
Here are my comments:
- Most likely you don't have the
read_insights
permission. - The user authenticated should be the owner/admin of the page!
- Remove the trailing slash
/
Solution 2
I found the solution.
You must change the order of the scope parameter:
Try
email,read_insights,manage_pages
Instead of
email,manage_pages,read_insights
Related videos on Youtube
Author by
Chirayu
Updated on June 04, 2022Comments
-
Chirayu almost 2 years
I want to get insights data of a facebook page. I have tried with graph api with this url:
https://graph.facebook.com/149279625121774/insights/?access_token=XXXX
but it gives empty data:
{ "data": [ ], "paging": { "previous": "https://graph.facebook.com/149279625121774/insights/...", "next": "https://graph.facebook.com/149279625121774/insights/..." } }
'149279625121774' is the page id.
Is anybody help me for this.
-
Chirayu about 13 yearshow can i check and enable read_insights permission in my facebook page?
-
ifaour about 13 yearsyou can check that from facebook privacy settings of your account and then applications settings. also you can ask for the extra permission from the login button/URL check this answer, instead of
offline_access
useread_insights
-
Oleg almost 12 yearsIs not helpful for me. Works only if I specify metric names separated by coma: /{pageId}/insights/{metric1,metric2,...,metricN}
-
helpse about 9 yearsIt would help if the downvoter commented something. This solution worked for me. The Graph API started to work after I moved manage_pages before read_insights.