# Swiss, German and French law

Cormorant keeps a copy of the federal acts of Switzerland and Germany and
of the French codes, with
every version since the store began. You can read an article as it applied
on a given day, see what changed between two days, and get an event when an
act or one article changes.

- **Switzerland:** acts from Fedlex, the consolidated text in German, dated
  by the day each consolidation applies from.
- **Germany:** federal laws from gesetze-im-internet.de. The portal gives no
  dates, so a new version is dated by the day Cormorant first saw the text
  (`valid_from_basis: first_seen`).
- **France:** the codes from Légifrance, read from DILA's LEGI open data
  (Licence Ouverte 2.0; source: Légifrance, DILA): the Code civil, the Code
  de commerce and the Code monétaire et financier. A code's version starts
  on the latest day one of its articles came into force.

Both publishers are read once a day. A version is kept only when the text
changed. Official texts are not protected by copyright in Switzerland or Germany
(art. 5 URG, § 5 UrhG), and the French data is reused under the Licence
Ouverte. The official publication remains the binding one. These routes are not charged.

## 1. Find the act

```sh
curl -s -H "Authorization: Bearer $KEY" "https://api.cormorant.ch/v1/law/acts"
```

Each act has a `ref`: `ch:sr:<SR number>` for Switzerland (`ch:sr:220` is
the Code of Obligations), `de:<slug>` for Germany (`de:hgb`, `de:gmbhg`) and
`fr:<code>` for France (`fr:code-de-commerce`).
`GET /v1/law/acts/{ref}` lists the articles of the version in force today,
or on the day you give with `on`.

## 2. Read an article on a day

```sh
curl -s -H "Authorization: Bearer $KEY" \
  "https://api.cormorant.ch/v1/law/article?ref=ch:sr:220&num=Art.%20727&on=2025-06-30"
```

`num` takes `Art. 727`, `727`, `§ 15a` or `15a`, and for a French code
`L225-17`, `L. 225-17` or `1240`. The answer has the text,
the heading, where the article stands in the act, and the `version` it was
read from (`valid_from`, `valid_to`, the publisher's `source_url`).

## 3. See what changed

`GET /v1/law/acts/{ref}/changes?a=2025-01-01&b=2026-01-01` lists the
articles that were added, removed or reworded between the versions in force
on those two days. `GET /v1/law/diff?ref=…&num=…&a=…&b=…` gives one article
on both days and a unified diff of the two texts.

## 4. Watch it

```sh
curl -s -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"target": {"law": "ch:sr:220", "article": "Art. 727"},
       "schedule": {"interval": "P1D"},
       "webhook_url": "https://example.org/hooks/cormorant", "reference": "audit-duty"}' \
  "https://api.cormorant.ch/v1/watches"
```

Leave out `article` to watch the whole act. When a version with another
text comes into force, the watch raises `changed`. For a whole act, the
event lists the articles that differ in `articles`. Events arrive like
those of every other watch, on `GET /v1/watches/events` and on the signed
webhook (see [Tables, versions and watches](/docs/tables-and-watches.md)). A law
watch fetches nothing and is not charged.

## 5. French administrative court decisions

`GET /v1/law/decisions?q="société TDF"` searches the decisions of the
Conseil d'État, the cours administratives d'appel and the tribunaux
administratifs since 2025 (DILA's JADE open data), newest first.
`GET /v1/law/decisions/{id}` returns one with its text. The names of the
judges and officers of the court are never kept.

Every field and error is in the [API contract](/docs/api.md#national-law-v1law).
