How can i get a video views with Facebook API - facebook

I want to get the number of views of a video (of public pages), i
already tried /VIDEO_ID/video_insights/total_video_views/ but it's
not giving any data all i get is : { "data": [ ] }
With the new version of Facebook API (v3.2 ,v3.3 ,v4 ) it's getting
more complicated to get video insights.

Related

Facebook app_insights metric keys returning 0 data

Is anyone having trouble getting Facebook metric data from the app_insights edge? Hoping to get a sanity check about the Facebook graph API. In the past we could use story_clicks, story_publishes and story_impressions to get data about our facebook app. For example we would use the request of
https://graph.facebook.com/v5.0/APP_ID/app_insights/story_publishes
to return data about our facebook application. We know the application is making posts, and the request doesn't return an error, but all we get are data points that look like this:
{
"data": [
{
"time": "2019-12-02T08:00:00+0000",
"value": "0"
}
]
}
The app_insights endpoint is still listed in the 5.0 graph api documentation, and nothing related to this seems to be listed in the changelog

Is there a way to get the a video file or thumbnail for a video through the linkedin v2 api?

We're able to get metadata about videos via the ugcPosts endpoint and analytics via videoAnalytics, but I'm trying to get the actual video file or a thumbnail of the video.
I'm trying hitting:
https://api.linkedin.com/v2/assets/<ID>?fields=id,recipes&oauth2_access_token=XXX&projection=(*,recipes*(*), privatePlayableStreams*(*),playableStreams*(*))
But the response doesn't have any urls in it:
{
"recipes": [
{
"recipe": "urn:li:digitalmediaRecipe:feedshare-video-captions-thumbnails",
"status": "AVAILABLE"
}
],
"id": "XXX"
}
I'm not sure if the data is not available or if I've got the projection wrong or something else.

Get photo from post using Facebook graph API

I am attempting to display the latest post from a public Facebook page on a website using the graph API.
Using the following URL, I am able to get the latest posts data:
https://graph.facebook.com/MYPAGENAME/posts?access_token=MYACCESSTOKEN
Which returns:
{
"data": [
{
"story": "MYPAGENAME added a new photo.",
"created_time": "2017-08-20T19:00:00+0000",
"id": "MYID"
}
...
The post in question displays on the Facebook page with a photo included, but there is not 'photo' object (or anything similar) returned in the API data. How do I access the picture URL for this post? Thanks in advance.
This request will fetch posts and the media information for the first image for each post.
/posts?fields=attachments{media}?access_token=YOUR_ACCESS_TOKEN
Sometimes posts contain multiple images. If you'd like to support that you need to fetch the subattachments also:
/posts?fields=attachments{subattachments{media}}?access_token=YOUR_ACCESS_TOKEN
Note that this method usually only provides image URLs that are up to 720px wide. If you want higher resolution imagery, you need to access data[0].attachments.data[0].subattachments.data[0].target.id to get the actual image ID which you can then use to perform an additional query /IMAGE_ID_HERE?fields=images to obtain the higher resolution image. Increment the numbers to get additional posts and images inside each post.

How to get high quality video source url for videos uploaded on facebook public page using graph api V2.1

I am trying to get high quality video source url for videos uploaded on public page by admin and normal users.
By using graph api v2.1 I can get all videos uploaded on this page by using
https://graph.facebook.com/v2.1/547830001966077/feed
But when I try to get details of each video by using following method, sometimes it gives error and sometime it works,
For E.g.
v2.1/817476674942956 => Working
But for shared story
v2.1/10201407437548351 => Not working
Error Details:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
If we load this video in browser, its showing HD option at bottom,
https://www.facebook.com/photo.php?v=10201407437548351
So I would like to know is there any way to get high quality source url for videos for all users from a public page.
Thank you.

Not getting albums of some users in facebook sdk graph api

I am querying in graph api like this /userid/albums
I am getting response of most users successful but I am though not getting response of some users. It give me blank response-
{
"data": [ ]
}
You need to ask the user for user_photos/friends_photos in order to get the albums of the concerned user or his friends.