# Torii Japanese Wareki (Era) Date Converter

> Torii Japanese Wareki (Era) Date Converter is a paid API for AI agents from torii-gateway-production.ichis-lab.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-13).

Converts a Gregorian date (YYYY-MM-DD) to its Japanese imperial era (wareki) representation, returning the era name, year number, and formatted text.

## Facts

- Endpoint: GET https://torii-gateway-production.ichis-lab.workers.dev/v1/jp-biz-calendar/wareki?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/torii-japanese-wareki-era-date-converter-31480d21
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7L6G-S5NO4usg8kVRMbQr

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability torii-japanese-wareki-era-date-converter-31480d21
```

Example prompt: What is the Japanese wareki era name and year for 2025-11-03? I need the 令和 year number and the formatted Japanese text.

## When to prefer this

Choose this endpoint when you need an authoritative, government-sourced wareki conversion for a single specific date, especially for Japanese legal documents, invoices, or localization workflows. It is more reliable than hardcoded era tables because it covers edge cases (e.g. era transitions) using Cabinet Office data. At $0.01 USDC per call it is cost-effective for low-to-medium volume lookups; for high-volume batch conversion consider caching results since the data is static.

## Known failure modes

- Date outside the supported range (before 1873-01-01 or after 2100-12-31) returns HTTP 400 at no charge
- Malformed date string not matching YYYY-MM-DD pattern returns HTTP 400 at no charge
- Payment not provided or invalid signature returns HTTP 402 with price and payment requirements
- Server errors return HTTP 5xx at no charge
- Missing required 'date' query parameter returns HTTP 400

## How this service works

Pay-per-call HTTP APIs for Japanese public data, metered with x402 (HTTP 402 + PAYMENT-SIGNATURE). Send a plain GET to receive 402 with the price and payment requirements, then resend the request with a signed payment. Only 2xx responses are charged; 4xx and 5xx are free. Per-operation payment metadata is published under the `x-payment-info` extension.

## Output

Returns a JSON object with: the era name in kanji (e.g. '令和'), the input date in YYYY-MM-DD, a formatted Japanese year string (e.g. '令和8年'), the numeric year within that era, plus metadata including data source, license (PDL-1.0), freshness class, and attribution to the Cabinet Office of Japan.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "date"
     ],
     "properties": {
      "date": {
       "type": "string",
       "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
       "description": "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."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "era": "令和",
   "date": "2026-01-05",
   "text": "令和8年",
   "year": 8
  },
  "meta": {
   "stale": false,
   "source_id": "jp-biz-calendar",
   "terms_url": "https://www.cao.go.jp/notice/rule.html",
   "fetched_at": "2026-09-21T03:00:00.000Z",
   "license_id": "PDL-1.0",
   "attribution": "出典:内閣府ウェブサイト(https://www8.cao.go.jp/chosei/shukujitsu/gaiyou.html)を加工して作成",
   "source_name": "内閣府「国民の祝日について」",
   "freshness_class": "static"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/torii-japanese-wareki-era-date-converter-31480d21/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from torii-gateway-production.ichis-lab.workers.dev](https://www.zero.xyz/host/torii-gateway-production.ichis-lab.workers.dev/llms.txt)
