Skip to main content

Instant Stats

Returns real-time parcel activity counts for two configurable trailing time windows.

This endpoint is designed for operational dashboards and health checks — it gives a live count of how many parcels have been processed in the last N minutes across two independently configurable windows (for example, the last 5 minutes versus the last 60 minutes).

Endpoint

POST /v2/reports/instant-stats

Request Body

FieldTypeRequiredConstraintsDescription
minutes1intYesMust be a positive integerDuration (in minutes) for the first time window
minutes2intYesMust be a positive integerDuration (in minutes) for the second time window
{
"minutes1": 5,
"minutes2": 60
}

Response

Returns parcel counts for each of the two requested time windows.

{
"success": true,
"data": {
"window1Minutes": 5,
"window1Count": 12,
"window2Minutes": 60,
"window2Count": 148
}
}

Response Fields

FieldTypeDescription
window1MinutesintThe duration of the first time window, as requested
window1CountintNumber of parcels processed within the first time window
window2MinutesintThe duration of the second time window, as requested
window2CountintNumber of parcels processed within the second time window

Code Examples

curl -X POST "https://rest.ecgrid.io/v2/reports/instant-stats" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "minutes1": 5, "minutes2": 60 }'

See Also