How can I download a video from Facebook using GraphAPI?

I want to download a video from facebook to the clients local drive. I saw a few browser plugins and Facebook apps that are able to that and I was wondering how it can be done using the GraphAPI or in any other way.


Solution 1:

First, you get the Graph API object. If the object is public, it's simple, just get https://graph.facebook.com/10151651550011063. (Where the number is the object's ID, equal to the ?v=OBJECTID in the facebook video URL.)

If the object is not public, you need a valid access_token, and the Graph API url becomes something like https://graph.facebook.com/10151651550011063?access_token=DFSDSGSFDGFGDSblabla

Then, in the Graph API object, you'll find the video download link under source.

Solution 2:

1/ You can get source video by api but it only in sd quality.

2/ If you need to get source video by api, make sure you know to get accesstoken by this way:

  • Go to https://m.facebook.com/composer/ocelot/async_loader/?publisher=feed
  • Search for EAAA... it is your accesstoken.

3/ https://graph.facebook.com/v10.0/(page/group/userid)_videoid?fields=source&access_token=your_accesstoken

example https://graph.facebook.com/v10.0/1389311341281276_2668264723385925?fields=source&access_token=your_accesstoken finally you can get private video or public video from facebook by graph api