# French Law – Codes, Laws & Legal Changes (Légifrance) (`yck69/french-law`) Actor

French codes, laws and decrees from the official Légifrance (LEGI) open data, no API key needed: articles in force today or at any date, keyword search, upcoming and recent legal changes, and RAG-ready chunks with embeddings.

- **URL**: https://apify.com/yck69/french-law.md
- **Developed by:** [yck](https://apify.com/yck69) (community)
- **Categories:** AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 articles

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## French Law – Codes, Laws & Legal Changes (Légifrance)

**French codes, laws and decrees** from the official **Légifrance open data** (LEGI, published by DILA), **no API key or PISTE account needed**:

- **Articles**: any article of 106 codes (Code civil, Code du travail, Code de commerce, Code général des impôts…) or of laws, ordinances and decrees, **in force today, at any past date, or with its full history**.
- **Search**: articles containing your keywords or exact phrases, in one code or in all codes in force.
- **Legal changes**: articles **created, amended or ended** in a period, **including upcoming changes** already published, with the previous text of amended articles. Schedule it to monitor regulation that affects you.
- **RAG-ready**: one row per article or per chunk, with the official **BGE-M3 embeddings** (1,024 dimensions) for your vector database.

**$1 per 1,000 articles.**

### What data can you get?

<table>
<tr><td>📜 Article text</td><td>🔢 Article number</td><td>📚 Code or law</td></tr>
<tr><td>✅ Status: in force, repealed, upcoming</td><td>📅 In force from / until</td><td>🗂️ Place in the code (book, title, chapter)</td></tr>
<tr><td>📝 Notes</td><td>🔗 Légifrance link</td><td>🔁 Previous text of amended articles</td></tr>
<tr><td>🧩 RAG chunks</td><td>🧠 BGE-M3 embeddings (1,024 dims)</td><td>📎 Citations</td></tr>
</table>

### How to use it

1. Click **Try for free** at the top of this page.
2. Choose **articles**, **search** or **changes**.
3. Pick one or more codes, then article numbers, keywords or a period.
4. Click **Start**.
5. Download as JSON, CSV or Excel, or load the chunks into your vector database.

### Why this Actor

- **No credentials.** The official Légifrance API requires a PISTE account and OAuth setup; this Actor works out of the box.
- **Every version of every article**, with exact dates in force, the code's structure (book, title, chapter, section) and citations to other texts.
- **"What changed?" built in**: amendments come with the text before and after.
- **Fresh**: the data is refreshed every week from DILA's daily publications, and includes changes that are scheduled but not yet in force.

### Use cases

- **Legal tech and AI assistants**: ground LLM answers on the exact text in force, with chunks and embeddings ready for RAG.
- **Compliance and HR teams**: a weekly list of changes to the Code du travail, Code de la consommation or Code de l'environnement.
- **Law firms and students**: an article as it stood at the date of the facts.
- **Researchers**: the full history of a code.

### Input examples

**Articles in force**

```json
{ "mode": "articles", "codes": ["code_civil", "code_du_travail"], "articleNumbers": ["1240", "L1222-9"] }
```

**An article as it was in 2015**

```json
{ "mode": "articles", "codes": ["code_civil"], "articleNumbers": ["1382"], "version": "atDate", "atDate": "2015-06-01" }
```

**Every article mentioning an exact phrase**

```json
{ "mode": "search", "codes": ["code_du_travail"], "keywords": ["\"rupture conventionnelle\""] }
```

**Changes to the labour code in the last 30 days, and upcoming**

```json
{ "mode": "changes", "codes": ["code_du_travail"], "changedFrom": "30 days" }
```

**A whole code as RAG chunks with embeddings**

```json
{ "mode": "articles", "codes": ["code_de_la_consommation"], "rowPer": "chunk", "includeEmbeddings": true, "maxResults": 100000 }
```

### Output

```json
{
    "id": "LEGIARTI000032041571",
    "url": "https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000032041571",
    "collection": "Code civil",
    "articleNumber": "1240",
    "status": "VIGUEUR",
    "inForceFrom": "2016-10-01",
    "inForceUntil": null,
    "hierarchy": ["Livre III : Des différentes manières dont on acquiert la propriété", "…", "Chapitre Ier : La responsabilité extracontractuelle en général"],
    "text": "Tout fait quelconque de l'homme, qui cause à autrui un dommage, oblige celui par la faute duquel il est arrivé à le réparer.",
    "citationsCount": 12,
    "citations": [{ "title": "Loi du 29 juillet 1881 - art. 44 (VD)", "type": "CITATION", "articleId": "LEGIARTI000032043044" }]
}
```

Legal changes add `changeType` (`created`, `amended`, `repealed`, `transferred`, `ended`), `changeDate`, `isUpcoming`, and for amendments `previousVersionId` and `previousText`. Chunk rows add `chunkIndex`, `chunkText`, and with embeddings, `embedding` and `embeddingModel`.

**Statuses**: `VIGUEUR` (in force), `VIGUEUR_DIFF` (in force later), `MODIFIE` (replaced by a newer version), `ABROGE` (repealed), `TRANSFERE` (moved to another number).

### Pricing

| Event | Price |
|---|---|
| Article or chunk returned | $0.001 |

### Good to know

- **Source**: [LEGI](https://www.data.gouv.fr/fr/datasets/legi-codes-lois-et-reglements-consolides/) (DILA), as processed and embedded by the State's AI team (DINUM / [AgentPublic](https://huggingface.co/datasets/AgentPublic/legi)), *Licence Ouverte / Etalab 2.0*. Updated weekly.
- **Coverage**: consolidated national legislation and regulations (codes, laws, ordinances, decrees, orders). Case law, collective agreements and the Journal officiel's non-consolidated texts are not included.
- **Search** across all codes or across decrees and orders reads a lot of data and can take a minute or two; choose specific codes for fast answers.
- This is legal information, not legal advice. For official purposes, rely on [Légifrance](https://www.legifrance.gouv.fr).

### More Actors from this developer

### FAQ

##### Can I use it through the API, Make, Zapier or Google Sheets?

Yes. Every run can be started and read through the [Apify API](https://docs.apify.com/api/v2) (JavaScript and Python clients, CLI, MCP), and Apify integrations connect it to Make, Zapier, n8n, Google Sheets, Slack, webhooks and more.

##### Is it legal to use this data?

The Actor only reads public or official open data and doesn't log in anywhere. Check the source's licence and your local rules (for example GDPR when data concerns people) for your use case; if in doubt, ask a lawyer.

##### Something isn't working, or you need another field?

Open an issue on the **Issues** tab: feedback is read and answered.

# Actor input Schema

## `mode` (type: `string`):

<b>Articles</b>: given articles of a code (e.g. Code civil art. 1240) or a whole code, in force today, at a past date, or with all versions.<br><b>Search</b>: articles containing your keywords.<br><b>Legal changes</b>: articles that came or will come into force, or ended, in a period, to monitor regulatory changes.

## `codes` (type: `array`):

Codes to read, search or monitor. For Search, leave empty to search every code in force.

## `textCategories` (type: `array`):

Laws, decrees, orders… outside the codes. Large categories (decrees, orders) take longer to search.

## `articleNumbers` (type: `array`):

e.g. <code>1240</code>, <code>L1222-9</code>, <code>R. 4127-1</code>. Leave empty to get every article of the chosen codes.

## `version` (type: `string`):

Which version of each article.

## `atDate` (type: `string`):

For 'In force at a date': e.g. <code>2020-01-01</code> or <code>5 years</code>.

## `keywords` (type: `array`):

One search per line; an article matches if it contains all the words of any line. e.g. <code>télétravail</code>, <code>rupture conventionnelle</code>.

## `searchIn` (type: `string`):

Article text, or the title of the law/decree (useful to find a specific text).

## `changedFrom` (type: `string`):

Start of the period, e.g. <code>30 days</code> (default) or <code>2026-01-01</code>.

## `changedTo` (type: `string`):

End of the period. Leave empty to include every upcoming change already published.

## `changeTypes` (type: `array`):

New versions coming into force, and/or versions that end (repealed or replaced).

## `rowPer` (type: `string`):

Whole articles, or chunks sized for AI retrieval (RAG).

## `includeEmbeddings` (type: `boolean`):

Adds the official 1,024-dimension BGE-M3 vector of each chunk, ready for a vector database.

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

Articles or chunks.

## Actor input object example

```json
{
  "mode": "articles",
  "codes": [
    "code_civil"
  ],
  "articleNumbers": [
    "1240",
    "1241"
  ],
  "version": "inForce",
  "searchIn": "text",
  "changeTypes": [
    "entersIntoForce",
    "ends"
  ],
  "rowPer": "article",
  "includeEmbeddings": false,
  "maxResults": 20
}
```

# Actor output Schema

## `articles` (type: `string`):

Articles with status, dates and text.

## `changes` (type: `string`):

Created, amended and ended articles.

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

Every field, including hierarchy, citations and embeddings.

# 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 = {
    "mode": "articles",
    "codes": [
        "code_civil"
    ],
    "articleNumbers": [
        "1240",
        "1241"
    ],
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("yck69/french-law").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 = {
    "mode": "articles",
    "codes": ["code_civil"],
    "articleNumbers": [
        "1240",
        "1241",
    ],
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("yck69/french-law").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 '{
  "mode": "articles",
  "codes": [
    "code_civil"
  ],
  "articleNumbers": [
    "1240",
    "1241"
  ],
  "maxResults": 20
}' |
apify call yck69/french-law --silent --output-dataset

```

## MCP server setup

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

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/SeqU2kegogkWU3k1s/builds/7pB3hXV0adElcDxIx/openapi.json
