OpenCaseLaw Decision Structure API

The Decision Structure API from OpenCaseLaw — 4 operation(s) for decision structure.

GitHub OpenAPI

Operations 4

GET /erwaegung/{decision_id}/{e_number} Get the verbatim text of one Erwägung #
GET /relevant-erwaegung/{decision_id} Find the Erwägung paragraph(s) that match a legal claim #
GET /regeste/{decision_id} Get the official Regeste (head-note) #
GET /structure/{decision_id} Get the full structured decision #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/opencaselaw-ch:opencaselaw-ch-decision-structure-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

opencaselaw-ch-decision-structure-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenCaseLaw Decision Structure API
  description: Swiss court decisions, statutes, commentaries, scholarship, and citation graph. 1,040,000+ published decisions from Swiss federal, cantonal, and regulatory bodies, 5,546 federal laws, 16,400 cantonal acts, 1,100+ commentaries, 51,000+ OA scholarship records.
  version: 1.0.0
servers:
- url: https://mcp.opencaselaw.ch/api
  description: OpenCaseLaw public REST API
- url: /api
  description: Relative — for self-hosted or reverse-proxied deployments
tags:
- name: Decision Structure
paths:
  /erwaegung/{decision_id}/{e_number}:
    get:
      tags:
      - Decision Structure
      summary: Get the verbatim text of one Erwägung
      description: Returns the exact wording of a specific numbered paragraph (e.g. Erwägung 4.1). Use this before quoting from a decision — the `text` field is safe to embed verbatim in quotation marks. Available for ~90% of federal decisions (BGer / BVGer / BStGer / BGE / BPatGer / EGMR-CH / MKG). Returns 404 when the decision is unknown, has no structured Erwägungen, or does not contain the requested one.
      operationId: api_get_erwaegung_erwaegung__decision_id___e_number__get
      parameters:
      - name: decision_id
        in: path
        required: true
        schema:
          type: string
          description: Decision ID
          title: Decision Id
        description: Decision ID
      - name: e_number
        in: path
        required: true
        schema:
          type: string
          description: Hierarchical Erwägung number, e.g. '1', '4.1', '4.1.2'
          title: E Number
        description: Hierarchical Erwägung number, e.g. '1', '4.1', '4.1.2'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /relevant-erwaegung/{decision_id}:
    get:
      tags:
      - Decision Structure
      summary: Find the Erwägung paragraph(s) that match a legal claim
      description: Server-side FTS5 + BM25 ranking over per-paragraph text. Returns top-k matches with confidence labels (high / medium / low) and a highlighted_snippet showing the matched sentence(s). Refuses to surface a guess when the score gap is weak — fixes the systematic 'pinpoint=3.1 fallback' failure mode.
      operationId: api_find_relevant_erwaegung_relevant_erwaegung__decision_id__get
      parameters:
      - name: decision_id
        in: path
        required: true
        schema:
          type: string
          description: Decision ID, BGE reference, or docket number
          title: Decision Id
        description: Decision ID, BGE reference, or docket number
      - name: claim
        in: query
        required: true
        schema:
          type: string
          description: The legal claim or proposition to match against the decision's Erwägungen.
          title: Claim
        description: The legal claim or proposition to match against the decision's Erwägungen.
      - name: top_k
        in: query
        required: false
        schema:
          type: integer
          maximum: 10
          minimum: 1
          description: Number of top matches to return.
          default: 3
          title: Top K
        description: Number of top matches to return.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /regeste/{decision_id}:
    get:
      tags:
      - Decision Structure
      summary: Get the official Regeste (head-note)
      description: Returns the court's own formulation of the legal rule established by the decision — the canonical citation target for BGEs. References like '(E. 5.2.1)' inside the Regeste point to specific Erwägungen, retrievable with /erwaegung/.
      operationId: api_get_regeste_regeste__decision_id__get
      parameters:
      - name: decision_id
        in: path
        required: true
        schema:
          type: string
          description: Decision ID, BGE reference, or docket number
          title: Decision Id
        description: Decision ID, BGE reference, or docket number
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /structure/{decision_id}:
    get:
      tags:
      - Decision Structure
      summary: Get the full structured decision
      description: Returns Sachverhalt + Erwägungen-paragraphs + Dispositiv + Regeste as separately addressable fields. Federal decisions only (232 k rows, 90.6% Erwägungen coverage).
      operationId: api_get_structure_structure__decision_id__get
      parameters:
      - name: decision_id
        in: path
        required: true
        schema:
          type: string
          description: Decision ID
          title: Decision Id
        description: Decision ID
      - name: paragraph_excerpt_chars
        in: query
        required: false
        schema:
          type: integer
          maximum: 5000
          minimum: 50
          description: Truncate each Erwägung excerpt to N chars (full text via /erwaegung/).
          default: 250
          title: Paragraph Excerpt Chars
        description: Truncate each Erwägung excerpt to N chars (full text via /erwaegung/).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ValidationError:
      properties:
        loc:
          items:
            type: string
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
          type: object
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError