Statistics API

LiveGo provides an API endpoint to get real-time statistics about active streams.

Get Live Statistics

This endpoint returns information about all active publishers and players. You can optionally filter by a specific stream name.

  • Endpoint: GET /stat/livestat
  • Query Parameters:
    • room (string, optional): The full stream key (appname/streamname) to filter results. If omitted, all active streams are returned.
  • Success Response:
    • Code: 200 OK
    • Body: A JSON object containing lists of publishers and players.

Response Structure

The response is a JSON object with two main keys: publishers and players.

{
  "publishers": [
    {
      "key": "live/my_stream",
      "url": "rtmp://localhost:1935/live/my_stream",
      "stream_id": 1,
      "video_total_bytes": 1500000,
      "video_speed": 250000,
      "audio_total_bytes": 120000,
      "audio_speed": 20000
    }
  ],
  "players": [
    {
      "key": "live/my_stream",
      "url": "/live/my_stream.flv",
      "stream_id": 1,
      "video_total_bytes": 1498000,
      "video_speed": 249800,
      "audio_total_bytes": 119800,
      "audio_speed": 19800
    }
  ]
}

Field Descriptions:

  • key: The stream identifier (appname/streamname).
  • url: The source URL for publishers or the request URL for players.
  • stream_id: The internal RTMP stream ID.
  • video_total_bytes: The total number of video bytes transferred for this session.
  • video_speed: The current video bitrate in bits per second (bps).
  • audio_total_bytes: The total number of audio bytes transferred for this session.
  • audio_speed: The current audio bitrate in bits per second (bps).

Examples

  • Get all active streams:

    curl http://localhost:8090/stat/livestat
  • Get statistics for a specific stream:

    curl "http://localhost:8090/stat/livestat?room=live/my_stream"