> ## 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.

# Session Telemetry

> What the viewer's browser reported during a session: WebRTC events and periodic stream statistics.

Return the rows the player sent for one session. Two kinds share the list: **event rows** (`logType: "Webrtc"`) mark the WebRTC handshake and disconnects, and **statistics rows** (no `logType`) arrive every few seconds with FPS, decoded frames, bitrate, latency and packet loss. Together they answer "did this viewer actually see video, and how well".

<Info>
  Scope: `read`. Rows come newest first; pass `logType=Webrtc` to get only the events. `projectId` is required and must match the session.
</Info>

## Query parameters

<ParamField query="sessionId" type="string" required>
  The session.
</ParamField>

<ParamField query="projectId" type="string" required>
  The project the session belongs to.
</ParamField>

<ParamField query="logType" type="string">
  `Webrtc` to return event rows only.
</ParamField>

<ParamField query="startDate" type="string">ISO 8601.</ParamField>
<ParamField query="endDate" type="string">ISO 8601.</ParamField>
<ParamField query="limit" type="integer" default="100">Rows to return. A 30-minute session produces several hundred statistics rows; use `1000` to get them all.</ParamField>
<ParamField query="skip" type="integer" default="0">Offset.</ParamField>

## Headers

<ParamField header="x-api-key" type="string" required>
  Your Streampixel API key.
</ParamField>

## Response

<ResponseField name="total" type="number">Rows matching the query.</ResponseField>
<ResponseField name="count" type="number">Rows returned.</ResponseField>

<ResponseField name="logs" type="array">
  <Expandable title="Event row (logType = Webrtc)">
    <ResponseField name="event" type="string">`sdpOffer`, `sdpAnswer`, `connected`, `videoInitialized`, `disconnected`, `visibilitychange`, …</ResponseField>
    <ResponseField name="timestamp" type="string">ISO 8601.</ResponseField>
    <ResponseField name="iceConnectionState / reasonName / code / visibility / tcpFallback" type="mixed">Present on the events they describe.</ResponseField>
    <ResponseField name="browser / os / deviceType / geoData / domainUrl / embedded" type="mixed">Client details, on the first rows.</ResponseField>
  </Expandable>

  <Expandable title="Statistics row (no logType)">
    <ResponseField name="timestamp" type="string">ISO 8601.</ResponseField>
    <ResponseField name="FPS" type="string">Frames per second decoded.</ResponseField>
    <ResponseField name="framesDecoded" type="string">Cumulative decoded frames. A session whose maximum stays `0` never showed video.</ResponseField>
    <ResponseField name="bitrate" type="string">Receive bitrate as reported by the player.</ResponseField>
    <ResponseField name="latency" type="string">Round-trip time in milliseconds.</ResponseField>
    <ResponseField name="packetLoss / framesDropped" type="string">Cumulative counters.</ResponseField>
    <ResponseField name="videoCodec / videoResolution" type="string">Negotiated codec and current resolution.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={"dark"}
  curl "https://platform.streampixel.io/api/v1/analytics/frontend-streaming-logs?sessionId=session_1790294409382_3035&projectId=664f1a2b3c4d5e6f7a8b9c0d&limit=1000" \
    -H "x-api-key: $STREAMPIXEL_API_KEY"
  ```

  ```javascript Node.js theme={"dark"}
  const u = new URL('https://platform.streampixel.io/api/v1/analytics/frontend-streaming-logs');
  u.search = new URLSearchParams({ sessionId: 'session_1790294409382_3035', projectId: '664f1a2b3c4d5e6f7a8b9c0d', limit: '1000' });
  const { logs } = await (await fetch(u, { headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } })).json();
  const stats = logs.filter((r) => !r.logType && r.loadingText == null);
  const maxFrames = Math.max(0, ...stats.map((r) => Number(r.framesDecoded) || 0));
  console.log(maxFrames > 0 ? 'video delivered' : 'no video decoded');
  ```

  ```python Python theme={"dark"}
  import os, requests

  r = requests.get(
      "https://platform.streampixel.io/api/v1/analytics/frontend-streaming-logs",
      params={"sessionId": "session_1790294409382_3035", "projectId": "664f1a2b3c4d5e6f7a8b9c0d", "limit": 1000},
      headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
  )
  rows = r.json()["logs"]
  events = [x["event"] for x in rows if x.get("logType") == "Webrtc"]
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK (abridged) theme={"dark"}
  {
    "success": true,
    "total": 412,
    "count": 412,
    "logs": [
      { "sessionId": "session_1790294409382_3035", "timestamp": "2026-09-25T14:31:40.000Z", "logType": "Webrtc", "event": "disconnected", "code": 1000 },
      { "sessionId": "session_1790294409382_3035", "timestamp": "2026-09-25T14:31:35.000Z", "FPS": "60", "framesDecoded": "104812", "bitrate": "8120", "latency": "38", "packetLoss": "0", "videoCodec": "H264", "videoResolution": "1920x1080" },
      { "sessionId": "session_1790294409382_3035", "timestamp": "2026-09-25T14:02:33.000Z", "logType": "Webrtc", "event": "videoInitialized" },
      { "sessionId": "session_1790294409382_3035", "timestamp": "2026-09-25T14:02:32.000Z", "logType": "Webrtc", "event": "connected", "iceConnectionState": "connected" },
      { "sessionId": "session_1790294409382_3035", "timestamp": "2026-09-25T14:02:31.000Z", "logType": "Webrtc", "event": "sdpAnswer" },
      { "sessionId": "session_1790294409382_3035", "timestamp": "2026-09-25T14:02:30.000Z", "logType": "Webrtc", "event": "sdpOffer", "browser": "Chrome", "os": "Windows", "deviceType": "desktop", "geoData": { "country": "DE", "city": "Berlin" } }
    ]
  }
  ```
</ResponseExample>

## Reading it

| Pattern                                    | Meaning                                                                                                       |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| No rows at all                             | The player never reported: the tab was frozen while the app started, or an embedded player without telemetry. |
| Events but `framesDecoded` never above `0` | Connected but no video: usually a codec the browser cannot decode, or the app never rendered.                 |
| `sdpAnswer` but no `connected`             | The media connection never came up: the viewer's network blocks WebRTC.                                       |
| `framesDecoded` rising and `FPS` above `0` | Video delivered.                                                                                              |

## Errors

| Status | Cause                                                                          |
| ------ | ------------------------------------------------------------------------------ |
| `403`  | `projectId` missing, or the session belongs to a different project or account. |
