Facebook Post Insights Metrics通过API下载

时间:2013-10-22 11:52:16

标签: facebook-graph-api

我希望在Facebook页面上下载所有30个帖子洞察力指标,平均每月发布144个帖子。知道Facebook适用某些限制,下载这些帖子的最佳方式是什么?

https://graph.facebook.com/$post_id/insights/$metric/$period?since=$since&until=$until&access_token=$token";

post_stories, post_storytellers, post_stories_by_action_type, post_storytellers_by_action_type, post_impressions, post_impressions_unique, post_impressions_paid, post_impressions_paid_unique, post_impressions_fan, post_impressions_fan_unique, post_impressions_fan_paid, post_impressions_fan_paid_unique, post_impressions_organic, post_impressions_organic_unique, post_impressions_viral, post_impressions_viral_unique, post_impressions_by_story_type, post_impressions_by_story_type_unique, post_consumptions, post_consumptions_unique, post_consumptions_by_type, post_consumptions_by_type_unique, post_engaged_users, post_negative_feedback, post_negative_feedback_unique, post_negative_feedback_by_type, post_negative_feedback_by_type_unique.

到目前为止,我想过每天在帖子周围循环所有这30个指标: 30 * n(帖子数)=图谱API调用的数量对于Facebook来说太多了。

理想情况下,我希望Facebook在XLS中提供的Post Export,但使用Graph或FQL。

谢谢! 西里尔

2 个答案:

答案 0 :(得分:1)

$fql = "SELECT metric, value
        FROM insights
        WHERE
            object_id = '$post_id' AND  (
            metric = 'post_impressions_by_paid_non_paid' OR
            metric = 'post_impressions_by_paid_non_paid_unique' OR
            metric = 'post_stories' OR
            metric = 'post_storytellers' OR
            metric = 'post_stories_by_action_type' OR
            metric = 'post_storytellers_by_action_type' OR
            metric = 'post_impressions' OR
            metric = 'post_impressions_unique' OR
            metric = 'post_impressions_paid' OR
            metric = 'post_impressions_paid_unique' OR
            metric = 'post_impressions_fan' OR
            metric = 'post_impressions_fan_unique' OR
            metric = 'post_impressions_fan_paid' OR
            metric = 'post_impressions_fan_paid_unique' OR
            metric = 'post_impressions_organic' OR
            metric = 'post_impressions_organic_unique' OR
            metric = 'post_impressions_viral' OR
            metric = 'post_impressions_viral_unique' OR
            metric = 'post_impressions_by_story_type' OR
            metric = 'post_impressions_by_story_type_unique' OR
            metric = 'post_consumptions' OR
            metric = 'post_consumptions_unique' OR
            metric = 'post_consumptions_by_type' OR
            metric = 'post_consumptions_by_type_unique' OR
            metric = 'post_engaged_users' OR
            metric = 'post_negative_feedback' OR
            metric = 'post_negative_feedback_unique' OR
            metric = 'post_negative_feedback_by_type' OR
            metric = 'post_negative_feedback_by_type_unique') AND
            period=period('lifetime')
            ";

答案 1 :(得分:0)

后来我习惯在Graph / API中进行页面/见解和发布/见解,一次下载所有见解。