使用 Meta 旗下的 Facebook 视频 API 获取成效分析

本指南介绍如何获取 Facebook 公共主页上已发布的单个视频的成效分析。

详细了解 Reels 成效分析

前期准备

您需要提供:

限制

  • 无法查看 Facebook 小组页面或 Facebook 用户页面上已发布视频的成效分析。
  • 交叉发布的视频在其发布到的每一个公共主页上都有唯一的 <VIDEO_ID>

获取总体成效分析

/<VIDEO_ID>/video_insights 端点发送 GET 请求,以获取与此视频关联的所有视频帖的总体成效分析。

GET <API_VERSION>/<VIDEO_ID>/video_insights?access_token=<PAGE_ACCESS_TOKEN>"

请求示例

curl -X GET \
 "https://graph.facebook.com/v20.0/323790578640877/video_insights?access_token=EAABkW..."

响应示例

{
  "data": [
    {
      "name": "total_video_views",
      "period": "lifetime",
      "values": [
        {
          "value": 89
        }
      ],
      "title": "Lifetime Total Video Views",
      "description": "Lifetime: Total number of times your video was viewed for 3 seconds or viewed to the end, whichever came first. (Total Count)",
      "id": "323790578640877/video_insights/total_video_views/lifetime"
    },
    {
      "name": "total_video_views_unique",
      "period": "lifetime",
      "values": [
        {
          "value": 56
        }
      ],
      "title": "Lifetime Unique Video Views",
      "description": "Lifetime: Number of unique people who viewed your video for 3 seconds or viewed to the end, whichever came first. (Unique Users)",
      "id": "323790578640877/video_insights/total_video_views_unique/lifetime"
    },
    {
      "name": "total_video_views_autoplayed",
      "period": "lifetime",
      "values": [
        {
          "value": 23
        }
      ],
      "title": "Lifetime Auto-Played Video Views",
      "description": "Lifetime: Number of times your video started automatically playing and people viewed it for 3 seconds or viewed it to the end, whichever came first. (Total Count)",
      "id": "323790578640877/video_insights/total_video_views_autoplayed/lifetime"
    },
    {
      "name": "total_video_views_clicked_to_play",
      "period": "lifetime",
      "values": [
        {
          "value": 12
        }
      ],
    }
    ...
  ]
}   

获取具体的成效分析指标

Video Video Insights 端点发送 GET 请求,并附上 metric 参数和您想要获取的具体指标

GET /&lt;API_VERSION>/&lt;VIDEO_ID>/video_insights
  ?metric=total_video_views,total_video_views_unique
  &access_token=&lt;PAGE_ACCESS_TOKEN>"

请求示例

curl -X GET \
  "https://graph.facebook.com/v20.0/323790578640877/video_insights?metric=total_video_views,total_video_views_unique&access_token=EAABkW..."

响应示例

{
  "data": [
    {
      "name": "total_video_views",
      "period": "lifetime",
      "values": [
        {
          "value": 2206
        }
      ],
      "title": "Lifetime Total Video Views",
      "description": "Lifetime: Total number of times your video was viewed for 3 seconds or viewed to the end, whichever came first. (Total Count)",
      "id": "323790578640877/video_insights/total_video_views/lifetime"
    },
    {
      "name": "total_video_views_unique",
      "period": "lifetime",
      "values": [
        {
          "value": 6
        }
      ],
      "title": "Lifetime Unique Video Views",
      "description": "Lifetime: Number of unique people who viewed your video for 3 seconds or viewed to the end, whichever came first. (Unique Users)",
      "id": "323790578640877/video_insights/total_video_views_unique/lifetime"
    }
  ]
}