Skip to main content
GET
GET /api/stats
The GET /api/stats endpoint provides aggregated statistics and metrics about your error logs for dashboard analytics and reporting.

Query Parameters

string
Filter stats from this date (ISO 8601).Example: /api/stats?startDate=2024-01-01T00:00:00Z
string
Filter stats until this date (ISO 8601).Example: /api/stats?endDate=2024-01-31T23:59:59Z
string
Filter stats by environment.Example: /api/stats?environment=production
string
Filter stats by application ID.Example: /api/stats?appId=my-frontend-app
string
default:"1h"
Time interval for time-series data.Values: 1h (hourly), 1d (daily), 1w (weekly)Example: /api/stats?interval=1d

Response Fields

object
High-level statistics.
object
Breakdown by severity level.
array
Breakdown by environment.
array
Breakdown by application.
array
Error counts over time.
array
Most frequent error groups.
Trend analysis compared to previous period.

Example Requests

Example Response

Use Cases

Dashboard Overview

Display key metrics on your dashboard:

Time-Series Chart

Generate error trends chart:

Application Comparison

Compare error rates across apps:

Alerting

Set up automated alerts:

Weekly Report

Generate weekly summary:

Filtering by Time Range

Last 24 Hours

Last 7 Days

Specific Month

Year to Date

Time-Series Intervals

Hourly (1h)

Best for: Last 24-48 hours
Result: One data point per hour

Daily (1d)

Best for: Last 30-90 days
Result: One data point per day

Weekly (1w)

Best for: Last 3-12 months
Result: One data point per week

Performance Optimization

Stats change infrequently - cache for 1-5 minutes:

Client Implementation

TypeScript

Caching Headers

Stats responses include cache headers:
Use ETags for conditional requests:
If data hasn’t changed: 304 Not Modified

GET /api/logs

Retrieve individual error logs

GET /api/groups

Retrieve error groups

Analytics Guide

Learn about VIJ analytics

Dashboard Features

Explore dashboard visualizations