> This page is for version Latest (default).
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/fleet-intel/latest/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/fleet-intel/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/fleet-intel/_mcp/server.

# Get categorical stats time series

GET /v1/stats

Returns aligned daily categorical chart data for a customer, node group, or compute zone over a trailing window ending at the current server time. Historical points come from stored stats. The final point is calculated live at request time and replaces any stored data for the current day. A missing historical record retains its scheduled timestamp and has null at the same index in every series; zero is an observed count. timestamps[i] identifies the point for every series.values[i], and all arrays have the same length. The agentStatus stat currently returns Online and Offline series in that order and requires dataSource. Healthy liveness counts as Online; every other, missing, or unrecognized liveness value counts as Offline.

Reference: https://docs.nvidia.com/fleet-intel/api-explorer/stats/get-v-1-stats

## Request

### Query parameters

- `name` (enum, required) — The stat to query
  - Allowed values: `agentStatus`
- `dataSource` (enum, optional) — Data source to query. Required for agentStatus.
  - Allowed values: `inband`, `oob`
- `groupBy` (enum, required) — The aggregation level to group stats by
  - Allowed values: `customer`, `nodegroup`, `computezone`
- `groupId` (string, optional) — Entity ID. Required when groupBy is nodegroup or computezone; omit when groupBy is customer.
- `window` (string, required) — Trailing daily window ending at the current server time. Must be a positive whole multiple of 24h and cannot exceed 8760h (365 days); use 240h for 10 days. 'd' is not supported.

## Response

### 200

Categorical time series for the requested stat

- `series` (list of models.StatsSeries, optional)
- `timeRange` (models.TimeRange, optional)
- `timestamps` (list of integer, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

### 401 Unauthorized Error

Unauthorized

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

### 403 Forbidden Error

Forbidden - UAM authorization denied

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

### 404 Not Found Error

Requested scope not found

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

### 499 Client Closed Request Error

Client Closed Request - request was canceled by the client

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

### 500 Internal Server Error

Internal Server Error

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

### 503 Service Unavailable Error

Service Unavailable

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

## Types

### models.StatsSeries

- `name` (string, optional)
- `values` (list of integer, optional)

### models.TimeRange

- `end` (datetime, optional)
- `start` (datetime, optional)

### models.KASRequestStatus

RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

- `requestId` (string, optional) — Request ID for tracing
- `statusCode` (string, optional) — Status code from KAS
- `statusDescription` (string, optional) — Status description from KAS

## Examples

**Response**

```json
{
  "series": [
    {
      "name": "Online",
      "values": [
        100,
        105,
        null,
        103,
        108,
        110,
        109,
        null,
        111,
        113
      ]
    },
    {
      "name": "Offline",
      "values": [
        80,
        90,
        null,
        87,
        82,
        81,
        84,
        null,
        80,
        79
      ]
    }
  ],
  "timeRange": {
    "end": "2024-07-06T15:30:00Z",
    "start": "2024-06-26T15:30:00Z"
  },
  "timestamps": [
    1719489600,
    1719576000,
    1719662400,
    1719748800,
    1719835200,
    1719921600,
    1720008000,
    1720094400,
    1720180800,
    1720279800
  ]
}
```

**SDK Code**

```python stats_getV1Stats_example
import requests

url = "https://api.example.com/v1/stats"

querystring = {"dataSource":"inband","groupBy":"nodegroup","groupId":"550e8400-e29b-41d4-a716-446655440000","name":"agentStatus","window":"240h"}

response = requests.get(url, params=querystring)

print(response.json())
```

```javascript stats_getV1Stats_example
const url = 'https://api.example.com/v1/stats?dataSource=inband&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&name=agentStatus&window=240h';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go stats_getV1Stats_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/stats?dataSource=inband&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&name=agentStatus&window=240h"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby stats_getV1Stats_example
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/stats?dataSource=inband&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&name=agentStatus&window=240h")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java stats_getV1Stats_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/v1/stats?dataSource=inband&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&name=agentStatus&window=240h")
  .asString();
```

```php stats_getV1Stats_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v1/stats?dataSource=inband&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&name=agentStatus&window=240h');

echo $response->getBody();
```

```csharp stats_getV1Stats_example
using RestSharp;

var client = new RestClient("https://api.example.com/v1/stats?dataSource=inband&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&name=agentStatus&window=240h");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift stats_getV1Stats_example
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/stats?dataSource=inband&groupBy=nodegroup&groupId=550e8400-e29b-41d4-a716-446655440000&name=agentStatus&window=240h")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```