Get Legal Text
get_legal_textFetch a legal article as it stood on a given date, by its url (any /texte/ link), or — lacking a url — by code + article, or by textId: one of those three is required. Returns the version in force at date (omit for today): full text, status, validity dates, and the timeline of all versions — say which version you quote. The text carries inline markdown links to cross-referenced articles (/texte/, open with get_legal_text; when served at a date, the links point to the same date). commentaires carries institutional commentary anchored on the article (analyses inline, links otherwise). A text with no articles — circulaire, publication decree — is read at its root /texte/{code}, and comes back whole, without num. Covers French codes and statutes, plus curated foreign codes and treaties.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | A librejustice.fr article URL `/texte/{code}/{article}`: take it from a search_legal_texts hit or an inline citation link, or compose it — {code} is the code slug ("code-civil", as in facets.legal_instrument), {article} the lowercase article key ("l761-1" for L. 761-1, "1240" for 1240). `/texte/{code}` alone addresses the text itself, which is how a text with no articles (circulaire, publication decree) is read. | |
| code | No | Code slug, when you hold the code and the article apart rather than as a url ("code-civil"). Alone, addresses the text itself. | |
| date | No | Consultation date (YYYY-MM-DD) — returns the version in force at that date. Omit for the version currently in force. | |
| textId | No | Légifrance article id (LEGIARTI…), resolved to the article it designates. LEGITEXT and CID are not accepted. | |
| article | No | Lowercase article key, alongside `code` ("l761-1" for L. 761-1, "1240" for 1240). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| num | No | Article key. Absent when the url addressed the root of a text: with no articles the payload is the whole text, `text` carrying its body; with articles it is the table of contents, `articles` carrying it. | |
| url | Yes | ||
| code | Yes | ||
| etat | No | ||
| nota | No | ||
| text | No | Full text; cross-references to other articles render as inline markdown links (/texte/ urls, open with get_legal_text). | |
| title | Yes | ||
| dateFin | No | ||
| omitted | No | Articles served without their body because the text or division exceeds the inline reading budget: their `url` fetches them. | |
| articles | No | Contents of a text root or of one of its divisions, in reading order. Each `url` goes back to get_legal_text; a `section` entry returns all its articles at once, which is the cheapest way to read a chapter. `text` is joined only within the inline reading budget. | |
| versions | Yes | ||
| dateDebut | No | ||
| sourceUrl | No | ||
| articleCount | No | Number of articles the text carries. Present only on the root of a text with articles. | |
| commentaires | No | Institutional commentary anchored on this document: court-written analyses served inline (`body`), plus outbound links (`url`) to the rapporteur public's conclusions and to related institutional documents (reports, opinions, press releases). Context, never the ruling itself — quote the decision text, not a commentaire, as the court's words. |