shogo82148 / holidays-jp

Simple API that provides public holidays information in Japan

Home Page:https://holidays-jp.shogo82148.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

holidays-jp

Simple API that provides public holidays information in Japan.

Synopsis

List holidays in a year

GET /{year} lists holidays in a year.

Example: list holidays in 2021.

curl https://holidays-jp.shogo82148.com/2021 | jq .
{
  "holidays": [
    {
      "date": "2021-01-01",
      "name": "元日"
    },
    {
      "date": "2021-01-11",
      "name": "成人の日"
    },
    {
      "date": "2021-02-11",
      "name": "建国記念の日"
    },
(snip)
    {
      "date": "2021-11-23",
      "name": "勤労感謝の日"
    }
  ]
}

List holidays in a month

GET /{year}/{month} lists holidays in a year.

Example: list holidays in January 2021.

curl https://holidays-jp.shogo82148.com/2021/01 | jq .
{
  "holidays": [
    {
      "date": "2021-01-01",
      "name": "元日"
    },
    {
      "date": "2021-01-11",
      "name": "成人の日"
    }
  ]
}

List holidays in a range

GET /holidays?from={2006-01-02}&to={2006-01-02} lists holidays in the range.

Example: list holidays in January 2021.

curl 'https://holidays-jp.shogo82148.com/holidays?from=2021-01-01&to=2021-01-31' | jq .
{
  "holidays": [
    {
      "date": "2021-01-01",
      "name": "元日"
    },
    {
      "date": "2021-01-11",
      "name": "成人の日"
    }
  ]
}

Check whether the day is a holiday

GET /{year}/{month}/{day} returns whether the day is a holiday.

Example: January 1st, 2021 was a holiday. The api returns information about the holiday.

curl https://holidays-jp.shogo82148.com/2021/01/01 | jq .
{
  "holidays": [
    {
      "date": "2021-01-01",
      "name": "元日"
    }
  ]
}

Example: February 1st, 2021 was not a holiday. The api returns an empty list in this case.

curl https://holidays-jp.shogo82148.com/2021/02/01 | jq .
{
  "holidays": []
}

Data Sources

References

About

Simple API that provides public holidays information in Japan

https://holidays-jp.shogo82148.com/

License:MIT License


Languages

Language:Go 99.1%Language:Makefile 0.9%