Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

get insights data of facebook page

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

UPDATED ANSWER:
Insights can be retrieved only as an array. To read Insights you need

  • a generic access_token for the publicly available application_active_users metric
  • a generic app access_token for all Insights 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:

  1. Most likely you don't have the read_insights permission.
  2. The user authenticated should be the owner/admin of the page!
  3. Remove the trailing slash /

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...