# Swiss Federal Supreme Court - Case Law Search (BGer / TF) (`legaltech/bger`) Actor

Search Swiss Federal Supreme Court judgments since 2000 and leading BGE/ATF decisions in German, French or Italian: Regeste, operative part, full text.

- **URL**: https://apify.com/legaltech/bger.md
- **Developed by:** [Miguel González](https://apify.com/legaltech) (community)
- **Categories:** Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Swiss Federal Supreme Court - Case Law Search (BGer / TF)

Searches judgments of the Swiss Federal Supreme Court (Bundesgericht / Tribunal fédéral / Tribunale federale) on its official search engine (bger.ch) in two collections: all judgments since 2000 (AZA) and the leading decisions published in the official BGE/ATF collection since 1954. Search in German, French or Italian with implicit AND, exact phrases, -word exclusion, OR/NOT and parentheses, verified against the full text when there are several terms; lookup by case number (4A_640/2011) or BGE reference (BGE 124 III 310); filters by date and by published judgments. Returns date, case number, chamber, area of law, subject, panel and operative part (AZA), or reference, header, official headnote (Regeste) and considerations (BGE), plus passages and optional full text. Judgments are anonymised by the Court itself.

### Use cases

- Search Federal Supreme Court case law on an issue in any of its three languages.
- Get the official headnote (Regeste) of leading BGE decisions on a topic.
- Retrieve a specific judgment by case number or BGE reference.
- Extract the operative part to see how each appeal was decided.

### How to use (guide for AI agents)

- `collections`: "aza" (all judgments since 2000) and/or "bge" (leading decisions).
- `fileNumbers`: "4A_640/2011", "4C.96/2005" or "BGE 124 III 310".
- Search in the language of the judgment: Mietzins (de), loyer (fr), pigione (it).
- Every result includes `searchTerm` and `rank`; `passages` holds the paragraphs where the search terms appear, ready for LLM analysis.

### Input example

```json
{
    "searchTerms": ["\"missbräuchlicher Mietzins\"", "loyer abusif"],
    "fileNumbers": ["BGE 124 III 310"],
    "collections": ["aza", "bge"],
    "dateFrom": "2015-01-01",
    "maxResults": 20
}
```

### Output example (abridged)

```json
{
    "searchTerm": "Mietzins Schimmel",
    "collection": "aza",
    "decisionDate": "2025-02-07",
    "fileNumber": "6B_799/2023",
    "chamber": "I. strafrechtliche Abteilung",
    "legalArea": "Straftaten",
    "subject": "Gewerbsmässiger Wucher",
    "panel": "Bundesrichter Muschietti, als präsidierendes Mitglied, ...",
    "dispositive": "1. Die Beschwerde wird abgewiesen, soweit darauf einzutreten ist. 2. Die Gerichtskosten von Fr. 3'000.-- ...",
    "passages": ["5.1. Die Vorinstanz sieht den Tatbestand des Wuchers als erfüllt..."],
    "url": "https://www.bger.ch/ext/eurospider/live/de/php/aza/http/index.php?lang=de&type=show_document&highlight_docid=..."
}
```

### Notes and limits

- www.bger.ch does not send the intermediate certificate of its TLS chain. The actor bundles the official DigiCert intermediate certificate (`certs/digicert-g2-ca1.pem`, valid until 2031) so the connection is verified without disabling TLS security.

### Source

Only official sources are used (courts, ministries or the open data published by the courts themselves). Results are returned as published by the source.

# Actor input Schema

## `searchTerms` (type: `array`):

One search per item, in German, French or Italian. Syntax: words (implicit AND), "exact phrase", -word, OR / NOT and parentheses (OR/NOT are resolved by combining queries).

## `fileNumbers` (type: `array`):

Retrieve specific judgments: "4A_640/2011", "4C.96/2005" or "BGE 124 III 310".

## `collections` (type: `array`):

AZA: all judgments since 2000. BGE/ATF: leading decisions published in the official collection (since 1954). Codes are opaque: do NOT guess them; choose by reading the title (enumTitle) of each option.

## `dateFrom` (type: `string`):

YYYY-MM-DD. For BGE the year is used.

## `dateTo` (type: `string`):

YYYY-MM-DD. For BGE the year is used.

## `publishedOnly` (type: `boolean`):

In the AZA collection, return only judgments marked as published in the official collection.

## `maxResults` (type: `integer`):

Maximum per search term and collection.

## `includeDetails` (type: `boolean`):

Opens each judgment to add panel, subject, operative part (AZA) or official headnote (Regeste) and considerations (BGE).

## `passages` (type: `integer`):

Number of paragraphs containing the search terms returned in `passages` (0 = none). Ideal for LLM analysis.

## `includeFullText` (type: `boolean`):

Adds the `text` field with the full decision. Greatly increases output size; enable only if needed.

## Actor input object example

```json
{
  "searchTerms": [
    "Mietzins Schimmel"
  ],
  "fileNumbers": [],
  "collections": [
    "aza",
    "bge"
  ],
  "publishedOnly": false,
  "maxResults": 20,
  "includeDetails": true,
  "passages": 3,
  "includeFullText": false
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset of judgments returned by the search, one item per result. Main fields: searchTerm, collection, decisionDate, fileNumber, bge, chamber, legalArea, subject, regeste, dispositive, url. See the dataset schema for the full list of fields.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchTerms": [
        "Mietzins Schimmel"
    ],
    "fileNumbers": [],
    "collections": [
        "aza",
        "bge"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("legaltech/bger").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchTerms": ["Mietzins Schimmel"],
    "fileNumbers": [],
    "collections": [
        "aza",
        "bge",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("legaltech/bger").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchTerms": [
    "Mietzins Schimmel"
  ],
  "fileNumbers": [],
  "collections": [
    "aza",
    "bge"
  ]
}' |
apify call legaltech/bger --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,legaltech/bger"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/DHCZbZVjg2Dh3JBCP/builds/tH1amnENez0nUOczF/openapi.json
