> This page is for version Dev.
> For other versions, use one of these documentation indexes:
> - 3.3.0 (default): https://docs.nvidia.com/vss/3.3.0/llms.txt
> - Dev: https://docs.nvidia.com/vss/dev/llms.txt

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

# Get behaviors

GET https://ai.nvidia.com/api/v3.3/analytics/behavior

Retrieve behavior records from the database using optional sensor, place, object, time-range, query-string, and result-limit filters.

Reference: https://docs.nvidia.com/vss/system-components/middleware/api-gateway-mcp/video-analytics-api/video-analytics-api-reference/behavior/controller-behavior-get-behavior

## Request

### Query parameters

- `sensorId` (string, optional) — This parameter is incompatible with place. Only one of them can exist in the query.
- `place` (string, optional) — This parameter is incompatible with sensorId. Only one of them can exist in the query.
- `objectId` (string, optional) — This parameter is incompatible with either 'place', 'queryString' or 'maxResultSize'. It also requires 'sensorId', 'fromTimestamp' and 'toTimestamp' in the query.
- `objectType` (string, optional) — If this parameter is present in the query, then 'objectId' should also be present in the query.
- `fromTimestamp` (datetime, optional) — If this parameter is present in the query, then 'toTimestamp' should also be present in the query.
- `toTimestamp` (datetime, optional) — If this parameter is present in the query, then 'fromTimestamp' should also be present in the query.
- `queryString` (string, optional) — 'queryString' should follow lucene syntax.
- `maxResultSize` (long, optional, default: 25)

## Response

### 200

Successful Operation.

- `behaviors` (list of Behavior, required)

## Errors

### 400 Bad Request Error

Bad Request. This response will be sent if any of the required params are not present or if extra params are passed. It will also be sent if parameter dependencies (mentioned in parameter descriptions) are not satisfied.

- `error` (string, required)

### 404 Not Found Error

Resource Not Found

- `error` (string, required)

### 422 Unprocessable Entity Error

Unprocessable Entity

- `error` (string, required)

### 500 Internal Server Error

Internal Server Error

- `error` (string, required)

## Types

### Behavior

- `timestamp` (datetime, required)
- `Id` (string, required)
- `id` (string, required)
- `timeInterval` (float, required)
- `end` (datetime, required)
- `length` (long, required)
- `speedOverTime` (list of double, required)
- `sensor` (Sensor, required)
- `place` (Place, required)
- `object` (Object, required)
- `direction` (enum, required)
  - Allowed values: `N`, `NNE`, `NE`, `ENE`, `E`, `ESE`, `SE`, `SSE`, `S`, `SSW`, `SW`, `WSW`, `W`, `WNW`, `NW`, `NNW`, `Right`, `Left`, `Up`, `Down`
- `speed` (double, required)
- `distance` (double, required)
- `bearing` (double, required)
- `videoPath` (string, required)
- `locations` (Locations, optional)
- `smoothLocations` (Locations, optional)
- `event` (Event, optional)
- `edges` (list of string, optional)
- `analyticsModule` (AnalyticsModule, optional)

### Sensor

- `id` (string, required)
- `description` (string, required)
- `type` (string, required)
- `info` (map from string to string, optional)

### Place

- `name` (string, required)
- `info` (map from string to string, optional)

### Object

- `type` (string, required)
- `location` (ObjectLocation, required)
- `bbox` (Bbox, required)
- `id` (string, required)
- `speed` (double, required)
- `coordinate` (ObjectCoordinate, required)
- `info` (map from string to string, optional)

### Locations

- `type` (enum, required) — Type of Geoshape
  - Allowed values: `linestring`
- `coordinates` (list of list of double, required)

### Event

- `type` (string, required) — Allowed values for tripwire events: 'IN', 'OUT'. Allowed values for roi events: 'ENTRY', 'EXIT'.
- `id` (string, required)
- `info` (map from string to string, optional)

### AnalyticsModule

- `id` (string, optional)
- `description` (string, optional)
- `version` (string, optional)
- `source` (string, optional)
- `info` (map from string to string, optional)

### ObjectLocation

- `lon` (double, required)
- `lat` (double, required)
- `alt` (double, required)

### Bbox

- `topY` (double, required)
- `rightX` (double, required)
- `bottomY` (double, required)
- `leftX` (double, required)
- `embeddings` (list of BboxEmbeddingsItems, required)
- `confidence` (float, required)
- `info` (map from string to string, optional)

### ObjectCoordinate

- `x` (double, required)
- `y` (double, required)
- `z` (double, required)

### BboxEmbeddingsItems

- `vector` (list of float, required)

## Examples

**Response**

```json
{
  "behaviors": [
    {
      "timestamp": "2022-08-25T00:00:00.000Z",
      "Id": "logstash generated Id",
      "id": "Cam1 #-# 11",
      "timeInterval": 30,
      "end": "2022-08-25T00:00:30.000Z",
      "length": 1,
      "speedOverTime": [
        2.1,
        3.2
      ],
      "sensor": {
        "id": "cam-1",
        "description": "description of sensor",
        "type": "sensor",
        "info": {
          "additionalProperty1": "value1",
          "additionalProperty2": "value2"
        }
      },
      "place": {
        "name": "city=abc/building=def/Warehouse=xyz",
        "info": {
          "additionalProperty1": "value1",
          "additionalProperty2": "value2"
        }
      },
      "object": {
        "type": "Person",
        "location": {
          "lon": 7.5,
          "lat": 2.6,
          "alt": 9.47
        },
        "bbox": {
          "topY": 0.5,
          "rightX": 1.7,
          "bottomY": 0.8,
          "leftX": 0.6,
          "embeddings": [
            {
              "vector": [
                0.1
              ]
            }
          ],
          "confidence": 0.95,
          "info": {
            "additionalProperty1": "value1",
            "additionalProperty2": "value2"
          }
        },
        "id": "133",
        "speed": 50,
        "coordinate": {
          "x": 50,
          "y": 50,
          "z": 50
        },
        "info": {
          "additionalProperty1": "value1",
          "additionalProperty2": "value2"
        }
      },
      "direction": "N",
      "speed": 1.1,
      "distance": 1.1,
      "bearing": 1.1,
      "videoPath": "path_to_video",
      "locations": {
        "type": "linestring",
        "coordinates": [
          [
            1
          ]
        ]
      },
      "smoothLocations": {
        "type": "linestring",
        "coordinates": [
          [
            1
          ]
        ]
      },
      "event": {
        "type": "ENTRY",
        "id": "hazard_zone_1",
        "info": {
          "additionalProperty1": "value1",
          "additionalProperty2": "value2"
        }
      },
      "edges": [
        "1"
      ],
      "analyticsModule": {
        "id": "1",
        "description": "description",
        "version": "example1",
        "source": "source1",
        "info": {
          "additionalProperty1": "value1",
          "additionalProperty2": "value2"
        }
      }
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://ai.nvidia.com/api/v3.3/analytics/behavior"

querystring = {"fromTimestamp":"2022-08-25T00:00:00.000Z","toTimestamp":"2022-08-25T00:00:10.000Z"}

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

print(response.json())
```

```javascript
const url = 'https://ai.nvidia.com/api/v3.3/analytics/behavior?fromTimestamp=2022-08-25T00%3A00%3A00.000Z&toTimestamp=2022-08-25T00%3A00%3A10.000Z';
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
package main

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

func main() {

	url := "https://ai.nvidia.com/api/v3.3/analytics/behavior?fromTimestamp=2022-08-25T00%3A00%3A00.000Z&toTimestamp=2022-08-25T00%3A00%3A10.000Z"

	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
require 'uri'
require 'net/http'

url = URI("https://ai.nvidia.com/api/v3.3/analytics/behavior?fromTimestamp=2022-08-25T00%3A00%3A00.000Z&toTimestamp=2022-08-25T00%3A00%3A10.000Z")

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
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://ai.nvidia.com/api/v3.3/analytics/behavior?fromTimestamp=2022-08-25T00%3A00%3A00.000Z&toTimestamp=2022-08-25T00%3A00%3A10.000Z")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://ai.nvidia.com/api/v3.3/analytics/behavior?fromTimestamp=2022-08-25T00%3A00%3A00.000Z&toTimestamp=2022-08-25T00%3A00%3A10.000Z');

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

```csharp
using RestSharp;

var client = new RestClient("https://ai.nvidia.com/api/v3.3/analytics/behavior?fromTimestamp=2022-08-25T00%3A00%3A00.000Z&toTimestamp=2022-08-25T00%3A00%3A10.000Z");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://ai.nvidia.com/api/v3.3/analytics/behavior?fromTimestamp=2022-08-25T00%3A00%3A00.000Z&toTimestamp=2022-08-25T00%3A00%3A10.000Z")! 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()
```