# French Law Articles & Codes (Légifrance API) (`klyve1/france-legifrance`) Actor

Get any article of French law from the official Légifrance API: Code du travail, Code civil, Code de commerce and every other code, laws and decrees, and collective agreements (KALI). Current or historical versions, clean text, MCP-ready. No PISTE account needed.

- **URL**: https://apify.com/klyve1/france-legifrance.md
- **Developed by:** [Nico Klyve](https://apify.com/klyve1) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 article with full texts

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

### What does French Law Articles & Codes do?

It gets **French law** straight from the official **Légifrance API** and returns clean JSON:

- **Articles by reference**: give `Code du travail L1234-1`, `Code civil 1240` or `C. com. L. 225-35` and get the article text, its status, its validity dates, its place in the code and its Légifrance link.
- **Keyword search in the codes**: find every article of the Code du travail (or any of the 76 codes in force) about `période d'essai renouvellement`.
- **Collective agreements (KALI)**: search inside a convention collective by its **IDCC** number, e.g. what IDCC 1557 says about the trial period.
- **Any date**: get the law **as it was in force on a given date**.

No PISTE account, no OAuth, no API key to manage: just run it.

### Who is it for?

- **Legal and HR AI agents**: ground answers in the exact article text instead of guessing
- **Legal tech and RAG builders**: load up-to-date articles into your knowledge base
- **Lawyers, in-house counsel, HR and payroll teams**: check the current wording of an article or an agreement clause in bulk
- **Compliance teams**: track the version of an article in force at a given date

Pairs well with **France Collective Agreement (IDCC) Finder** (find the IDCC of a company from its SIRET) and **French Case Law Search** (court decisions applying these articles).

### How to use it

#### Articles by reference

```json
{
  "mode": "articles",
  "references": ["Code du travail L1234-1", "Code civil 1240", "C. com. L. 225-35"],
  "date": "2024-01-01"
}
```

#### Keyword search in a code

```json
{
  "mode": "search",
  "query": "période d'essai renouvellement",
  "code": "Code du travail",
  "maxResults": 20
}
```

#### Search a collective agreement

```json
{
  "mode": "collectiveAgreement",
  "idcc": "1557",
  "query": "période d'essai",
  "maxResults": 10
}
```

#### Output example

```json
{
  "reference": "Code civil 1240",
  "found": true,
  "code": "Code civil",
  "number": "1240",
  "status": "VIGUEUR",
  "validFrom": "2016-10-01",
  "validTo": null,
  "path": "Livre III : Des différentes manières dont on acquiert la propriété > Titre III : Des sources d'obligations > Sous-titre II : La responsabilité extracontractuelle > 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.",
  "legifranceUrl": "https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000032041571",
  "source": "Légifrance (DILA), Licence Ouverte 2.0. Not legally binding: only the Journal officiel is."
}
```

### Pricing

Pay per event:

- **$0.005 per article returned with its full text**
- **$0.002 per search result without full text**

References not found are free.

### Data source

All data comes from the official **Légifrance API** of the DILA (Direction de l'information légale et administrative), published under the **Licence Ouverte 2.0** and accessed through the PISTE government portal. As stated by the DILA, the consolidated texts are informational and not legally binding: only the signed PDFs of the Journal officiel are. Results are not legal advice.

### En français

Récupérez le **texte officiel des articles de loi** depuis l'**API Légifrance** : tous les codes (Code du travail, Code civil, Code de commerce, CGI...), recherche par mots-clés, **conventions collectives par IDCC**, et versions à une date donnée. Sans compte PISTE ni clé API.

# Actor input Schema

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

articles = fetch articles by reference; search = keyword search in the codes; collectiveAgreement = search inside a collective agreement (by IDCC).

## `references` (type: `array`):

One per line: code name and article number, e.g. "Code du travail L1234-1", "Code civil 1240", "Code de commerce L. 225-35". Common abbreviations work (C. civ., C. trav., CGI...).

## `query` (type: `string`):

Words to look for, in French, e.g. "période d'essai renouvellement".

## `code` (type: `string`):

Optional code name, e.g. "Code du travail". Leave empty to search all codes in force.

## `idcc` (type: `string`):

4-digit collective agreement number, e.g. 1557. Use the France Collective Agreement (IDCC) Finder to get it from a SIRET.

## `date` (type: `string`):

Get the law as it was in force on this date (YYYY-MM-DD). Default: today.

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

Fetch the complete text of each article found. Articles fetched by reference always include their text.

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

Maximum number of articles returned.

## Actor input object example

```json
{
  "mode": "articles",
  "references": [
    "Code du travail L1234-1",
    "Code civil 1240",
    "Code de commerce L225-35"
  ],
  "includeFullText": true,
  "maxResults": 10
}
```

# Actor output Schema

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

One row per article of French law or collective agreement: reference, text, status, validity dates and Légifrance link.

# 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 = {
    "references": [
        "Code du travail L1234-1",
        "Code civil 1240",
        "Code de commerce L225-35"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("klyve1/france-legifrance").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 = { "references": [
        "Code du travail L1234-1",
        "Code civil 1240",
        "Code de commerce L225-35",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("klyve1/france-legifrance").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 '{
  "references": [
    "Code du travail L1234-1",
    "Code civil 1240",
    "Code de commerce L225-35"
  ]
}' |
apify call klyve1/france-legifrance --silent --output-dataset

```

## MCP server setup

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

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/uFjzdFRxLZXHXeGyW/builds/2K2QKuTeHslPaLJuO/openapi.json
