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

ParameterTypeDescriptionDefaultRequired
startDateISO 8601Filter alerts from this date onwardsall timeno
endDateISO 8601Filter alerts until this datenowno
originstringFilter by alert origin(s), comma-separated (e.g. gaza,lebanon)all originsno
groupByenumGroup results by: category or origincategoryno
categorystringFilter by specific alert type (exact match)-no
limitintegerNumber of categories to return (1-100)50no
offsetintegerNumber of results to skip for pagination0no
sortenumSort results by field: count or labelcountno
orderenumSort direction: asc or descdescno

Example Requests

Full distribution of all alert types, sorted by count

bash
1GET https://sirenapi.orielhaim.com/stats/distribution

Response Structure

Data

FieldTypeDescription
data[].labelstringCategory name or origin name (depends on groupBy)
data[].countnumberTotal number of alerts for this group

Meta & Pagination

FieldTypeDescription
totalAlertsnumberSum of all counts in the current result - useful for calculating percentages client-side
pagination.totalnumberTotal number of distinct categories matching the filters
pagination.limitnumberRequested limit
pagination.offsetnumberRequested offset
pagination.hasMorebooleanWhether 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": 12500
6 },
7 {
8 "label": "hostileAircraftIntrusion",
9 "count": 320
10 },
11 {
12 "label": "earthQuake",
13 "count": 5
14 }
15 ],
16 "totalAlerts": 12825,
17 "pagination": {
18 "total": 3,
19 "limit": 50,
20 "offset": 0,
21 "hasMore": false
22 }
23}