3

I was curious as to if there is anyway to have a certain page on Facebook have a static URL for it's Live Streams. I want this so I can use that static URL and embed it on a website (Weebly or Wordpress). Does anyone know of a way to do this?

Any and all input is greatly appreciated.

Thanks much!

DanOpi
  • 133
  • 2
  • 12

2 Answers2

1

No, currently there is no such direct feature provided by Facebook to achieve what you want to do. But there is definitely an indirect way of doing this using Facebook Graph API.

Indirect method of doing so:

  1. Use your page ID to get status of last live video of your page.

    /Page_ID?fields=live_videos.limit(1){status}

  2. If you get status field as 'LIVE', it means your video is still LIVE on your page. Then, use the returned Video Id of Live video to make next request.

  3. You can get the embed html of the live video using this request:

    /Video_ID?fields=embed_html

  4. Use the returned embed_html to embed live video in your wordpress site.

You just need to write the script that executes the above task and embed video conditionally if the status of video is LIVE otherwise not.

Aakash Gupta
  • 756
  • 4
  • 16
0

This is a pretty old question, but here's my solution:

  1. Make a GET request to https://facebook.com/PAGE_ID/live
  2. Capture the redirect - this request redirects to the URL you want

How I did it in Node.JS

const https = require("follow-redirects").https;
const PageID = "nexe32"

let redirected = false;

https.get({
    host: 'facebook.com',
    path: `/${PageID}/live`,
    headers: {
        "User-Agent": 'curl/7.43.0'
    },
    beforeRedirect: (opts) => {
        if(!redirected) {
            redirected = true;
        } else {
            console.log(opts.href); // the URL you want
            redirected = false;
        }
    }
});
``
neoney
  • 96
  • 6
  • Hi @neoney, they don't seem to be redirecting anymore. Can you please confirm if this is still working? – Akmal Jul 22 '20 at 14:43