How to link a YouTube video through the Facebook Graphics API

In particular, I am looking for the functionality of the built-in video player that you would get if you only manually shared a YouTube video, but did it programmatically through the Graph API.

+4
source share
2 answers

It looks like you need to extract the actual swf urls on the page and the thumbnail image yourself.

For example, this works:

curl -F 'access_token=...' \ -F 'message=Link to YouTube' \ -F 'link=http://www.youtube.com/watch?v=3aICB2mUu2k' \ -F 'source=http://www.youtube.com/v/3aICB2mUu2k' \ -F 'picture=http://img.youtube.com/vi/3aICB2mUu2k/0.jpg' \ https://graph.facebook.com/me/feed 

See source: Posting embedded video using the Facebook API

+2
source

You can use the old REST API or the new Graph API. In any case, you must have publish_stream permission.

If you want to use the Graph API, you need to create a Post object and then send it to the graph feed URL for this profile

graph.facebook.com/PROFILE_ID/feed

You need to set the source property in the Post object for the youTube URL for the video.

http://developers.facebook.com/docs/reference/api/post/

If you want to use the old REST API, the process is similar, but you send a message

api-video.facebook.com/restserver.php

0
source

All Articles