Tutorial

This tutorial shows you how to use the Graph API Explorer and free streaming software to stream live videos to your User profile.

Requirements

  • You must have an app in your Facebook Developer account. You can use an existing app or create a new one. The app doesn't have to be implemented or configured; it just has to exist in your developer account, so you can select it in the Graph API Explorer.
  • Video streaming software, such as OBS or Player.me. Both of these offer free versions.
  • Basic familiarity with the Graph API Explorer. See Graph API Explorer Guide.

Steps

Get an access token

Select your app from the Application dropdown, then go to Get Token > Get User Access Token.

Get an access token with the publish_video permission.

Get a Stream URL

Now that you have an access token with the publish_video permission, you can use it to request a stream URL from the Graph API. Change the operation method to POST and send a request to:

me/live_videos?status=LIVE_NOW

This will return a response that looks like this:

{
  "id": "10213552222135353",
  "stream_url": "rtmp://rtmp-api.faceboo...",
  "secure_stream_url": "rtmps://rtmp-api.faceboo...",
  "stream_secondary_urls": [
    ],
  "secure_stream_secondary_urls": [
    ]
}

Make a note of the id and stream_url values that were returned to you. You will need them to create create and end your stream.

Stream to the URL

Copy the stream_url value that you received in the last step and add it to your streaming software, then start a stream. Depending on which streaming software you are using, you may have to break the stream URL into its server (rtmp://rtmp-api.facebook.com/rtmp/) and key components (everything after /rtmp/).

For example, in OBS, choose OBS > Preferences. This opens the Settings screen. Set the Service to Facebook Live, add the stream URL in Settings > Stream > Stream Key, then start your stream.

This will create a live video post on your User profile, but as long as your app is still in development mode, it will only be visible to you. View your profile and verify that a new live video post has been created and is receiving your stream data.

End the Stream

Once you have verified that you are streaming to the live video post on your User profile, end the stream by sending a POST request to your live video's ID and include the end_live_video=true parameter in your request. For example, if your live video ID is 10213552222135353, end it like this:

10213552222135353?end_live_video=true

This ends your live video and saves it as a video on demand (VOD). If you want to delete it, change the operation method to DELETE and send the request to your live video ID.