Getting Pull URLs for an online stream
What is Pull URLs?
Pull URLs allow you to pull an existing online live stream from LiveAPI to another streaming tool for further broadcast. They can be understood as a source of another broadcast as well.
The best use case for RTMP Pulls is when there are multiple streams in one broadcast session. For example, concerts, cross-region events, live interviews, sports events, or even game streaming. Using RTMP links, you can compile multiple windows on your main screen to bring variety to your video content and engage the audience.
LiveAPI offers Pull URLs in 2 formats: RTMP and SRT.
Before you start
You will need access to LiveAPI Access Token. Refer to the Authentication in LiveAPI section to learn how to generate an access token via the LiveAPI dashboard.
How to get Pull URLs of a livestream
To get your Pull URLs, call GET /live_streams/{id}
when the stream is online (the broadcasting_status
of the stream should be showing online
).
Sample Request
curl --location --request GET 'https://api.liveapi.com/live_streams/6226ce5f31ddbeb3754aa243' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'Authorization: {your_authentication}'
Sample Response
{
"_id": "620e0d57427ff4ddd764515f",
"enabled": true,
"ingest": {
"server": "rtmp://ingest.liveapi.com/static",
"key": "lv_420181c08fcf11ec905cbbd963c96e69?password=fc0c144a"
},
"playback": {
"embed_url": "https://player.liveapi.com/lv_420181c08fcf11ec905cbbd963c96e69",
"embed_audio_url": "https://player.liveapi.com/lv_420181c08fcf11ec905cbbd963c96e69?onlyAudio=true",
"hls_url": "https://live.liveapi.com/620e0ba1ce8f11ddde571d1c/lv_420181c08fcf11ec905cbbd963c96e69/index.m3u8"
},
"platforms": [],
"settings": {
"pulling_mode": {}
},
"broadcasting_status": "online",
"user": "620e0ba1ce8f11ddde571d1c",
"environment": "production",
"organization": "620e0ba2ce8f11ddde571d1d",
"creation_time": "2022-02-17T08:54:47.086Z",
"pull_urls": {
"rtmp": "rtmp://sg-1.liveapi.com/lv_420181c08fcf11ec905cbbd963c96e69",
"srt": "srt://sg-1.liveapi.com:9998/?streamid=#!::r=lv_420181c08fcf11ec905cbbd963c96e69,m=request"
},
"thumb_url": "https://sg-1.liveapi.com/lv_420181c08fcf11ec905cbbd963c96e69/preview.mp4"
}
You will find the Pull URLs available in RTMP and SRT formats:
"pull_urls": {
"rtmp": "rtmp://sg-2.liveapi.com/lv_6ccbd6609e9011ecad519393af92c1a1",
"srt": "srt://sg-2.liveapi.com:9998/?streamid=#!::r=lv_6ccbd6609e9011ecad519393af92c1a1,m=request"
}
You can quickly test them out by opening the Pull URL in VLC (Open network stream option).
Pull URLs are available for online stream only
If you request Livestream details when the stream is offline, no Pull URLs will be returned in the response.
Updated over 1 year ago