{
 "openapi": "3.1.0",
 "info": {
  "title": "Nayeret Israeli dates API",
  "version": "1.0",
  "description": "Exact Israeli calendar facts for agents: Hebrew dates, holidays as kept in Israel, official rest days and business days, school closures, deadline arithmetic (Interpretation Law s.10), Hebrew anniversaries and Shabbat times. Each answer says how sure it is (status) and where it comes from (sources). Free, no key, read-only.",
  "contact": {
   "url": "https://nayeret.ai/developers/dates/"
  }
 },
 "servers": [
  {
   "url": "https://nayeret.ai/api/v1/calendar"
  }
 ],
 "paths": {
  "/today": {
   "get": {
    "summary": "Now in Israel",
    "description": "Israel time, the civil date, and the Hebrew date in force (after sunset: the next one), with the full day status.",
    "parameters": [
     {
      "name": "city",
      "in": "query",
      "required": false,
      "description": "City id for times (default jerusalem)",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON with answer_he, answer_en, status and sources"
     },
     "400": {
      "description": "Invalid parameter"
     }
    }
   }
  },
  "/day/{date}": {
   "get": {
    "summary": "One day",
    "parameters": [
     {
      "name": "date",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      }
     },
     {
      "name": "city",
      "in": "query",
      "required": false,
      "description": "City id: adds candle lighting / havdalah / sunrise / sunset",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Hebrew date, events, parasha, rest day, business day, school closure"
     }
    }
   }
  },
  "/holidays": {
   "get": {
    "summary": "Holidays of a year",
    "parameters": [
     {
      "name": "year",
      "in": "query",
      "required": false,
      "description": "Gregorian year 1900-2200",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "hebrew_year",
      "in": "query",
      "required": false,
      "description": "Hebrew year 5660-5960",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "include",
      "in": "query",
      "required": false,
      "description": "main (default) or all (adds rosh chodesh, chol hamoed, each Chanukah candle)",
      "schema": {
       "type": "string",
       "enum": [
        "main",
        "all"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON with answer_he, answer_en, status and sources"
     },
     "400": {
      "description": "Invalid parameter"
     }
    }
   }
  },
  "/next/{event}": {
   "get": {
    "summary": "Next occurrences of a holiday",
    "parameters": [
     {
      "name": "event",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "rh1",
        "rh2",
        "gedaliah",
        "erev-yk",
        "yk",
        "erev-sukkot",
        "sukkot",
        "sukkot-chm",
        "hoshana-raba",
        "shmini-atzeret",
        "oct7",
        "zeevi",
        "aliyah-school",
        "rabin",
        "sigd",
        "ben-gurion",
        "chanukah",
        "chanukah8",
        "hebrew-lang",
        "tevet10",
        "tubishvat",
        "family",
        "purim-katan",
        "shushan-katan",
        "esther",
        "erev-purim",
        "purim",
        "shushan",
        "aliyah",
        "bechorot",
        "erev-pesach",
        "pesach",
        "pesach-chm",
        "pesach7",
        "shoah",
        "zikaron",
        "atzmaut",
        "herzl",
        "pesach-sheni",
        "lagbaomer",
        "yerushalayim",
        "erev-shavuot",
        "shavuot",
        "tammuz17",
        "jabotinsky",
        "erev-av",
        "av9",
        "tubeav",
        "erev-rh",
        "rc"
       ]
      }
     },
     {
      "name": "after",
      "in": "query",
      "required": false,
      "description": "YYYY-MM-DD (default today in Israel)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "count",
      "in": "query",
      "required": false,
      "description": "1-20 (default 3)",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Dates"
     }
    }
   }
  },
  "/convert": {
   "get": {
    "summary": "Hebrew <-> Gregorian",
    "parameters": [
     {
      "name": "date",
      "in": "query",
      "required": false,
      "description": "Gregorian YYYY-MM-DD",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "after_sunset",
      "in": "query",
      "required": false,
      "description": "true if the moment was after sunset",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "hebrew",
      "in": "query",
      "required": false,
      "description": "YEAR-MONTH-DAY, months Nisan=1 ... Tishrei=7 ... Adar=12 (Adar I in a leap year), Adar II=13",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON with answer_he, answer_en, status and sources"
     },
     "400": {
      "description": "Invalid parameter"
     }
    }
   }
  },
  "/business-days": {
   "get": {
    "summary": "Count Israeli business days",
    "description": "Sunday-Thursday, inclusive, excluding official / statutory rest days.",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": true,
      "description": "YYYY-MM-DD",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "description": "YYYY-MM-DD",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON with answer_he, answer_en, status and sources"
     },
     "400": {
      "description": "Invalid parameter"
     }
    }
   }
  },
  "/add": {
   "get": {
    "summary": "Deadline arithmetic",
    "description": "Interpretation Law 1981 s.10: start day not counted; month periods end on the same day number; a period whose last day is a rest day ends on the next day that is not.",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": true,
      "description": "YYYY-MM-DD",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "amount",
      "in": "query",
      "required": true,
      "description": "Integer",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "unit",
      "in": "query",
      "required": false,
      "description": "days | business_days | weeks | months | years",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "roll",
      "in": "query",
      "required": false,
      "description": "interpretation-law (default) or none",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON with answer_he, answer_en, status and sources"
     },
     "400": {
      "description": "Invalid parameter"
     }
    }
   }
  },
  "/anniversary": {
   "get": {
    "summary": "Hebrew birthday / yahrzeit / bar or bat mitzvah",
    "parameters": [
     {
      "name": "type",
      "in": "query",
      "required": true,
      "description": "birthday | yahrzeit | bar_mitzvah | bat_mitzvah",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "date",
      "in": "query",
      "required": true,
      "description": "Gregorian date of birth or death",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "after_sunset",
      "in": "query",
      "required": false,
      "description": "true if after sunset",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "List birthdays / yahrzeits on or after this date (default today in Israel)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "years",
      "in": "query",
      "required": false,
      "description": "1-50 (default 5)",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "adar",
      "in": "query",
      "required": false,
      "description": "adar1 (default) or adar2: yahrzeit of a death in Adar of a common year, in a leap year",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON with answer_he, answer_en, status and sources"
     },
     "400": {
      "description": "Invalid parameter"
     }
    }
   }
  },
  "/zmanim": {
   "get": {
    "summary": "Shabbat and day times",
    "parameters": [
     {
      "name": "date",
      "in": "query",
      "required": true,
      "description": "YYYY-MM-DD",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "city",
      "in": "query",
      "required": false,
      "description": "City id (default jerusalem)",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "JSON with answer_he, answer_en, status and sources"
     },
     "400": {
      "description": "Invalid parameter"
     }
    }
   }
  },
  "/cities": {
   "get": {
    "summary": "City ids",
    "parameters": [],
    "responses": {
     "200": {
      "description": "JSON with answer_he, answer_en, status and sources"
     },
     "400": {
      "description": "Invalid parameter"
     }
    }
   }
  },
  "/feed/holidays.ics": {
   "get": {
    "summary": "Subscribable calendar: holidays in Israel (rolling 2 years)",
    "parameters": [],
    "responses": {
     "200": {
      "description": "JSON with answer_he, answer_en, status and sources"
     },
     "400": {
      "description": "Invalid parameter"
     }
    }
   }
  },
  "/feed/school.ics": {
   "get": {
    "summary": "Subscribable calendar: school closures (Ministry of Education)",
    "parameters": [],
    "responses": {
     "200": {
      "description": "JSON with answer_he, answer_en, status and sources"
     },
     "400": {
      "description": "Invalid parameter"
     }
    }
   }
  },
  "/feed/business/{type}.ics": {
   "get": {
    "summary": "Subscribable calendar: reporting and payment deadlines of an Israeli business (VAT, income tax advances, withholding 102, National Insurance, annual reports) for the next 12 months, the same dates as /tools/business-calendar/",
    "parameters": [
     {
      "name": "type",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "patur",
        "murshe",
        "company"
       ]
      }
     },
     {
      "name": "vat",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "1",
        "2"
       ]
      },
      "description": "VAT period: 1 monthly, 2 bimonthly (default 2)"
     },
     {
      "name": "adv",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "1",
        "2",
        "none"
       ]
      },
      "description": "income tax advances: monthly, bimonthly or none (default 1)"
     },
     {
      "name": "emp",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "0",
        "1"
       ]
      },
      "description": "1 = has employees (withholding 102, National Insurance, 106, 126)"
     },
     {
      "name": "wh",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "1",
        "2"
       ]
      },
      "description": "withholding period with employees (default 1)"
     },
     {
      "name": "detailed",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "0",
        "1"
       ]
      },
      "description": "1 = files the detailed VAT report (PCN874)"
     },
     {
      "name": "micro",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "0",
        "1"
       ]
      },
      "description": "osek patur in the micro business track"
     },
     {
      "name": "alarm",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "maximum": 7
      },
      "description": "reminder N days before (default 2, 0 = none)"
     }
    ],
    "responses": {
     "200": {
      "description": "text/calendar"
     }
    }
   }
  },
  "/feed/shabbat/{city}.ics": {
   "get": {
    "summary": "Subscribable calendar: candle lighting and havdalah for a city (rolling year)",
    "parameters": [
     {
      "name": "city",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "text/calendar"
     }
    }
   }
  }
 }
}