GET
/
data
/
views
/
now
import { Livepeer } from "livepeer";

const livepeer = new Livepeer({
  apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await livepeer.metrics.getRealtimeViewership();

  // Handle the result
  console.log(result);
}

run();
[
  {
    "playbackId": "1bde4o2i6xycudoy",
    "device": "iPhone",
    "browser": "Safari",
    "country": "United States",
    "viewCount": 100,
    "errorRate": 0.1
  }
]

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

playbackId
string

The playback ID to filter the query results. This can be a canonical playback ID from Livepeer assets or streams, or dStorage identifiers for assets

creatorId
string

The creator ID to filter the query results

breakdownBy[]
enum<string>[]

The list of fields to break down the query results. Specify this query-string multiple times to break down by multiple fields.

Available options:
playbackId,
device,
browser,
country

Response

200
application/json
A list of Metric objects

The response is of type object[].