opencaselaw.ch

REST API · OpenAPI 3.0.3

Call the OpenCaseLaw corpus from any language

29 documented HTTP routes covering search, citation graph, statute lookup, doctrine timelines, and exports. Free. No API key. CORS enabled (Access-Control-Allow-Origin: *). Same backend that powers Claude, ChatGPT, the Word add-in, and opencaselaw.ch/search.

Open Swagger UI openapi.json (raw spec) /health

Quickstart — search the corpus

curl -s "https://mcp.opencaselaw.ch/api/decisions?q=Mietrecht+K%C3%BCndigung&limit=5"

Returns:

{
  "total": 12847,
  "results": [
    { "decision_id": "bge_BGE_140_III_86", "court": "bge",
      "decision_date": "2014-04-15", "language": "de",
      "title": "Mietrecht; …", "regeste": "…",
      "citation_string_de": "BGE 140 III 86", "canonical_url": "https://mcp.opencaselaw.ch/entscheid/…" },
    …
  ],
  "limit": 5, "offset": 0
}

Quickstart — look up an article

curl -s "https://mcp.opencaselaw.ch/api/laws/OR?article=41"
{
  "sr_number": "220",
  "abbreviation": "OR",
  "title": "Bundesgesetz vom 30. März 1911 …",
  "consolidation_date": "2026-01-01",
  "language": "de",
  "articles": [
    { "article_num": "41", "heading": null,
      "text": "1 Wer einem andern widerrechtlich Schaden zufügt, …" }
  ]
}

Common parameters

ParamUsed byNotes
q/decisionsFree-text query. Boolean operators (AND, OR, NOT), exact phrases ("…"), docket numbers, BGE references.
query/laws/search · /commentaries/searchFree-text query for statute / commentary search.
limiteverywhere1–50, default 10 (decisions) / 20 (laws).
offset/decisions · /laws/searchFor pagination. ?offset=20&limit=20 = page 2.
language/decisionsde / fr / it. Filters by decision language.
canton/decisions · /laws/searchTwo-letter cantonal code (ZH, BE, …) or CH for federal.
court/decisionsCourt key (bger, bvger, ge_gerichte, …). See /courts.
level/laws/searchfederal or cantonal.
article/laws/{abbreviation}Article number (e.g. 41, 266l).

Endpoint reference

Decisions
Citation graph
Statutes & doctrine
Commentary & teaching
Verification & introspection

Schema, parameter docs and example responses are auto-generated in openapi.json. Validated against Microsoft Power Platform / Copilot Studio's WADL converter (2026-04-25, with LALIVE) — same connector used in the Microsoft Word add-in.

Rate limits

Soft-limited at the nginx layer to protect the upstream workers. Pace your batch jobs at ≤ 5 requests/second per IP. If you need higher throughput, run the stack locally — full instructions in README (~65 GB disk, ~30 min setup).