Docs
API & receipt spec
One endpoint, one JSON document back. The response is the signed receipt.
POST /api/v1/check
Body: {"text": "…"} — UTF-8, 5 to 20,000 characters. No key needed on the free tier.
curl -X POST https://proof.sapir861.com/api/v1/check \
-H "content-type: application/json" \
-d '{"text":"See Roe v. Wade, 410 U.S. 113 (1973)."}'| Status | Meaning |
|---|---|
| 200 | Receipt: {body, sig, digest, log} |
| 400 | Text missing, too short or over 20,000 characters |
| 429 | rate_limited (burst) or monthly_limit — free tier is 100 citations per month per network |
Response header x-proofkit-remaining shows the free citations left this month. Pro and Team plans get an API key with higher limits.
Receipt fields
| Field | Description |
|---|---|
body.spec | sapir-receipt/1 |
body.kind | citation-check |
body.ts | ISO-8601 UTC time of the check |
body.input_sha256 | SHA-256 of the exact input text (prove which text was checked without storing it) |
body.checker | Method and source used |
body.results[] | cite, name, verdict, note, source, opinion, matched_case |
verdict | verified · mismatch (real cite, different case) · not_found · ambiguous · exists_name_unchecked · unverifiable · unchecked |
body.summary | total, verified, flagged |
body.key | Signing public key (Ed25519, JWK x) |
sig | Ed25519 signature (base64url) over the canonical JSON of body |
digest | SHA-256 hex of the canonical JSON of body |
log | Position n and chain hash in the public transparency log |
Canonical JSON: object keys sorted, no whitespace, standard JSON string escaping, undefined fields dropped.
Verification
- Serialize
bodycanonically. - SHA-256 must equal
digest. - Ed25519-verify
sigover the same bytes with the key from /.well-known/proofkit-pubkey; it must equalbody.key.x.
import { readFileSync } from "node:fs"; // node verify.mjs receipt.json (Node 20+)
const r = JSON.parse(readFileSync(process.argv[2] || "receipt.json", "utf8"));
const canon = o => o === null || typeof o !== "object" ? JSON.stringify(o) : Array.isArray(o) ? "[" + o.map(canon).join(",") + "]"
: "{" + Object.keys(o).sort().filter(k => o[k] !== undefined).map(k => JSON.stringify(k) + ":" + canon(o[k])).join(",") + "}";
const msg = new TextEncoder().encode(canon(r.body));
const hex = Buffer.from(await crypto.subtle.digest("SHA-256", msg)).toString("hex");
const pub = (await (await fetch("https://proof.sapir861.com/.well-known/proofkit-pubkey")).json()).jwk;
const key = await crypto.subtle.importKey("jwk", pub, { name: "Ed25519" }, false, ["verify"]);
const ok = await crypto.subtle.verify({ name: "Ed25519" }, key, Buffer.from(r.sig, "base64url"), msg);
console.log(ok && hex === r.digest && pub.x === r.body.key.x ? "VALID" : "INVALID");# pip install cryptography ; python verify.py receipt.json
import json, sys, base64, hashlib, urllib.request
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
r = json.load(open(sys.argv[1] if len(sys.argv) > 1 else "receipt.json", encoding="utf-8"))
b64 = lambda s: base64.urlsafe_b64decode(s + "=" * (-len(s) % 4))
msg = json.dumps(r["body"], sort_keys=True, separators=(",", ":"), ensure_ascii=False).encode()
pub = json.load(urllib.request.urlopen("https://proof.sapir861.com/.well-known/proofkit-pubkey"))["jwk"]
try:
Ed25519PublicKey.from_public_bytes(b64(pub["x"])).verify(b64(r["sig"]), msg)
ok = hashlib.sha256(msg).hexdigest() == r["digest"] and pub["x"] == r["body"]["key"]["x"]
except Exception: ok = False
print("VALID" if ok else "INVALID")No install: open https://proof.sapir861.com/verify and paste receipt.json.
Verification runs locally in your browser (WebCrypto Ed25519). Nothing is uploaded.Limits — read before relying on it
- Coverage: US case law in CourtListener. Some state and older reporters are incomplete.
- Westlaw (WL), Lexis and public-domain citations cannot be checked against an open database — marked
unverifiable. - Name match is token-based (≥ 0.5). Very short or unusual case names can produce
mismatchfor a real case — always open the source link. - We verify existence and identity of the case, not whether it supports the argument.