Documentation

Cities Statistics

Get a breakdown of alerts by city. By default, responses are lean - only city name, zone, and count. Use the include parameter to opt-in to extra fields like translations and coordinates, keeping bandwidth low when you don't need them.

GEThttps://sirenapi.orielhaim.com/stats/cities

Returns paginated city alert statistics

Query Parameters

ParameterTypeDescriptionDefaultRequired
startDateISO 8601Filter alerts from this date onwardsall timeno
endDateISO 8601Filter alerts until this datenowno
limitintegerNumber of cities to return (1-500)10no
offsetintegerNumber of results to skip for pagination0no
originstringFilter by alert origin(s), comma-separated (e.g. gaza,lebanon)all originsno
searchstringSearch by city name (partial match, 1-100 chars)-no
zonestringFilter by zone/region name (exact match)-no
sortenumSort results by field: count, city, or zonecountno
orderenumSort direction: asc or descdescno
includestringComma-separated list of optional fields: translations, coords, polygons- (none)no

The include Parameter

By default the response only contains city, cityZone, and count. Additional fields must be explicitly requested via the include parameter to minimize response size and database load.

ValueFields AddedUse Case~Size Impact
translationstranslations.name, translations.zone (en, ru, ar)Multi-language UIs+~200 bytes/city
coordslat, lngMap rendering+~30 bytes/city
polygonspolygons (GeoJSON)City boundary / shape on mapvaries

Example Requests

Top 5 cities by alert count - minimal response, no extra fields

bash
1GET https://sirenapi.orielhaim.com/stats/cities?limit=5

Response Structure

Always included

FieldTypeDescription
data[].citystringCity name in Hebrew
data[].cityZonestringZone/region the city belongs to
data[].countnumberTotal number of alerts for this city

Optional - requires include

FieldTypeDescriptioninclude
data[].translationsobjectTranslated name & zone in en, ru, artranslations
data[].latnumberLatitude coordinatecoords
data[].lngnumberLongitude coordinatecoords
data[].polygonsobjectGeoJSON polygon for city boundarypolygons

Pagination

FieldTypeDescription
pagination.totalnumberTotal number of matching cities
pagination.limitnumberRequested limit
pagination.offsetnumberRequested offset
pagination.hasMorebooleanWhether more results are available

Example Responses

GET https://sirenapi.orielhaim.com/stats/cities?limit=2 - no include, smallest possible response

json
1{
2 "data": [
3 {
4 "city": "אזור",
5 "cityZone": "דן",
6 "count": 1269
7 },
8 {
9 "city": "בית דגן",
10 "cityZone": "השפלה",
11 "count": 1268
12 }
13 ],
14 "pagination": {
15 "total": 1580,
16 "limit": 2,
17 "offset": 0,
18 "hasMore": true
19 }
20}