Documentation
Summary Statistics
High-level overview of the alert system. By default returns core counts and unique city/zone numbers. Use the include parameter to opt-in to top cities, top zones, a time-series timeline, and peak-hour detection - perfect for building dashboards with a single API call.
Returns aggregated alert statistics with optional sections
Query Parameters
| Parameter | Type | Description | Default | Required |
|---|---|---|---|---|
| startDate | ISO 8601 | Filter data from this date onwards | all time | no |
| endDate | ISO 8601 | Filter data until this date | now | no |
| origin | string | Filter by alert origin(s), comma-separated (e.g. gaza,lebanon) | all origins | no |
| include | string | Comma-separated optional sections: topCities, topZones, topOrigins, timeline, peak | - (none) | no |
| topLimit | integer | Number of items in topCities / topZones (1-50) | 5 | no |
| timelineGroup | enum | Grouping interval for timeline: hour, day, week, or month | day | no |
The include Parameter
Each value adds an optional section to the response. Combine multiple with commas: include=topCities,timeline,peak. Only requested sections are computed - keeping the default response fast.
| Value | Fields Added | Use Case | Controlled By |
|---|---|---|---|
| topCities | topCities[] - city, zone, count | Leaderboard of most targeted cities | topLimit |
| topZones | topZones[] - zone, count | Regional breakdown | topLimit |
| timeline | timeline[] - period, count | Charts and time-series graphs | timelineGroup |
| peak | peak - period, count | Identify the busiest hour in range | - |
| topOrigins | topOrigins[] - origin, count | Breakdown by alert origin / threat source | topLimit |
Timeline Grouping Formats
When using include=timeline, the timelineGroup parameter controls the bucket size and the format of the period field.
| timelineGroup | Period Format | Recommended For |
|---|---|---|
| hour | 2024-12-01T14:00:00Z | Hourly buckets - best for short ranges (1-7 days) |
| day | 2024-12-01 | Daily buckets - best for weeks to months |
| week | 2024-W48 | Weekly buckets - best for months to a year |
| month | 2024-12 | Monthly buckets - best for long-term trends |
Example Requests
Core stats only - totals, unique cities and zones
1GET https://sirenapi.orielhaim.com/stats/summary
Response Structure
Always included
| Field | Type | Description |
|---|---|---|
| totals.range | number | Total alerts in the requested date range (or all time) |
| totals.last24h | number | Alerts in the last 24 hours |
| totals.last7d | number | Alerts in the last 7 days |
| totals.last30d | number | Alerts in the last 30 days |
| uniqueCities | number | Number of distinct cities with alerts in range |
| uniqueZones | number | Number of distinct zones with alerts in range |
| uniqueOrigins | number | Number of distinct alert origins in range |
Optional - requires include
| Field | Type | Description | include |
|---|---|---|---|
| topCities[].city | string | City name | topCities |
| topCities[].zone | string | Zone the city belongs to | topCities |
| topCities[].count | number | Alert count for this city | topCities |
| topZones[].zone | string | Zone name | topZones |
| topZones[].count | number | Alert count for this zone | topZones |
| timeline[].period | string | Time bucket label (format depends on timelineGroup) | timeline |
| timeline[].count | number | Alert count in this period | timeline |
| peak.period | string | The peak hour (ISO format) | peak |
| peak.count | number | Alert count during the peak hour | peak |
| topOrigins[].origin | string | Origin name (e.g. gaza, lebanon) | topOrigins |
| topOrigins[].count | number | Alert count from this origin | topOrigins |
Example Responses
GET https://sirenapi.orielhaim.com/stats/summary - no include, fastest possible response
1{2 "totals": {3 "range": 284500,4 "last24h": 312,5 "last7d": 2840,6 "last30d": 124007 },8 "uniqueCities": 1580,9 "uniqueZones": 4210}