GET
/
data
/
views
/
query
/
total
/
{playbackId}
import { Livepeer } from "livepeer";

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

async function run() {
  const result = await livepeer.metrics.getPublicViewership("<id>");

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

run();
{
  "playbackId": "1bde4o2i6xycudoy",
  "dStorageUrl": "ipfs://QmZ4",
  "viewCount": 100,
  "playtimeMins": 10
}

Authorizations

Authorization
string
header
required

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

Path Parameters

playbackId
string
required

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

Response

200
application/json
A single Metric object with the viewCount and playtimeMins metrics.

A simplified metric object about aggregate viewership of an asset. Either playbackId or dStorageUrl will be set.

playbackId
any
dStorageUrl
any
viewCount
any
playtimeMins
any