Japan School Code (MEXT) Validation API

Japan's Ministry of Education assigns a 13-character code to every school. Useful for HR systems handling academic history. Torify validates and decomposes into type (elementary/middle/high/university), establishment (national/public/private), and prefecture.

Endpoint

GET https://torify.dev/v1/school-code/validate

Parameters

NameTypeRequiredDescriptionExample
code string Yes 13-character MEXT school code B213123456X00

Response example

{ "ok": true, "data": { "valid": true, "schoolTypeJa": "小学校", "prefectureJa": "東京都" } }

Code examples

curl

curl "https://torify.dev/v1/school-code/validate?code=B213123456X00"

TypeScript (x402-fetch)

import { wrapFetchWithPayment } from 'x402-fetch';
import { privateKeyToAccount } from 'viem/accounts';

const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const fetchWithPayment = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPayment(
  'https://torify.dev/v1/school-code/validate?code=B213123456X00'
);
const data = await res.json();
console.log(data); // { ok: true, data: { ... } }

Python (requests)

import requests

# Free MCP tier (no auth) or API key (X-API-Key header)
res = requests.get(
    "https://torify.dev/v1/school-code/validate?code=B213123456X00",
    headers={"X-API-Key": "your_torify_pro_key"}
)
print(res.json())

Related endpoints

← All 36 endpoints

Pricing

$0.02 per call via x402 (USDC on Base). Or use a Pro API key ($49/mo, 10,000 calls/month).