Torify — Japanese Locale APIs for AI Agents について
Torifyは、日本固有のロケール情報や行政データを扱うAPIサービスです。日本向けの検証や変換を必要とするAIエージェントやアプリケーション向けに、日付、住所、金融、識別情報、テキストなどのエンドポイントを提供します。
主な機能
- 01和暦変換と祝日関連の処理
- 02請求書番号や識別子の検証
- 03郵便番号検索と住所正規化
- 04銀行・振込データの処理
- 05日本語テキストと名前の処理
活用シーン
- 01西暦の日付を和暦に変換
- 02入力された日本の住所を正規化
- 03請求書番号、電話番号、IDを検証
- 04銀行や支店の情報を検索
MCP 対応
Torifyは、日本向けロケールAPIをHTTP MCPサーバー経由で対応クライアントに公開します。READMEには、IPあたり1日100リクエストの無料枠が記載されています。
設定
リモートサーバーはインストール不要です。クライアントを選んで設定をコピーするか、ワンクリックで導入できます。
https://torify-mcp.torify.workers.devclaude mcp add --transport http torify-examples https://torify-mcp.torify.workers.dev{"mcpServers":{"torify-examples":{"type":"http","url":"https://torify-mcp.torify.workers.dev"}}}Cursor で開く{"servers":{"torify-examples":{"type":"http","url":"https://torify-mcp.torify.workers.dev"}}}VS Code で開く{"mcpServers":{"torify-examples":{"type":"http","url":"https://torify-mcp.torify.workers.dev"}}}{"mcpServers":{"torify-examples":{"serverUrl":"https://torify-mcp.torify.workers.dev"}}}コマンドはターミナルで実行し、JSON は各クライアントの MCP 設定に貼り付けて再起動します。認可が必要なサーバーは初回接続時にログインを求めます。
ツール
詳細
torify-examples
Torify のコード例 — AI エージェント向けの日本語ロケール API です。
和暦、インボイス検証、法人検索、住所正規化、銀行・支店検索(全銀データベース全件 — 1,152 機関)、法定休日(労働基準法)、学校コードなどに対応する 40 のエンドポイントを提供します。
掲載先
- Smithery — https://smithery.ai/servers/endenibrk/torify(スコア 100/100)
- MCP.so — https://mcp.so/server/torify-%E2%80%94-japanese-locale-apis-for-ai-agents/hiroki-sonoda
- Anthropic Official MCP Registry — https://registry.modelcontextprotocol.io/v0/servers/dev.torify/japanese-locale-mcp
- Cursor MCP Directory — https://cursor.directory/mcp (審査待ち)
- Cline MCP Marketplace — https://github.com/cline/mcp-marketplace/issues/1603 (Issue #1603 · 審査待ち)
- x402scan — https://www.x402scan.com
- a2aregistry.org — https://a2aregistry.org
料金
| プラン | 料金 | 上限 | 認証方法 |
|---|---|---|---|
| Free Trial | 無料 | 月 100 回 | X-Trial-Key(メール登録) |
| MCP | 無料 | 1 日 100 リクエスト/IP | 認証なし |
| x402 | $0.02/回 | 無制限 | X-PAYMENT ヘッダー(Base L2 上の USDC) |
| Pro | $49/月 | 月 10,000 回 | X-API-Key |
| Enterprise | $499/月 | 月 1,000,000 回(公正利用) | X-API-Key + 優先サポート + SLA |
無料トライアルキーを取得する
curl -X POST https://torify.dev/v1/trial/signup \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]"}'
# { "ok": true, "data": { "trialKey": "tk_..." } }
返されたキーを X-Trial-Key ヘッダーとして使用します。上限は月 100 回で、毎月リセットされます。
curl -H "X-Trial-Key: tk_..." \
"https://torify.dev/v1/wareki/convert?direction=g2w&date=2024-05-01"
クイックスタート
無料プラン(MCP — ウォレット・登録不要)
claude_desktop_config.json に追加します。
{
"mcpServers": {
"torify": {
"type": "http",
"url": "https://torify-mcp.torify.workers.dev"
}
}
}
1 日 100 リクエスト/IPまで無料です。Claude Desktop と Cursor で動作します。
x402 従量課金(Base L2 上で 1 回あたり $0.02 USDC)
npm install x402-fetch viem
export PRIVATE_KEY="0x..."
npx ts-node typescript/x402-example.ts
API キーのサブスクリプション(Pro は $49/月、Enterprise は $499/月)
Polar から登録すると、API キーがメールで届きます。
- Pro ($49/月): https://buy.polar.sh/polar_cl_N7Q6P6X3TMOlv9TqaGHrbqzviFnnmSuICsTdT06N2LW
- Enterprise ($499/月): https://buy.polar.sh/polar_cl_mWV5CA7nv6rfR0aGM1H7HJjmgVLJGXBCKeHre05RvHe
export TORIFY_API_KEY="your-key"
npx ts-node typescript/apikey-example.ts
使用例
和暦変換
# Gregorian → Wareki
curl "https://torify.dev/v1/wareki/convert?direction=g2w&date=2024-05-01"
# { "ok": true, "data": { "era": "令和", "eraYear": 6, "formatted": "令和6年5月1日" } }
# Wareki → Gregorian (edge case: Showa ended Jan 7, 1989; Heisei started Jan 8, 1989)
curl "https://torify.dev/v1/wareki/convert?direction=w2g&era=showa&eraYear=64&month=1&day=7"
# { "ok": true, "data": { "gregorian": "1989-01-07" } }
インボイス番号の検証
# Format + check digit validation (no payment needed)
curl "https://torify.dev/v1/invoice/validate?number=T7000012050002"
# { "ok": true, "data": { "valid": true } }
ステータス:国税庁レジストリとの連携は、外部 API の承認待ちです。近日対応予定です。
# NTA registry lookup — is this T-number actually registered?
curl "https://torify.dev/v1/invoice/verify?number=T1180301018771" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "registered": true, "registrantName": "トヨタ自動車株式会社", "confidence": 0.99 } }
法人番号の検索
ステータス:法人番号の検索は、外部 API の承認待ちです。近日対応予定です。
curl "https://torify.dev/v1/houjin/lookup?number=7000012050002" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "name": "国税庁", "address": "東京都千代田区霞が関3丁目1番1号", "status": "active" } }
郵便番号検索
curl "https://torify.dev/v1/postal/lookup?zipcode=1000013"
# { "ok": true, "data": { "prefecture": "東京都", "city": "千代田区", "town": "霞が関" } }
電話番号の検証
# Tokyo (2-digit area code 03)
curl "https://torify.dev/v1/phone/validate?phone=03-1234-5678"
# { "ok": true, "data": { "valid": true, "type": "landline", "region": "東京" } }
# Rural (4-digit area code 0266)
curl "https://torify.dev/v1/phone/validate?phone=0266-12-3456"
# { "ok": true, "data": { "valid": true, "type": "landline", "region": "長野" } }
住所の正規化
レスポンススキーマ(v0.3.0 以降)
{
prefecture: string | null,
city: string | null,
town: string | null,
streetNumber: string | null,
streetNumberHyphen: string | null,
streetNumberFormal: string | null,
addressType: 'block' | 'street' | 'rural' | 'other', // NEW: first-class enum
streetRef: { // NEW: Kyoto intersection
intersection: string;
direction: '上る' | '下る' | '東入' | '西入' | null;
} | null,
addressee: string | null, // NEW: 様方/気付/c/o separated
}
例
| 入力 | addressType | streetRef | addressee | 備考 |
|---|---|---|---|---|
| 東京都千代田区霞が関3丁目1番1号 | block | null | null | 通常住所 |
| 京都府京都市中京区烏丸通三条上る場之町 | street | {"direction": "上る", "intersection": "烏丸通三条上る"} | null | 京都の通り名 |
| 東京都港区赤坂2-3-4 山田様方 | block | null | "山田" | 方書 |
| 東京都港区赤坂二丁目 | block | null | null | 漢数字 1-99 → アラビア数字に自動変換 |
# 通常住所 (block)
curl "https://torify.dev/v1/address/normalize" \
--get --data-urlencode "address=東京都千代田区霞が関3丁目1番1号" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "prefecture": "東京都", "city": "千代田区", "town": "霞が関",
# "addressType": "block", "streetRef": null, "addressee": null } }
# 京都通り名 (street + streetRef populated)
curl "https://torify.dev/v1/address/normalize" \
--get --data-urlencode "address=京都府京都市中京区烏丸通三条上る場之町" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "prefecture": "京都府", "city": "京都市中京区",
# "addressType": "street",
# "streetRef": { "intersection": "烏丸通三条上る", "direction": "上る" },
# "addressee": null } }
# 方書 — addressee 分離
curl "https://torify.dev/v1/address/normalize" \
--get --data-urlencode "address=東京都港区赤坂2-3-4 山田様方" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "prefecture": "東京都", "city": "港区", "town": "赤坂",
# "addressType": "block", "streetRef": null, "addressee": "山田" } }
# 漢数字 → Arabic 自動変換
curl "https://torify.dev/v1/address/normalize" \
--get --data-urlencode "address=東京都港区赤坂二丁目" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "prefecture": "東京都", "city": "港区", "town": "赤坂2丁目",
# "addressType": "block", "streetRef": null, "addressee": null } }
銀行の検索・一覧(全銀データベース全件、1,150 以上の銀行)
# Look up by bank code + branch code
curl "https://torify.dev/v1/bank/lookup?bankCode=0001&branchCode=001" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "bankName": "みずほ銀行", "bankNameEn": "Mizuho Bank",
# "branchName": "東京営業部", "found": true, "branchFound": true } }
# Search banks by partial name (kanji / kana / romaji)
curl "https://torify.dev/v1/bank/search" --get --data-urlencode "name=みずほ" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "mode": "bank", "hits": [...], "total": 2 } }
# Search branches within a specific bank
curl "https://torify.dev/v1/bank/search?bankCode=0001" --get --data-urlencode "name=東京" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "mode": "branch", "hits": [...] } }
# Paginated full bank list
curl "https://torify.dev/v1/bank/list?limit=5" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "total": 1152, "banks": [...] } }
銀行振込の検証(全銀フォーマット)
curl "https://torify.dev/v1/bank/transfer/validate?bankCode=0001&branchCode=001&accountType=1&accountNumber=1234567" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "valid": true, "accountTypeName": "普通", "isYucho": false } }
法定休日の確認(労働基準法第 35 条)
# Standard 5-day work week (Sun = legal holiday, Sat = non-legal rest day)
curl "https://torify.dev/v1/legal-holiday/check?date=2024-05-05&restDays=sun,sat" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "isLegalHoliday": true, "overtimePremiumRate": 0.35,
# "overtimePremiumRateLegalNonHoliday": 0.25,
# "legalReference": "Labor Standards Act Article 35 (労働基準法第35条)" } }
文部科学省の学校コード検証(13 文字)
curl "https://torify.dev/v1/school-code/validate?code=B213123456X00" \
-H "X-API-Key: $TORIFY_API_KEY"
# { "ok": true, "data": { "valid": true, "schoolType": "elementary",
# "establishment": "public_prefectural", "prefectureJa": "東京都" } }
自分の IP アドレス(無料、認証不要)
curl "https://torify.dev/v1/whoami"
# { "ok": true, "data": { "ip": "...", "country": "JP", "userAgent": "..." } }
x402 を使用した TypeScript(自律型決済)
import { wrapFetchWithPayment } from "x402-fetch";
import { createWalletClient, http } from "viem";
import { base } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";
const wallet = createWalletClient({
account: privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`),
chain: base,
transport: http()
});
const fetch402 = wrapFetchWithPayment(fetch, wallet);
// Agent pays $0.02 USDC automatically — no API key needed
const res = await fetch402("https://torify.dev/v1/invoice/verify?number=T1180301018771");
const { ok, data } = await res.json();
console.log(data.registered, data.confidence); // true, 0.99
API キーを使用した Python
import os, requests
headers = {"X-API-Key": os.environ["TORIFY_API_KEY"]}
r = requests.get(
"https://torify.dev/v1/address/normalize",
params={"address": "東京都千代田区霞が関3丁目1番1号"},
headers=headers
)
data = r.json()["data"]
print(data["prefecture"], data["city"], data["town"])
# 東京都 千代田区 霞が関
すべてのエンドポイント
ドキュメント全文:torify.dev/docs
全40エンドポイント(有料:1回あたり$0.02、MCP / whoamiは無料):
| カテゴリー | エンドポイント |
|---|---|
| 時代・日付 | wareki/convert, holiday/check, age/calculate, legal-holiday/check |
| 法務・税務 | invoice/validate, invoice/verify, tax/calculate, eltax/check (POST), freelance/order/validate (POST) |
| 企業 | houjin/lookup, industry/lookup |
| 住所 | postal/lookup, address/normalize, region/lookup, coordinate/convert |
| 地理 | geo/geocode (住所 → GSI経由の緯度/経度、PDL 1.0), geo/reverse-geocode (緯度/経度 → GSI経由の自治体+町域、PDL 1.0) |
| 法令検索 | law/search (e-Gov API v2経由の日本の法令検索、政府標準利用規約) |
| テキスト | name/romanize, name/split, name/validate, kana/convert, text/normalize, kanji/to-kana (Cloudflare Workers AI、Llama 3.3 70B), kanji/normalize (POST) |
| 金融 | bank/lookup, bank/search, bank/list, bank/transfer/validate, yucho/convert, payment/3ds/check |
| 本人確認 | mynumber/validate, passport/validate, insurance/validate, plate/validate, barcode/validate, phone/validate |
| 教育 | school-code/validate |
| 診断 | whoami(無料、認証不要) |
| 一括処理 | wareki/convert/bulk, invoice/validate/bulk, invoice/verify/bulk(最大300件), tax/calculate/bulk(最大1000件) |
ライセンス
MIT — サンプルのみが対象です。Torify APIサービスはプロプライエタリです。
最終更新日:2026-05-27
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。