← ソース一覧

Japan Business Calendar

内閣府の国民の祝日 CSV を正とする祝日一覧と営業日計算。

Japanese national holidays and business-day calculations derived from the Cabinet Office official CSV. Returns holidays for a given year, plus business-day arithmetic used by invoicing, logistics and HR systems in Japan.

支払い方法(x402)

まず普通に GET すると 402 Payment RequiredPAYMENT-REQUIRED ヘッダが返ります。そこに載っている金額・受取先・ ネットワークで支払いを署名し、同じリクエストに PAYMENT-SIGNATURE を付けて再送するとデータが返ります。課金されるのは 2xx のときだけで、 4xx / 5xx は課金されません。エンドポイントは GET のみです。

エンドポイント(4)

GET /v1/jp-biz-calendar/holidays

List Japanese national holidays for a year

引数要否説明
yearinteger必須Calendar year (Gregorian). Accepted range is 1955-2100, but only years covered by the upstream Cabinet Office CSV can be answered; years outside the covered range return 404 and are not charged.2026

サンプル(未払いで叩くと 402 が返ります):

curl -i "https://torii-gateway-staging.ichis-lab.workers.dev/v1/jp-biz-calendar/holidays?year=2026"

GET /v1/jp-biz-calendar/is-business-day

Tell whether a given date is a Japanese business day

引数要否説明
datestring必須Date to check, in YYYY-MM-DD (ISO 8601 calendar date, interpreted in UTC). Dates outside the years covered by the upstream CSV return 404 and are not charged.2026-01-05

サンプル(未払いで叩くと 402 が返ります):

curl -i "https://torii-gateway-staging.ichis-lab.workers.dev/v1/jp-biz-calendar/is-business-day?date=2026-01-05"

GET /v1/jp-biz-calendar/add-business-days

Add or subtract business days from a given date

引数要否説明
datestring必須Base date, in YYYY-MM-DD (ISO 8601 calendar date, interpreted in UTC). Results outside the years covered by the upstream CSV return 404 and are not charged.2026-01-05
ninteger必須Business days to add; negative goes backwards. 0 returns the base date if it is a business day, else the next one (never the previous). From a non-business base date, n=1 lands on the same day as n=0.5

サンプル(未払いで叩くと 402 が返ります):

curl -i "https://torii-gateway-staging.ichis-lab.workers.dev/v1/jp-biz-calendar/add-business-days?date=2026-01-05&n=5"

GET /v1/jp-biz-calendar/wareki

Convert a Gregorian date to the Japanese imperial era (wareki)

引数要否説明
datestring必須Date to convert, in YYYY-MM-DD (UTC). Must be between 1873-01-01 (when Japan adopted the Gregorian calendar) and 2100-12-31; dates outside that range return 400, uncharged.2026-01-05

サンプル(未払いで叩くと 402 が返ります):

curl -i "https://torii-gateway-staging.ichis-lab.workers.dev/v1/jp-biz-calendar/wareki?date=2026-01-05"

無料枠(オプトイン)

10 回/日(ip_hash 単位) まで無料で試せます。既定では常に 402 が返るので、?free=1X-Torii-Free: 1 ヘッダで明示的にオプトインしてください。 使い切ると通常どおり有料アクセス(402)に戻ります。

curl -i "https://torii-gateway-staging.ichis-lab.workers.dev/v1/jp-biz-calendar/holidays?year=2026&free=1"

出典とライセンス

再配布・二次利用の際は次の表記が必要です:

出典:内閣府ウェブサイト(https://www8.cao.go.jp/chosei/shukujitsu/gaiyou.html)を加工して作成

利用規約: https://www.cao.go.jp/notice/rule.html

プライバシー(収集項目と保持期間)

このサービスは Cookie・JavaScript・広告や解析のタグを使いません。呼び出しごとに記録するのは次の項目だけです。

呼び出しごとに保存するもの(課金・不正利用対策のため)

保持期間

基盤(Cloudflare)側に残るもの

Cloudflare Workers のログには、リクエストごとにURL・パス・クエリ文字列・メソッドとリクエスト ID が 7 日間残ります。IP アドレスやリクエストヘッダは自動では記録しない設定にしています(エラー診断の文字列に、不正な形式の支払いヘッダの短い断片が含まれることはあります)。決済が失敗して再試行になった場合は、診断のためブロックチェーン上のトランザクションハッシュが同じログに含まれることがあります(ブロックチェーン上で公開される情報です)。クエリ文字列に秘密や個人情報を入れないでください(このサービスの引数は日付・年・件数などの公開値だけです)。

第三者への送信

支払いの検証と決済のため、PAYMENT-SIGNATURE ヘッダの内容(署名と支払元アドレス)と、支払い条件(エンドポイントの URL(クエリ文字列を除く)・金額・ネットワーク・受取先)は決済検証サービス(facilitator)に送られます。取得したデータの中身や上記の記録は送りません。