Graph API not returning total_video_views

341 Views Asked by At

Tried the following endpoints:

https://graph.facebook.com/v2.6/{video-id}/video_insights/total_video_views?access_token={token}

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

But I still getting no data results in both endpoints:

{
   "data": [

   ]
}

And my videos has some views (visualizações):

enter image description here

Thanks in advance.

2

There are 2 best solutions below

2
On

I had the same problem it's because you don't use the token from the page the video was published.

https://graph.facebook.com/v2.6/{video-id}/video_insights/total_video_views
2
On

I'm gonna paste the words from the API documentation below, but I think, since it's a video, you're calling to the wrong site.

"Host URL Almost all requests are passed to the graph.facebook.com host URL. The single exception is video uploads, which use graph-video.facebook.com."

And here's a link to the page: https://developers.facebook.com/docs/graph-api/overview/#structure