Time-travel
Every law has a git-style history of commits. You can fetch the full text of any law at any past revision by its SHA. No other legal API ships this — use it to compare versions, diff clauses, or surface "as of X date" views in your product.
How it works
Behind the scenes, every law lives in a git repository — one per country — where each reform is a commit that modifies the law's Markdown. That repo is public (legalize-es, legalize-fr, etc.) — you could clone it. The API is the convenience layer: SHAs are surfaced directly, and you can fetch the text at any SHA in one call.
Walk the history
Start from a law ID and ask for its commits. Each commit has a SHA, a date, and a one-line summary derived from the reform that produced it.
Common use cases
-
Compliance "as of" views. Your users click a
date; you show the law the way it read that day. Fetch the
commits, pick the one with
date ≤ click, callat_commit. -
Diff between two reforms. Fetch the text at
two SHAs and run any Markdown diff library. We'll expose a
server-side
/diffendpoint in a later release. - LLM grounding with dated citations. When a user asks "what did Article 8 say in 2003", you cite the exact SHA alongside the passage — auditable, reproducible.
SHAs vs. reform IDs
Each reform has its own stable ID (reform.id), which
the webhook payload carries. The SHA
is the commit that the reform produced — one reform → one
commit. You can look up a commit by its SHA directly via
at_commit, or walk from a reform via its
commit_sha attribute. Both paths reach the same text.