Live

Get a live stream

Fetch one live stream with its status, encoding stats and the status and watch URL of each destination.

GET https://social-publish-api.onrender.com/v1/live/{id}

Poll this endpoint (every 5–10 s is plenty) to follow a stream from scheduled to live to ended.

Request

curl https://social-publish-api.onrender.com/v1/live/c0ffee00-1234-4abc-9def-0123456789ab \
  -H "x-access-key: $RELAYCAST_API_KEY"
const res = await fetch(`https://social-publish-api.onrender.com/v1/live/${id}`, { headers: { "x-access-key": process.env.RELAYCAST_API_KEY! } });
const { data: stream } = await res.json();
for (const d of stream.destinations) console.log(d.label, d.status, d.watchUrl ?? d.error);

Response

Response 200
{
  "data": {
    "id": "c0ffee00-1234-4abc-9def-0123456789ab",
    "title": "Friday product demo",
    "status": "live",
    "source": { "type": "url", "url": "https://cdn.example.com/live/index.m3u8", "mediaId": null, "filename": null, "kind": "hls" },
    "loop": false,
    "video": "auto",
    "maxDurationMinutes": null,
    "scheduledFor": "2026-11-06T12:30:00.000Z",
    "startedAt": "2026-11-06T12:30:07.512Z",
    "endedAt": null,
    "durationSeconds": 1834,
    "error": null,
    "stats": { "sourceKind": "hls", "videoCodec": "h264", "audioCodec": "aac", "width": 1920, "height": 1080, "fps": 30, "encoding": "copy", "bitrateKbps": 5120, "speed": 1, "restarts": 0 },
    "destinations": [
      { "id": "0a1b…", "kind": "youtube", "platform": "youtube", "label": "YouTube · Acme", "status": "live", "error": null, "watchUrl": "https://www.youtube.com/watch?v=AbCdEf12345", "server": null },
      { "id": "9f8e…", "kind": "twitch", "platform": "twitch", "label": "Twitch · acme", "status": "live", "error": null, "watchUrl": "https://www.twitch.tv/acme", "server": null },
      { "id": "4e5f…", "kind": "custom", "platform": "instagram", "label": "Instagram Live", "status": "failed", "error": "the platform closed the connection (check the stream key)", "watchUrl": null, "server": "rtmps://edgetee-upload-xx.fbcdn.net:443/rtmp" }
    ],
    "createdAt": "2026-11-05T09:12:44.120Z"
  }
}

(Some destination fields are omitted above for brevity.)

Stream fields

FieldTypeDescription
statusstringscheduled, starting, live, ending, ended, failed or canceled.
source.kindstringhls, dash, file, rtmp, rtsp, srt or http.
startedAtstring | nullWhen media first reached a platform.
durationSecondsintegerSeconds streamed so far (counted against live minutes).
errorstring | nullWhy the stream failed, or why it ended early.
statsobjectWhat the source contained and how it was sent. encoding is copy (passed through) or the output height, such as 720p.

Destination fields

FieldTypeDescription
kindstringyoutube, facebook, twitch or custom.
platformstringThe platform (for custom destinations, from the preset).
serverstring | nullCustom destinations: the server address, without the stream key.
statusstringpending, connecting, live, ended or failed.
errorstring | nullWhy this destination failed. Other destinations aren't affected.
watchUrlstring | nullPublic URL of the broadcast (YouTube, Facebook, Twitch).

Errors

StatusCodeWhen
401unauthorizedMissing or invalid API key.
404not_foundNo live stream with this ID in the API key's project.

This page is also available as Markdown.