Documentation
Distribution Statistics
Get the distribution of alerts grouped by type (category) or by origin source. Useful for understanding the nature and source of threats over time, building pie charts, and calculating percentage breakdowns. Use groupBy to switch between category and origin views. The response includes totalAlerts so you can compute percentages client-side without extra requests.
GEThttps://sirenapi.orielhaim.com/stats/distribution
Returns alert count breakdown by category
Query Parameters
| Parameter | Type | Description | Default | Required |
|---|---|---|---|---|
| startDate | ISO 8601 | Filter alerts from this date onwards | all time | no |
| endDate | ISO 8601 | Filter alerts until this date | now | no |
| origin | string | Filter by alert origin(s), comma-separated (e.g. gaza,lebanon) | all origins | no |
| groupBy | enum | Group results by: category or origin | category | no |
| category | string | Filter by specific alert type (exact match) | - | no |
| limit | integer | Number of categories to return (1-100) | 50 | no |
| offset | integer | Number of results to skip for pagination | 0 | no |
| sort | enum | Sort results by field: count or label | count | no |
| order | enum | Sort direction: asc or desc | desc | no |
Example Requests
Full distribution of all alert types, sorted by count
bash
1GET https://sirenapi.orielhaim.com/stats/distribution
Response Structure
Data
| Field | Type | Description |
|---|---|---|
| data[].label | string | Category name or origin name (depends on groupBy) |
| data[].count | number | Total number of alerts for this group |
Meta & Pagination
| Field | Type | Description |
|---|---|---|
| totalAlerts | number | Sum of all counts in the current result - useful for calculating percentages client-side |
| pagination.total | number | Total number of distinct categories matching the filters |
| pagination.limit | number | Requested limit |
| pagination.offset | number | Requested offset |
| pagination.hasMore | boolean | Whether more results are available |
Example Responses
GET https://sirenapi.orielhaim.com/stats/distribution - default grouping by category
json
1{2 "data": [3 {4 "label": "missiles",5 "count": 125006 },7 {8 "label": "hostileAircraftIntrusion",9 "count": 32010 },11 {12 "label": "earthQuake",13 "count": 514 }15 ],16 "totalAlerts": 12825,17 "pagination": {18 "total": 3,19 "limit": 50,20 "offset": 0,21 "hasMore": false22 }23}