Torify API Docs
36 Japanese locale endpoints for AI agents · $0.02/call · torify.dev
Per-endpoint detail pages:
wareki-convert ·
invoice-verify ·
bank-lookup ·
houjin-lookup ·
postal-lookup
· legal-holiday-check
· school-code-validate
· (all 36 endpoints have individual docs at /docs/{slug})
Overview
Torify handles Japan-specific data that AI agents routinely need but cannot reliably compute on their own: era-calendar conversion (Meiji through Reiwa), invoice number validation against the NTA registry, corporate lookup by legal entity number, postal-code address resolution, Japanese name parsing and romanization, bank-code lookup, and more.
All 36 endpoints return structured JSON with optional confidence scores so your agent knows how authoritative each answer is. No Japanese locale knowledge required on your side — just call the API and parse the result.
Three access methods are available, depending on your use case:
- MCP — plug-and-play with Claude Desktop or Claude Code, free tier included.
- x402 — pay per call in USDC on Base L2, no subscription needed.
- API Key — monthly flat-rate plan for production workloads.
/health, /openapi.json, /llms.txt,
/.well-known/*) are always free and require no authentication.
All /v1/* endpoints require one of the three methods below in production.
Quick Start
Option A: MCP — Free tier, zero setup
Add the Torify MCP server to Claude Desktop or Claude Code CLI. No API key, no wallet, no signup required.
Claude Desktop — edit ~/.config/claude/claude_desktop_config.json:
{
"mcpServers": {
"torify": {
"transport": {
"type": "http",
"url": "https://torify-mcp.torify.workers.dev"
}
}
}
}
Claude Code CLI:
claude mcp add torify --transport http https://torify-mcp.torify.workers.dev
Then just ask Claude naturally:
"Convert 2019-05-01 to Japanese era"
"Is 2026-01-01 a Japanese public holiday?"
"Look up postal code 1000001"
Claude will call Torify automatically and return a structured answer. Free tier: 100 requests/day/IP.
Option B: x402 — Pay per call ($0.02/call USDC on Base L2)
Call any /v1/* endpoint without a subscription. The server returns HTTP 402 with
payment instructions; you sign and retry with an X-PAYMENT header.
Compatible wallets: Coinbase CDP, any EIP-1193 wallet on Base.
Step 1 — Call the endpoint, receive the 402 payment instructions:
curl 'https://torify.dev/v1/wareki/convert?direction=g2w&date=2019-05-01'
# HTTP 402 response:
{
"x402Version": 1,
"error": "Payment required",
"accepts": [{
"scheme": "exact",
"network": "base",
"maxAmountRequired": "0.02",
"asset": "USDC",
"payTo": "0x...",
"extra": { "name": "Torify Japanese Era Conversion" }
}]
}
Step 2+3 — Pay and call in one shot using the x402-fetch TypeScript SDK:
import { wrapFetchWithPayment } from 'x402-fetch';
import { createWalletClient } from 'viem';
// ... configure your Base wallet
const fetch402 = wrapFetchWithPayment(fetch, wallet);
const res = await fetch402(
'https://torify.dev/v1/wareki/convert?direction=g2w&date=2019-05-01'
);
const data = await res.json();
// { ok: true, data: { era: "令和", eraYear: 1, ... } }
wrapFetchWithPayment handles the 402 flow automatically: it reads the accepts array,
signs a micropayment on Base, and retries the request with the X-PAYMENT header.
Option C: API Key — Monthly flat rate
Best for production agents with predictable call volumes. Pass your key in the X-API-Key header.
curl -H "X-API-Key: YOUR_KEY" 'https://torify.dev/v1/wareki/convert?direction=g2w&date=2019-05-01'
Plans:
| Plan | Price | Requests |
|---|---|---|
| Pro | $49/mo | Unlimited (fair use) |
| Enterprise | $499/mo | Unlimited + priority support + SLA |
To get a key, email contact@torify.dev with your intended use case.
Authentication
| Method | How | Limit | Price |
|---|---|---|---|
| MCP | Claude Desktop / Claude Code — no headers needed | 100 req/day/IP | Free |
| x402 | X-PAYMENT header (USDC on Base L2) |
Unlimited | $0.02/call |
| API Key | X-API-Key: YOUR_KEY header |
Per plan | $49/mo or $499/mo |
/health, /openapi.json, /llms.txt,
/.well-known/agent.json, /v1/invoice/validate/bulk.
All other /v1/* endpoints require authentication in production.
Endpoints
Era & Calendar
| Param | Type | Required | Description |
|---|---|---|---|
direction | g2w | w2g | Yes | Gregorian-to-wareki or wareki-to-Gregorian |
date | YYYY-MM-DD | For g2w | Input date (Gregorian) |
era | string | For w2g | Era name in kanji, e.g. 令和 |
eraYear | int | For w2g | Year within the era |
month | int | No | Month (1–12) |
day | int | No | Day (1–31) |
curl 'https://torify.dev/v1/wareki/convert?direction=g2w&date=2019-05-01'
{
"ok": true,
"data": {
"gregorian": "2019-05-01",
"era": "令和",
"eraYear": 1,
"eraYearKanji": "元",
"formatted": "令和元年5月1日"
}
}
| Param | Type | Required | Description |
|---|---|---|---|
date | YYYY-MM-DD | Yes* | Date to check |
year | YYYY | Yes* | Return full holiday list for the year |
* Provide either date or year.
curl 'https://torify.dev/v1/holiday/check?date=2026-01-01'
{
"ok": true,
"data": {
"date": "2026-01-01",
"isHoliday": true,
"name": "元日",
"type": "fixed"
}
}
| Param | Type | Required | Description |
|---|---|---|---|
birthdate | YYYY-MM-DD | Yes | Date of birth |
asOf | YYYY-MM-DD | No | Reference date (defaults to today) |
curl 'https://torify.dev/v1/age/calculate?birthdate=1990-04-02'
{
"ok": true,
"data": {
"age": 36,
"schoolYear": "昭和65年度生→平成3年度入学",
"eraAge": "昭和65年生まれ"
}
}
Invoice & Tax
| Param | Type | Required | Description |
|---|---|---|---|
number | string | Yes | Invoice number (T + 13 digits) |
curl 'https://torify.dev/v1/invoice/validate?number=T8010401050783'
{
"ok": true,
"data": {
"valid": true,
"normalized": "T8010401050783",
"houjinBangou": "8010401050783"
}
}
| Param | Type | Required | Description |
|---|---|---|---|
number | string | Yes | Invoice number (T + 13 digits) |
curl 'https://torify.dev/v1/invoice/verify?number=T8010401050783'
{
"ok": true,
"data": {
"registered": true,
"confidence": 0.99,
"verified_at": "2026-05-08T00:00:00Z",
"registrantName": "○○株式会社",
"source": "nta_invoice_kohyo"
},
"meta": {
"disclaimer": "Data from NTA public registry; may lag by 1 business day."
}
}
| Body field | Type | Required | Description |
|---|---|---|---|
numbers | string[] | Yes | Array of invoice numbers (max 100) |
curl -X POST https://torify.dev/v1/invoice/validate/bulk -H 'Content-Type: application/json' -d '{"numbers":["T8010401050783","T1234567890123"]}'
| Param | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Pre-tax amount in JPY |
rate | standard | reduced | No | Tax rate (default: standard) |
rounding | floor | ceil | round | No | Rounding method (default: floor) |
curl 'https://torify.dev/v1/tax/calculate?amount=1000&rate=standard'
{
"ok": true,
"data": {
"amount": 1000,
"tax": 100,
"total": 1100,
"rate": 0.1,
"rateLabel": "標準税率"
}
}
| Body field | Type | Required | Description |
|---|---|---|---|
type | invoice | receipt | contract | other | Yes | Document type |
format | pdf | jpeg | png | xml | tiff | other | No | File format (optional) |
curl -X POST 'https://torify.dev/v1/eltax/check' -H 'Content-Type: application/json' -d '{"type":"invoice","format":"pdf"}'
Corporate & Business
| Param | Type | Required | Description |
|---|---|---|---|
number | string | Yes | 13-digit corporate number |
curl 'https://torify.dev/v1/houjin/lookup?number=8010401050783'
{
"ok": true,
"data": {
"number": "8010401050783",
"name": "○○株式会社",
"address": "東京都千代田区...",
"status": "active",
"confidence": 0.99,
"verified_at": "2026-05-08T00:00:00Z"
}
}
| Param | Type | Required | Description |
|---|---|---|---|
code | string | Yes | JSIC code, e.g. G55 |
curl 'https://torify.dev/v1/industry/lookup?code=G55'
Address & Location
| Param | Type | Required | Description |
|---|---|---|---|
zipcode | string | Yes | 7-digit code or NNN-NNNN format |
all | boolean | No | Return all matching towns when ambiguous |
curl 'https://torify.dev/v1/postal/lookup?zipcode=1000001'
{
"ok": true,
"data": {
"zipcode": "1000001",
"prefecture": "東京都",
"city": "千代田区",
"town": "千代田"
}
}
| Param | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Raw Japanese address string |
curl 'https://torify.dev/v1/address/normalize?address=東京都千代田区千代田1-1'
| Param | Type | Required | Description |
|---|---|---|---|
code | string | Yes | 2-digit prefecture or 5-digit municipality code |
curl 'https://torify.dev/v1/region/lookup?code=13'
| Param | Type | Required | Description |
|---|---|---|---|
lat | float | Yes | Latitude in decimal degrees |
lng | float | Yes | Longitude in decimal degrees |
direction | wgs2jgd | jgd2wgs | Yes | Conversion direction |
curl 'https://torify.dev/v1/coordinate/convert?lat=35.6895&lng=139.6917&direction=wgs2jgd'
Name & Text
| Param | Type | Required | Description |
|---|---|---|---|
name | string (kana) | Yes | Name in hiragana or katakana |
order | family-first | given-first | No | Word order (default: family-first) |
curl 'https://torify.dev/v1/name/romanize?name=すずき%20いちろう'
{
"ok": true,
"data": {
"romaji": "SUZUKI ICHIRO",
"order": "family-first"
}
}
| Param | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Full name in kanji or kana |
curl 'https://torify.dev/v1/name/split?name=山田太郎'
{
"ok": true,
"data": {
"original": "山田太郎",
"family": "山田",
"given": "太郎",
"confidence": 0.85,
"method": "dictionary"
}
}
| Param | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name to validate |
curl 'https://torify.dev/v1/name/validate?name=山田太郎'
| Param | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Input text |
to | katakana | hiragana | half-katakana | Yes | Target script |
curl 'https://torify.dev/v1/kana/convert?text=アイウエオ&to=hiragana'
{
"ok": true,
"data": {
"original": "アイウエオ",
"converted": "あいうえお",
"from": "katakana",
"to": "hiragana"
}
}
| Param | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Input text |
mode | nfkc | ascii-narrow | ascii-wide | Yes | Normalization mode |
curl 'https://torify.dev/v1/text/normalize?text=ABCD&mode=ascii-narrow'
YAHOO_APP_ID to be configured on the server.
| Param | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Input text containing kanji |
output | hiragana | katakana | No | Output script (default: hiragana) |
curl 'https://torify.dev/v1/kanji/to-kana?text=東京都'
| Body field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text containing variant kanji |
curl -X POST 'https://torify.dev/v1/kanji/normalize' -H 'Content-Type: application/json' -d '{"text":"髙橋"}'
Finance & Payment
| Param | Type | Required | Description |
|---|---|---|---|
bankCode | string | Yes | 4-digit Zengin bank code |
branchCode | string | No | 3-digit branch code |
curl 'https://torify.dev/v1/bank/lookup?bankCode=0001&branchCode=001'
{
"ok": true,
"data": {
"bankCode": "0001",
"bankName": "みずほ銀行",
"bankNameEn": "Mizuho Bank",
"bankKana": "ミズホ",
"branchCode": "001",
"branchName": "東京営業部",
"branchKana": "トウキヨウエイギヨウブ",
"found": true,
"branchFound": true
}
}
bankCode is omitted, searches across all 1,150+ banks. When set, searches only that bank's branches.
| Param | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Partial name (1-50 chars, case-insensitive) |
bankCode | string | No | 4-digit bank code (enables branch-mode search) |
limit | integer | No | Max hits (1-100, default 20) |
curl 'https://torify.dev/v1/bank/search?name=みずほ'
{
"ok": true,
"data": {
"query": "みずほ",
"mode": "bank",
"hits": [
{ "bankCode": "0001", "bankName": "みずほ銀行", "bankKana": "ミズホ", "matchedField": "bankName" },
{ "bankCode": "0288", "bankName": "みずほ信託銀行", "bankKana": "ミズホシンタク", "matchedField": "bankName" }
],
"total": 2,
"truncated": false
}
}
| Param | Type | Required | Description |
|---|---|---|---|
offset | integer | No | Pagination offset (default 0) |
limit | integer | No | Page size (1-500, default 200) |
curl 'https://torify.dev/v1/bank/list?limit=5'
{
"ok": true,
"data": {
"total": 1152,
"banks": [
{ "code": "0001", "name": "みずほ銀行", "kana": "ミズホ", "roma": "mizuho", "branchCount": 467 }
]
}
}
| Param | Type | Required | Description |
|---|---|---|---|
bankCode | string | Yes | 4-digit Zengin bank code |
branchCode | string | No | 3-digit branch code |
accountType | 普通 | 当座 | 貯蓄 | Yes | Account type in Japanese |
accountNumber | string | Yes | Account number (up to 7 digits) |
curl 'https://torify.dev/v1/bank/transfer/validate?bankCode=0001&branchCode=001&accountType=普通&accountNumber=1234567'
| Param | Type | Required | Description |
|---|---|---|---|
kigo | string | Yes | 5-digit account symbol (記号) |
bango | string | Yes | 8-digit account number (番号) |
curl 'https://torify.dev/v1/yucho/convert?kigo=10010&bango=12345671'
| Param | Type | Required | Description |
|---|---|---|---|
merchantCategory | string | Yes | 4-digit Merchant Category Code |
binNumber | string | Yes | 6-digit card BIN (Bank Identification Number) |
curl 'https://torify.dev/v1/payment/3ds/check?merchantCategory=5411&binNumber=411111'
Identity & Compliance
| Param | Type | Required | Description |
|---|---|---|---|
number | string | Yes | 12-digit Individual Number |
curl 'https://torify.dev/v1/mynumber/validate?number=123456789012'
| Param | Type | Required | Description |
|---|---|---|---|
number | string | Yes | Passport number string |
curl 'https://torify.dev/v1/passport/validate?number=AB1234567'
| Param | Type | Required | Description |
|---|---|---|---|
number | string | Yes | 12-digit license number |
curl 'https://torify.dev/v1/license/validate?number=123456789012'
| Param | Type | Required | Description |
|---|---|---|---|
number | string | Yes | Social insurance number |
curl 'https://torify.dev/v1/insurance/validate?number=12345678901'
| Param | Type | Required | Description |
|---|---|---|---|
plate | string | Yes | License plate string or VIN |
curl 'https://torify.dev/v1/plate/validate?plate=品川500あ1234'
| Param | Type | Required | Description |
|---|---|---|---|
code | string | Yes | 13-digit JAN / EAN-13 / ISBN-13 barcode |
curl 'https://torify.dev/v1/barcode/validate?code=4901234567894'
| Param | Type | Required | Description |
|---|---|---|---|
phone | string | Yes | Phone number in any common format |
curl 'https://torify.dev/v1/phone/validate?phone=03-1234-5678'
{
"ok": true,
"data": {
"input": "03-1234-5678",
"e164": "+81312345678",
"areaCode": "03",
"type": "fixed"
}
}
Response Format
All endpoints wrap their payload in a consistent ApiResponse<T> envelope,
making it easy to write generic error handling in your agent.
Success
{
"ok": true,
"data": {
// endpoint-specific fields
},
"meta": {
"source": "nta_invoice_kohyo",
"note": "Data refreshed daily at 09:00 JST."
}
}
Error
{
"ok": false,
"error": {
"code": "MISSING_PARAM",
"message": "Query parameter 'number' is required."
}
}
Confidence Scores
Some endpoints include a confidence field (0–1) so your agent can decide
how much weight to place on the result:
Errors
| HTTP Status | Error Code | Meaning |
|---|---|---|
400 |
MISSING_PARAM |
A required query parameter is absent |
400 |
INVALID_FORMAT |
Input value does not match the expected format |
402 |
— | Payment required — see x402 response body for accepts array |
429 |
— | Rate limit exceeded (MCP free tier: 100 req/day/IP) |
502 |
UPSTREAM_ERROR |
External API (NTA, Yahoo! JLP, Japan Post) unreachable or timed out |
Contact & Support
Questions, enterprise pricing, or custom integrations: contact@torify.dev
OpenAPI spec (machine-readable): /openapi.json
LLM-readable capabilities: /llms.txt
Agent discovery: /.well-known/agent.json
Listed on
x402scan · Smithery · Glama · MCP.so · Anthropic MCP Registry
Legal
Privacy Policy · Terms of Service · Cookie Policy · 特商法に基づく表記