Documentation
History Statistics
Retrieve detailed historical records of alerts with full city data. Each alert includes the list of cities that were targeted simultaneously. By default, only city IDs and names are returned - use the include parameter to add translations and coordinates as needed.
Returns paginated alert history with nested city data
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 |
| limit | integer | Number of alerts to return (1-1000) | 20 | no |
| offset | integer | Number of results to skip for pagination | 0 | no |
| cityId | integer | Filter by city ID (exact match) | - | no |
| cityName | string | Filter by city name in Hebrew (exact match) | - | no |
| search | string | Search by city name (partial match, 1-100 chars) | - | no |
| category | string | Filter by alert type (e.g. missiles, drones, earthquakes) | - | no |
| origin | string | Filter by alert origin(s), comma-separated (e.g. gaza,lebanon) | all origins | no |
| sort | enum | Sort results by field: timestamp, type, or origin | timestamp | no |
| order | enum | Sort direction: asc or desc | desc | no |
| include | string | Comma-separated optional fields: translations, coords, polygons | - (none) | no |
The include Parameter
By default, each city in the cities array only contains id and name. Use include to opt-in to additional fields. This significantly reduces response size when you don't need translations or coordinates.
| Value | Fields Added to Each City | Use Case |
|---|---|---|
| translations | translations.name (en, ru, ar) | Multi-language alert feeds |
| coords | lat, lng | Plotting alerts on a map |
| polygons | polygons (GeoJSON) | City boundary / shape on map |
City Filter Priority
Three parameters filter by city: cityId, cityName, and search. Only one is applied at a time, in this priority order:
Example Requests
Latest 20 alerts - minimal response
1GET https://sirenapi.orielhaim.com/stats/history
Response Structure
Always included
| Field | Type | Description |
|---|---|---|
| data[].id | number | Unique alert ID |
| data[].timestamp | string | ISO 8601 timestamp of the alert |
| data[].type | string | Alert category (e.g. missiles) |
| data[].origin | string | null | Alert origin / threat source (e.g. gaza, lebanon) |
| data[].cities[].id | number | City ID |
| data[].cities[].name | string | City name in Hebrew |
Optional - requires include
| Field | Type | Description | include |
|---|---|---|---|
| data[].cities[].translations | object | Translated name in en, ru, ar | translations |
| data[].cities[].lat | number | Latitude coordinate | coords |
| data[].cities[].lng | number | Longitude coordinate | coords |
| data[].cities[].polygons | object | GeoJSON polygon for city boundary | polygons |
Pagination
| Field | Type | Description |
|---|---|---|
| pagination.total | number | Total number of matching alerts |
| 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/history?limit=2 - no include, lean response
1{2 "data": [3 {4 "id": 10523,5 "timestamp": "2023-11-15T14:30:00.000Z",6 "type": "missiles",7 "origin": "gaza",8 "cities": [9 {10 "id": 45,11 "name": "תל אביב - יפו"12 },13 {14 "id": 46,15 "name": "רמת גן"16 }17 ]18 },19 {20 "id": 10522,21 "timestamp": "2023-11-15T14:25:00.000Z",22 "type": "missiles",23 "origin": "gaza",24 "cities": [25 {26 "id": 12,27 "name": "אשדוד"28 }29 ]30 }31 ],32 "pagination": {33 "total": 5420,34 "limit": 2,35 "offset": 0,36 "hasMore": true37 }38}