Meta의 Facebook 동영상 API를 사용하여 인사이트 가져오기

이 가이드에서는 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
        }
      ],
    }
    ...
  ]
}   

특정 인사이트 지표 가져오기

수신하고자 하는 metric 매개변수와 특정 지표를 포함하여 GET 요청을 VideoVideoInsights 엔드포인트로 보냅니다.

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"
    }
  ]
}