Skip to main content
GET
/
pixelStripeApi
/
projects
/
userStats
/
{projectId}
curl "https://api.streampixel.io/pixelStripeApi/projects/userStats/[PROJECT_ID]?userId=[YOUR_USER_ID]&apikey=[YOUR_API_KEY]"
{
  "liveUser": 7,
  "queueUser": 2
}

Documentation Index

Fetch the complete documentation index at: https://docs.streampixel.io/llms.txt

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

Return real-time counts of live users (active streaming sessions) and queued users (waiting for a worker) for a single project. Use this to power live status indicators, capacity dashboards, and autoscaling triggers without pulling the full session list.
Live and queue state is read from Redis, so this endpoint is fast enough to poll on a short interval. A few seconds between polls is plenty — the counts update in near real time.

Typical workflow

1

Authenticate

Pass userId and apikey as query parameters. Both are required.
2

Request the counts

Call GET /projects/userStats/{projectId} for the project you want to inspect.
3

Render or react

Use liveUser and queueUser in your dashboard, or compare against thresholds to trigger alerts.

Prerequisites

RequirementWhere to get it
User IDFinding your IDs
Project IDFinding your IDs
API KeyAPI authentication
Unlike most Streampixel endpoints (which take apiKey in the JSON body), this is a GET request — the API key is passed as the apikey query parameter. Treat the URL as sensitive: prefer server-side calls and avoid logging it in plain text.

Path parameters

projectId
string
required
The ID of the project to fetch live and queue user counts for.

Query parameters

userId
string
required
The ID of the account that owns the project. Must match the project’s owner.
apikey
string
required
Your Streampixel API key. Note the all-lowercase casing — this parameter is apikey, not apiKey.

Response

liveUser
number
Number of users currently in an active streaming session for this project. Sessions in Terminated or Terminating state are excluded.
queueUser
number
Number of users waiting in the project’s queue for a worker to become available.
curl "https://api.streampixel.io/pixelStripeApi/projects/userStats/[PROJECT_ID]?userId=[YOUR_USER_ID]&apikey=[YOUR_API_KEY]"
{
  "liveUser": 7,
  "queueUser": 2
}

Error reference

StatusMessageCause
400projectId, userId and apikey are requiredOne or more required parameters were omitted.
401Invalid UserThe supplied userId doesn’t match any account.
401Unauthorized: Invalid API KeyThe apikey doesn’t match the user’s current key.
403Access deniedThe project exists but isn’t owned by userId.
404Project not foundNo project with the supplied projectId.
500Internal server errorUnexpected failure. Retry; if it persists, contact support.

Polling pattern

For a live dashboard, poll on a short interval and stop the timer when the page is hidden. This keeps the UI responsive without hammering the API.
Node.js / Browser
async function fetchStats(projectId, userId, apikey) {
  const url = new URL(
    `https://api.streampixel.io/pixelStripeApi/projects/userStats/${projectId}`
  );
  url.searchParams.set('userId', userId);
  url.searchParams.set('apikey', apikey);

  const res = await fetch(url);
  if (!res.ok) throw new Error(`stats failed: ${res.status}`);
  return res.json();
}

let timer = setInterval(async () => {
  try {
    const { liveUser, queueUser } = await fetchStats(
      '[PROJECT_ID]',
      '[YOUR_USER_ID]',
      '[YOUR_API_KEY]'
    );
    render({ liveUser, queueUser });
  } catch (err) {
    console.error(err);
  }
}, 5000);
If you only need an aggregate view across many projects, batch your polling on the server and push updates to clients over WebSocket or SSE — this is far cheaper than every browser tab polling directly.

Next

List projects

Enumerate every project so you can fetch stats for each.

Rate limits & errors

Limits per endpoint and the standard error response format.