API & MCP
Everything a person can do on What Changed in This Law?, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://whatchangedinthislaw.usefulweb.site/api/v1/calculate– run What Changed in This Law?GET https://whatchangedinthislaw.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
What Changed in This Law?
Paste (or link) the old and new versions of a law, regulation, terms of service or policy. The text is split at §, Art. and Section headings, sections are aligned by their number, and every added, removed or modified section is shown with a word-level diff and the numbers, durations and obligation words (must/may/muss/kann…) that changed.
| Field | Type | Default | Description |
|---|---|---|---|
oldText | textarea | — | Old version (text) |
newText | textarea | — | New version (text) |
oldUrl | url | — | Or: URL of the old version. Official source (e.g. gesetze-im-internet.de, eur-lex.europa.eu, legislation.gov.uk). |
newUrl | url | — | Or: URL of the new version |
citation | text | — | Citation / amending act (optional) |
effectiveDate | date | — | Effective date of the new version (optional) |
Example request
Notice period shortened
curl -X POST https://whatchangedinthislaw.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"oldText":"§ 1 Scope\nThis act applies to consumer contracts.\n§ 2 Notice\nThe customer must give notice of termination at least 3 months before the end of the term.\n§ 3 Fees\nA processing fee of 25 EUR may be charged.","newText":"§ 1 Scope\nThis act applies to consumer contracts.\n§ 2 Notice\nThe customer may give notice of termination at any time with a notice period of 1 month.\n§ 3 Fees\nA processing fee of 25 EUR may be charged.\n§ 4 Online cancellation\nProviders must offer a cancellation button on their website.","citation":"Example amendment act","effectiveDate":"2026-12-01"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://whatchangedinthislaw.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
what_changed_in_this_law - Local stdio connector:
node src/mcp-stdio.ts --tool=what-changed-in-this-law
{
"mcpServers": {
"what-changed-in-this-law": { "type": "http", "url": "https://whatchangedinthislaw.usefulweb.site/mcp" }
}
}