For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
StatusSupportDiscussionsLog inSign Up
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
  • ACTIVATE ACCOUNT
    • Create account
  • PRODUCT OS API
    • Overview
  • ERROR CODES
    • Error codes
  • VIDEO ON DEMAND API
    • Overview
  • LIVE STREAM API
    • Overview
      • GETGet all live streams
      • GETGet stream views by ID
      • GETGet stream by ID
      • DELDelete a stream
      • PATCHUpdate a stream
      • PUTEnable a stream
      • PUTDisable a stream
      • PUTComplete a stream
  • VIDEO DATA API
    • Overview
LogoLogo
StatusSupportDiscussionsLog inSign Up
LIVE STREAM APIManage live stream

Get stream views by ID

GET
https://api.fastpix.com/v1/live/streams/:streamId/viewer-count
GET
/v1/live/streams/:streamId/viewer-count
$curl https://api.fastpix.com/v1/live/streams/61a264dcc447b63da6fb79ef925cd76d/viewer-count \
> -u "<username>:<password>"
200Retrieved
1{
2 "success": true,
3 "data": {
4 "views": 20
5 }
6}
This endpoint retrieves the current number of viewers watching a specific live stream, identified by its unique `streamId`. The viewer count is an **approximate value**, optimized for performance. It provides a near-real-time estimate of how many clients are actively watching the stream. This approach ensures high efficiency, especially when the stream is being watched at large scale across multiple devices or platforms. #### Example Suppose a content creator is hosting a live concert and wants to display the number of live viewers on their dashboard. This endpoint can be queried to show up-to-date viewer statistics. Related guide: <a href="https://docs.fastpix.io/docs/manage-streams">Manage streams</a>
Was this page helpful?
Previous

Get stream by ID

Next
Built with

This endpoint retrieves the current number of viewers watching a specific live stream, identified by its unique streamId.

The viewer count is an approximate value, optimized for performance. It provides a near-real-time estimate of how many clients are actively watching the stream. This approach ensures high efficiency, especially when the stream is being watched at large scale across multiple devices or platforms.

Example

Suppose a content creator is hosting a live concert and wants to display the number of live viewers on their dashboard. This endpoint can be queried to show up-to-date viewer statistics.

Related guide: Manage streams

Authentication

AuthorizationBasic

FastPix APIs are secured with Basic Authentication. Use your Access Token ID as the username and Secret Key as the password in the Authorization header of each API request.

  • Username: Access Token ID
  • Password: Secret Key

Activate your FastPix account to generate your API credentials. See the guide here

Path parameters

streamIdstringRequired
After creating a new live stream, FastPix assigns a unique identifier to the stream.

Response

Stream viewer count retrieved successfully
successboolean
Shows the request status. Returns true for success and false for failure.
dataobject
Contains the view count details.