🇵🇸 Free Palestine 🇵🇸

API Documentation

Base URL: /api

Breaking changes coming in the future: for now the API is open to every requests, but tokens will eventually be required.
Once the new version of the API is available, the current API will be phased out over 30 days.
To be kept up-to-date, listen for the deprecated key in the JSON response or the Deprecation header; or send us your email address: select "Other" and specify that you want API updates (we adhere to the GDPR).

GET /convert

Convert the current Gregorian date to the corresponding Lenorian date using the UTC timezone

Response

{
  "status": 200,
  "message": "OK",
  "ok": true,
  "body": {
    "timezone": "utc",
    "year": {
      "value": 0,
      "leapYear": true,
      "totalDays": 366
    },
    "month": {
      "index": 8,
      "name": "November",
      "value": 9
    },
    "monthDay": {
      "index": 21,
      "value": 22
    },
    "weekday": {
      "index": 1,
      "name": "Veneday"
    },
    "shortDate": "0000-09-22",
    "fullDate": "Veneday, 22 November 0",
    "holiday": "Universal Declaration of Human Rights Day",
    "yearDay": 265
  }
}

Optional query parameters

Field Type Format Description
gdate Date YYYY-MM-DD Convert a Gregorian date to a Lenorian date; always uses UTC
time Integer Unix time Convert an Unix timestamp (in seconds) to a Lenorian date
offset Integer Switch to local time by specifying the timezone offset (in minutes) from UTC

Response body fields details

Field Type Range Value Format
timezone String utc / local
year.value Integer [ -∞ ; ∞ ]
year.leapYear Boolean
year.totalDays Integer 365 or 366
month.index Integer [ 0 ; 11 ]
month.value Integer [ 1 ; 12 ]
month.name String
monthDay.index Integer [ 0 ; 30 ]
monthDay.value Integer [ 1 ; 31 ]
weekDay.index Integer [ 0 ; 7 ]
weekDay.name String
shortDate String YYYY-MM-DD
fullDate String weekday day month year
holiday String
yearDay Integer [ 0 ; 365 ]

GET /calendar

Generate the Lenorian calendar for the current Lenorian year

Response

{
  "status": 200,
  "message": "OK",
  "ok": true,
  "body": {
    "year": {
      "value": 0,
      "leapYear": true,
      "totalDays": 366
    },
    "months": [
      // ...
      {
        "month": {
          "index": 8,
          "name": "November",
          "value": 9,
          "current": true
        },
        "monthDays": [
          // ...
          {
            "day": {
              "index": 21,
              "value": 22,
              "current": true,
              "holiday": "Universal Declaration of Human Rights Day"
            },
            "weekday": {
              "index": 1,
              "name": "Veneday"
            }
          },
          // ...
        ]
      },
      // ...
    ]
  }
}

Optional query parameter

Field Type Format Description
year Integer Generate the Lenorian calendar for the specified Lenorian year

Response body fields details

Field Type Range / Value Description
year.value Integer [ -∞ ; ∞ ]
year.leapYear Boolean
year.totalDays Integer 365 or 366
months Array months.length equals 12
  month.index Integer [ 0 ; 11 ]
  month.value Integer [ 1 ; 12 ]
  month.name String
  month.current Boolean Highlight the current month when applicable (UTC)
  monthDays Array monthDays.length equals 30 or 31
    day.index Integer [ 0 ; 30 ]
    day.value Integer [ 1 ; 31 ]
    day.current Boolean Highlight the current day when applicable (UTC)
    day.holiday String
    weekday.index Integer [ 0 ; 7 ]
    weekday.name String