An Unofficial SDK for Pikud HaOref's API
April 8, 2026 ยท View on GitHub
This is an unofficial Go library for interacting with Pikud HaOref (Home Front Command) API. It provides access to real-time alerts, historical alerts, and Israeli city data.
Note
This code will work only when running it from inside Israel (or via proxy)
Installation
go get github.com/5c077m4n/pikud-haoref-api-go
Packages
History
The history package fetches historical alerts from Pikud HaOref. It provides
two modes of operation:
- Fetch: Retrieve all historical alerts at once
- Stream: Polls for updates continuously
import "github.com/5c077m4n/pikud-haoref-api-go/history"
Functions:
FetchAlerts(ctx context.Context)- Fetches all historical alertsStream(ctx context.Context)- Returns a channel that streams alerts
Cities
The cities package provides access to Israeli city data, including city names,
area information, and bunker access times.
import "github.com/5c077m4n/pikud-haoref-api-go/cities"
Functions:
FetchCities(ctx context.Context)- Returns all cities with metadata (name, area, bunker time)
Alerts (Deprecated)
The alerts package is deprecated. Use history instead.
import "github.com/5c077m4n/pikud-haoref-api-go/alerts"
Functions:
FetchAlert(ctx context.Context)- Fetch current alert
Examples
- Cities - Fetch all of Israel's city names (using cache)
- History Fetch - Fetch historical alerts once
- History Stream - Fetch a stream of historical alerts