跳转到主要内容
GET
/
data
/
views
/
query
/
total
/
{playbackId}
TypeScript
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": "<unknown>",
  "dStorageUrl": "<unknown>",
  "viewCount": "<unknown>",
  "playtimeMins": "<unknown>"
}

获取公开总观看次数

授权

Authorization
string
header
必填

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

路径参数

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

响应

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
Last modified on March 3, 2026