A wrapper library for Pikud Haoref's unofficial rocket alert API (aka Home Front Command).

Usage no npm install needed!

<script type="module">
  import pikudHaorefApi from 'https://cdn.skypack.dev/pikud-haoref-api';



npm version

A Node.js wrapper library for Pikud Haoref's unofficial rocket alert API. It allows you to easily query for the active rocket alert cities in Israel.

Note: This API is only accessible from within Israel. Either run the script on an Israeli machine, or use a proxy.


First, install the package using npm:

npm install pikud-haoref-api --save

Then, use the following code to poll for the currently-active rocket alert cities:

var pikudHaoref = require('pikud-haoref-api');

// Set polling interval in millis
var interval = 5000;

// Define polling function
var poll = function () {
    // Optional Israeli proxy if running outside Israeli borders
    var options = {
        proxy: 'http://user:pass@hostname:port/'

    // Get currently active rocket alert cities as an array
    // Example response: ["תל אביב - מזרח", "חיפה - כרמל ועיר תחתית", "עין גדי"]
    pikudHaoref.getActiveRocketAlertCities(function (err, alertCities) {
        // Schedule polling in X millis
        setTimeout(poll, interval);
        // Log errors
        if (err) {
            return console.log('Retrieving active rocket alert cities failed: ', err);
        // Alert cities header
        console.log('Currently active rocket alert cities:');
        // Log the alert cities (if any)
        // Line break for readability
    }, options);

// Start polling for active alert cities


  • Node.js v4.2.x+ for ES6's for-of loop support


Apache 2.0