Shivam Gupta
Shivam Gupta

Reputation: 149

Facebook graph API for videos not returning expected data

https://graph.facebook.com/v2.6/{video_id}/video_insights?metric=total_video_views&access_token={token}

I am using above link to get JSON details in PHP for a video object, however i am not able to get the required data w.r.t. the provided metric

data required : total_video_views

here is the FB for metric: https://developers.facebook.com/docs/graph-api/reference/video/video_insights/

when i use

?metric=total_video_views

FB graph api gives

    {
  "data": [
   ],
  "paging": {
    "previous": "https://graph.facebook.com/v2.6/1034830076599589/video_insights?access_token=EAACEdEose0cBABRiFOqQuZBZBaKTZBW89XcMrTjakJseF76YjL2Hfj1rBRES2FAztFNMQWsMVdv9zwO90ISjx8efBVdfLZCyZBnHzDF5pTLNTgJPIH6PcBnb1YAD5XCWyvK6HIz3rHNP3xs3DfODSbUZCKZC2GkbkzYj7goFgfWVAZDZD&debug=all&format=json&method=get&metric=total_video_views&pretty=0&suppress_http_code=1&since=-86400&until=0", 
"next": "https://graph.facebook.com/v2.6/1034830076599589/video_insights?access_token=EAACEdEose0cBABRiFOqQuZBZBaKTZBW89XcMrTjakJseF76YjL2Hfj1rBRES2FAztFNMQWsMVdv9zwO90ISjx8efBVdfLZCyZBnHzDF5pTLNTgJPIH6PcBnb1YAD5XCWyvK6HIz3rHNP3xs3DfODSbUZCKZC2GkbkzYj7goFgfWVAZDZD&debug=all&format=json&method=get&metric=total_video_views&pretty=0&suppress_http_code=1&since=0&until=86400"
  }
}

but there is no field regarding the required metric i.e. total_video_views

am i making here some wrong request or something else ?

Upvotes: 4

Views: 609

Answers (1)

Roman Bodnarchuk
Roman Bodnarchuk

Reputation: 29747

https://graph.facebook.com/v2.6/{video_id}/video_insights/total_video_views&access_token={token}

Should work for you.

Upvotes: 2

Related Questions