Events API
API endpoints and SDK methods for working with detected events
Events API
The Events API allows you to work with individual driving events detected in videos. This page documents both the REST API endpoints and the corresponding SDK methods.
Event Structure
Each detected event contains the following information:
Event Types
NomadicML identifies several categories of driving events:
Type | Description | Examples |
---|---|---|
Traffic Violation | Potential violations of traffic laws | Running stop signs, lane violations, speeding |
Safety Alert | Safety concerns | Near misses, hard braking, unsafe following distance |
Drive Quality | Issues with driving technique | Poor lane positioning, jerky acceleration |
DMV Compliance | Relevant to DMV testing | Improper parallel parking, incorrect 3-point turns |
Near Collision | Close calls with other objects | Near misses with pedestrians, vehicles, obstacles |
Event Severity Levels
Events are categorized into three severity levels:
Level | Description |
---|---|
low | Minor issues, no safety risk |
medium | Clear violations, potential safety concerns |
high | Serious safety issues, major violations |
Get Video Events
Retrieve events detected in a specific video.
SDK Method
Method Parameters
Parameter | Type | Required | Description |
---|---|---|---|
video_id | string | Yes | ID of the video |
severity | string | No | Filter by severity (“low”, “medium”, “high”) |
event_type | string | No | Filter by event type |
Return Value
HTTP Request
Headers:
Query Parameters:
firebase_collection_name
(string, required): Collection name (default: “videos”)severity
(string, optional): Filter by severity (“low”, “medium”, “high”)event_type
(string, optional): Filter by event type
Working with Events
The SDK provides methods to effectively work with event data:
Parsing Events
The SDK includes a helper method to parse events from the API response:
Event Timeframes
Events include both timestamp and frame index information:
Event Metrics
Extract detailed metrics from events:
Batch Processing Events
Process events across multiple videos:
Analyzing Event Patterns
Extract patterns from events:
Event Sampling
For long videos with many events, you may want to sample events:
Error Handling
The API returns standard HTTP status codes and the SDK raises specific exceptions: