use graph api on php to get video data from facebook page - facebook

I need load all videos data from a facebook page use graph api. How do this in php code?

You will have to use Facebook FQL for Querying Video Table. Hope it helps
Edited
To read video you need:
Any valid access_token for publicly available videos
user_videos permissions for all videos owned by the user (including nonpublic videos)
friend_videos permissions for videos owned by the user's friends
See this example for more detail for getting Valid Access Token

Related

Facebook Graph API: How can I retrieve the number of views of a video I shared from another profile using the Facebook Graph API?

I have a business manager account for my Facebook profile and I re-shared a video from another profile. How can I retrieve the number of views that my re-share accounted for through the Facebook Graph API?
If the video were posted directly to my profile rather than re-shared, I'd be able to use the /v2.8/{video-id}/video_insights method to retrieve the video stats, but that does not appear to be available for re-shares. The only insights that I can find for re-shares appears to be /v2.8/{post-id}/insights, but that does not include video views.
For example, here is a Facebook post by The Dodo where they are re-sharing a video by Discovery News.
This information can be retrieved by making a call to /v2.8/{post-id}/insights/post_video_views

Can I access the post reach or video views of a media that is posted to aFacebook wall and not a Facebook page?

I have to fetch the count of post reached and video views of media(image, video or text) that is posted to the Facebook wall of a user.
I am using Facebook Graph API for this purpose.
On doing some research I found that facebook insights are used to fetch the posts reached and video views count. But this data can only be fetched if the media is posted to a page and not to a user's Facebook wall. I have gone through the link below to confirm this
https://developers.facebook.com/docs/graph-api/reference/v2.3/insights
I even found a link wher we can get the insights of an app using the app_insights feature of Facebook as mentioned in the link:
App Insights /{app-id}/app_insights
Can I fetch the post reached and video view counts of a specific media that is posted to a user's FB account using the app-id/app_insights?
If not, is there any way to access the data for a post made in the Fb wall using Facebook Graph API?
Please suggest!!
There is no 'user insights' or equivalent feature in the API
There's Page Insights (via the /insights edge of a page or page post) or App Analytics via the app_insights edge on an App

Get Views Of A Facebook Video Using Public API

If I want to download statistics on a Facebook video, I can use https://developers.facebook.com/docs/graph-api/reference/video to get almost all the public information about a video expect for its view count. Is there someway to get the view count from videos on Facebook page from the API without having access to pages insights?
Video in a Fan Page is treated as a POST, you can check the following link for the documentation
Permissions
Any valid access token can be used for publicly available metrics
(currently page_fans_country or page_storytellers_by_country).
access token with read_insights permission can retrieve metrics for
all pages and domains owned by this user. A page access token with
read_insights permission can retrieve all metrics for that Page.A user
So the answer to your question is, it's not possible without the "read_insights permission".

How to get OTHER users' photos and albums with Facebook Graph API

Scenario: logged with my Facebook account and using a browser, I'm able to see some photos and albums of some users which aren't friends of mine (with a privacy setting of public or similar) and quite all their past profile photos.
For example the URL
https://www.facebook.com/<userid>/photos_all shows those photos.
I want to replicate behaviour with Graph API but GETting
https://graph.facebook.com/<userid>/photos?access_token=...
Gives me an empty data array.
Same scenario using tagged or albums instead of photos
I've tried to use site scraping but FB website uses AJAX to populate gridview of photos, so It's very difficult.
On Graph API Explorer I've requested and use an access token with all permissions and also a debug access token but I'm still unable to get other users' photos.
It's possibile to get photos of users which aren't in friend list with Facebook Graph API? Am I missing something?
For privacy reasons, it´s not possible to get the photos of OTHER users with the API. Even for the authorized user, you need the user_photos permission.
Scraping is not allowed btw: https://www.facebook.com/apps/site_scraping_tos_terms.php

Fetching all user and user friend's videos from facebook and store it Database

I am using rails and I need to fetch all user videos and user friend's videos from facebook and store it in our database.
Video's which is like
User and user friend's liked videos,
User and user friend's shared videos,
User and user friend's tagged videos,
User and user friend's commented videos,
User and user friend's uploaded videos, etc
So Is there any easy method to retrive all these videos at same time?
Videos in the user's stream will be in the stream object (see https://developers.facebook.com/docs/reference/fql/stream/). Play around in the Graph API explorer using fql?q={your query here} to see the results. You can play around with the where clause to get various groupings back. However, from my experience, to get all 5 categories of videos, you will have to run multiple queries. See documentation on multiquery query (Good examples here on this old REST API documentation: https://developers.facebook.com/docs/reference/rest/fql.multiquery/) Some of the non deprecated APIs support this.
Remember the Graph API explorer is your friend.