Pikud HaOref GraphQL API
March 30, 2026 · View on GitHub
This GraphQL API provides access to alerts data related to Pikud HaOref red alerts history.
Usage
You can interact with this API by sending GraphQL queries to the provided endpoint.
Endpoint
Live Query URL: https://pikud-haoref-graphql-api.tuval-simha.workers.dev/graphql
This API is powered by Cloudflare Workers for global edge deployment with low latency.
Example Queries
Get alerts from today
query AlertsToday {
alerts(filter: { timeRange: TODAY }, first: 10) {
edges {
node {
category
date
location
title
}
cursor
}
pageInfo {
hasNextPage
endCursor
}
totalCount
}
}
Get alerts from last week
query AlertsLastWeek {
alerts(filter: { timeRange: LAST_WEEK, orderBy: CREATED_AT_DESC }, first: 10) {
edges {
node {
category
date
location
title
}
cursor
}
pageInfo {
hasNextPage
endCursor
}
totalCount
}
}
Get alerts from last month
query AlertsLastMonth {
alerts(filter: { timeRange: LAST_MONTH }, first: 10) {
edges {
node {
category
date
location
title
}
cursor
}
pageInfo {
hasNextPage
endCursor
}
totalCount
}
}
Get alerts by custom date range
Date format: DD/MM/YYYY
query AlertsByDateRange {
alerts(filter: { dateRange: { from: "01/01/2024", to: "31/01/2024" } }, first: 10) {
edges {
node {
category
date
location
title
}
cursor
}
pageInfo {
hasNextPage
endCursor
}
totalCount
}
}
Filter by category and location
query MissileAlertsInTelAviv {
alerts(
filter: {
timeRange: LAST_WEEK,
category: MISSILES,
location: "תל אביב"
},
first: 10
) {
edges {
node {
category
date
location
title
}
}
totalCount
}
}
Pagination
Pagination is supported using cursor-based pagination:
first- Number of items to return per pageafter- Cursor to start paginating from (useendCursorfrom previous response)totalCount- Returns the total number of alerts matching your filter (before pagination)
Filtering
Time Range
Use the timeRange filter for predefined ranges:
TODAY- Alerts from today onlyLAST_WEEK- Alerts from the last 7 daysLAST_MONTH- Alerts from the last 30 days
Or use dateRange with custom dates in DD/MM/YYYY format.
Category
Filter by alert category using the category filter:
MISSILES- Missile and rocket alertsUAV_INTRUSION- Drone intrusionEARTHQUAKE- Earthquake warningRADIOLOGICAL_EVENT- Radiological eventTSUNAMI- Tsunami warningHAZARDOUS_MATERIALS- Hazardous materials incidentTERRORIST_INFILTRATION- Terrorist infiltration alert
Drill categories:
DRILL_MISSILESDRILL_GENERALDRILL_EARTHQUAKEDRILL_RADIOLOGICAL_EVENTDRILL_TSUNAMIDRILL_UAV_INTRUSIONDRILL_HAZARDOUS_MATERIALSDRILL_TERRORIST_INFILTRATION
Location
Filter by location name using the location filter. Supports partial match and is case-insensitive.
Example: location: "תל אביב" or location: "חיפה"
Sorting
Use orderBy to sort results:
CREATED_AT_DESC- Newest first (default)CREATED_AT_ASC- Oldest first
Legacy Queries (Deprecated)
The following queries are still supported for backwards compatibility but are deprecated. Use the unified alerts query instead.
allAlertsFromToday
query AllAlertsFromToday {
allAlertsFromToday(orderBy: CREATED_AT_DESC, typeBy: MISSILES, first: 10) {
edges {
node {
category
date
location
title
}
}
}
}
allAlertsFromLastWeek
query AllAlertsFromLastWeek {
allAlertsFromLastWeek(orderBy: CREATED_AT_DESC, typeBy: MISSILES, first: 10) {
edges {
node {
category
date
location
title
}
}
}
}
allAlertsFromLastMonth
query AllAlertsFromLastMonth {
allAlertsFromLastMonth(orderBy: CREATED_AT_DESC, first: 10) {
edges {
node {
category
date
location
title
}
}
}
}
allAlertsByDateRange
Date format: DD.MM.YYYY
query AllAlertsByDateRange {
allAlertsByDateRange(
dates: { fromDateTime: "01.01.2024", toDateTime: "31.01.2024" },
first: 10
) {
edges {
node {
category
date
location
title
}
}
}
}
Contributing
This repository is open-source, and contributions are welcome! If you'd like to contribute, please fork the repository, make your changes, and submit a pull request. Appreciate your help in improving this project!
If you find this project helpful and would like to support its development, consider buying me a coffee:
