OpenCaseLaw Analysis API

The Analysis API from OpenCaseLaw — 2 operation(s) for analysis.

GitHub OpenAPI

Operations 2

POST /mock-decision Draft a mock 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-analysis-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-analysis-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenCaseLaw Analysis 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: Analysis
paths:
  /trends:
    get:
      tags:
      - Analysis
      summary: Analyze legal trend
      description: Year-by-year decision counts showing jurisprudence evolution. Years are decision years; the latest keep rising as courts publish, so a dip at the end is publication lag, not a trend.
      operationId: api_analyze_legal_trend_trends_get
      parameters:
      - name: query
        in: query
        required: false
        schema:
          type: string
          description: Text query
          title: Query
        description: Text query
      - name: law_code
        in: query
        required: false
        schema:
          type: string
          description: Law code (e.g., BV, OR). Requires article.
          title: Law Code
        description: Law code (e.g., BV, OR). Requires article.
      - name: article
        in: query
        required: false
        schema:
          type: string
          description: Article number (requires law_code)
          title: Article
        description: Article number (requires law_code)
      - name: court
        in: query
        required: false
        schema:
          type: string
          description: Court filter
          title: Court
        description: Court filter
      - name: date_from
        in: query
        required: false
        schema:
          type: string
          description: Start date (YYYY-MM-DD)
          title: Date From
        description: Start date (YYYY-MM-DD)
      - name: date_to
        in: query
        required: false
        schema:
          type: string
          description: End date (YYYY-MM-DD)
          title: Date To
        description: End date (YYYY-MM-DD)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /mock-decision:
    post:
      tags:
      - Analysis
      summary: Draft a mock decision
      description: Build a research-only mock decision outline from user facts, grounded in case law and statute references.
      operationId: api_mock_decision_mock_decision_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MockDecisionRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    MockDecisionRequest:
      properties:
        facts:
          type: string
          title: Facts
        question:
          title: Question
          type:
          - string
          - 'null'
        deciding_court:
          title: Deciding Court
          type:
          - string
          - 'null'
        preferred_language:
          title: Preferred Language
          type:
          - string
          - 'null'
        statute_references:
          title: Statute References
          items:
            additionalProperties: true
            type: object
          type:
          - array
          - 'null'
        clarifications:
          title: Clarifications
          items:
            additionalProperties: true
            type: object
          type:
          - array
          - 'null'
        fedlex_urls:
          title: Fedlex Urls
          items:
            type: string
          type:
          - array
          - 'null'
        limit:
          type: integer
          title: Limit
          default: 8
      type: object
      required:
      - facts
      title: MockDecisionRequest
      description: Request body for the mock decision endpoint.
    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