Skip to main content
GET
/
streaming
/
statistics
/
stream
/
viewers
Python
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
response = client.streaming.statistics.get_live_unique_viewers(
    from_="from",
    to="to",
)
print(response)
[
  {
    "client": 123,
    "metrics": {
      "streams": [
        [
          1640995210,
          10
        ],
        [
          1640995310,
          10
        ],
        [
          1640995410,
          10
        ],
        [
          1640995510,
          20
        ],
        [
          1640995610,
          20
        ]
      ]
    }
  }
]

Documentation Index

Fetch the complete documentation index at: https://gcore.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Query Parameters

from
string
required

Start of time frame. Format is date time in ISO 8601

to
string
required

End of time frame. Format is date time in ISO 8601

stream_id
integer

Filter by "stream_id"

client_user_id
integer

Filter by "client_user_id"

granularity
enum<string>
default:1h

Specifies the time interval for grouping data

Available options:
1m,
5m,
15m,
1h,
1d

Response

OK

client
integer
required
metrics
object
required
Example:
[
{
"client": 123,
"metrics": {
"streams": [
[1640995210, 10],
[1640995310, 10],
[1640995410, 10],
[1640995510, 20],
[1640995610, 20]
]
}
}
]