Getting a video views with Facebook API

Viewed 3225

I want to get the video count of the videos on my pages but all the informations I can get are informations about crossposted videos but my videos are not crossposted.

I played with the Graph API explorer quite a bit without arriving to a solution.

/{pages_id_video_id}/insights/post_video_views

And everything I tried only gave me an empty "data" array.

1 Answers

First please be sure you have a token with read_insights permission ! You can check your token here: https://developers.facebook.com/tools/debug/accesstoken/

You can explore the Facebook API here: https://developers.facebook.com/tools/explorer

You can get all your videos insight for a page with this request:

/PAGE_ID/videos?fields=video_insights

If you want only insights for one video use this request:

/VIDEO_ID/video_insights/total_video_views/lifetime

You can change period (accepted values are {day, week, days_28, month, lifetime, total_over_range}) and what you information you want (total_video_views_unique, total_video_views_autoplayed, total_video_views_clicked_to_play ...) the first request listing all videos from a page will give you all the possibility ;)

Related