# BOFiP Doctrine Scraper – French Tax Guidance (`crispish_guava/bofip-doctrine`) Actor

Extracts all French tax doctrine in force from the official BOFiP-Impôts open data API (DGFiP, Licence Ouverte 2.0): commentaries of every BOI series (TVA/VAT, IR, IS, BIC, ENR, INT…), rescrits with question/answer, actualités. Full text, dates, permalink, attribution.

- **URL**: https://apify.com/crispish_guava/bofip-doctrine.md
- **Developed by:** [Alex Moreno](https://apify.com/crispish_guava) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 document extraits

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## BOFiP Doctrine Scraper – French Tax Guidance

**English** · [Français](#français) · [Español](#español)

Extract the **French tax administration's doctrine in force**, as published in the *Bulletin Officiel des Finances Publiques-Impôts* (BOFiP-Impôts), as clean, structured JSON. That covers **every BOI series**: TVA (VAT), IR (income tax), IS (corporate tax), BIC, BNC, BA, ENR, RFPI, RPPM, INT, PAT, IF, CVAE, the **rescrits** (with their question and answer) and the **actualités**. Each item has the identifier, title, series, division, publication date, full plain text, official permalink and a ready-to-use attribution line.

The Actor reads the **official open data API** of the DGFiP on data.economie.gouv.fr (dataset `bofip-vigueur`, the BOFiP documents currently in force). It does not scrape the BOFiP website and does not use its search engine.

> **Unofficial.** This Actor is not produced, endorsed or certified by the DGFiP or any French public body. Its output is **not tax advice**. Always check the official version on [bofip.impots.gouv.fr](https://bofip.impots.gouv.fr/).

### What's inside

On 23/11/2026 the `bofip-vigueur` dataset held **9,175 documents in force**, last updated 19/11/2026: 6,368 *Contenu* and 2,807 *Actualité*. By series: BIC 1,228 · TVA 909 · IS 753 · IR 734 · IF 731 · ENR 471 · INT 462 · RPPM 389 · RSA 344 · CF 329 · RFPI 272 · BA 258 · REC 246 · FORM 234 · CTX 232 · PAT 218 · BNC 201 · RES 197 · TCA 185 · DJC 180 · CAD 121 · TFP 112 · SJ 108 · TCAS 68 · TPS 67 · CVAE 60 · AIS 35 · IMG 11 · EAT 8 · DAE 6 · no series 6. These counts change when the DGFiP updates the dataset.

### Use cases

- **Tax advisers, accountants and law firms**: monitor new or updated doctrine by tax (VAT, income tax, corporate tax…), build internal knowledge bases.
- **Tax and accounting software**: link product features to the relevant administrative position (BOI paragraph, rescrit).
- **RAG / LLM pipelines and AI agents**: full texts with a stable identifier, date and permalink make good chunks with citations. Rescrits also come as question/answer pairs.
- **Legal research and compliance**: full export of the doctrine in force, with dates, for analysis.

### Input

| Field | Default | Description |
|---|---|---|
| `maxItems` | `20` | Quick sample by default. `0` = everything matching the filters (up to 9,175 documents: a long run, billed per document) |
| `series` | all | BOI series codes, e.g. `["TVA", "IR"]` |
| `taxes` | – | Common tax names, translated to series (table below), e.g. `["VAT", "corporate tax"]` |
| `onlyRescrits` | `false` | Keep only rescrits (`BOI-RES-<division>-<n>`); `series`/`taxes` then select the rescrit division |
| `includeActualites` | `true` | BOFiP news items (`ACTU-…`) |
| `includeSectionPages` | `false` | RES index pages (`BOI-RES`, `BOI-RES-TVA`) that only list rescrits |
| `identifiant` | – | One document, e.g. `BOI-TVA-CHAMP-10-10-20`, `BOI-RES-TVA-000001`, `ACTU-2024-00123` |
| `division` | – | Second BOI segment, e.g. `CHAMP` in `BOI-TVA-CHAMP-…` (for rescrits: `TVA` in `BOI-RES-TVA-…`) |
| `query` | – | Full-text search done by the official API |
| `dateFrom` / `dateTo` | – | Bounds on the publication / start-of-validity date (`YYYY-MM-DD`) |
| `sortBy` | `newest` | `newest` (latest publication first) or `identifiant` |
| `includeHtml` | `false` | Add the official HTML (`contenuHtml`) |
| `redactPersonalData` | `true` | Mask e-mails, phones, NIR, labelled SIREN/SIRET, civility + surname |
| `incremental`, `stateKey`, `lookbackDays` | off | Only new documents (or new versions) since the last incremental run |
| `requestDelaySecs` | `1.5` | ≥ 1 s, enforced |
| `maxConcurrency` | `1` | 1–2, hard cap 2 |
| `maxRequestRetries` | `4` | Backoff on 408/429/5xx/network errors; 403 never retried |
| `healthCheck` | `false` | Fail the run if nothing is saved |

#### Tax names → series

Names are matched ignoring case and accents. Every series code (TVA, IR, IS, BIC…) is also accepted as a tax name. Names with no clear single series (e.g. "sales tax") are **rejected** with an error rather than guessed: use `series` instead.

| Series | Accepted names |
|---|---|
| TVA | taxe sur la valeur ajoutée, VAT, value added tax, IVA, impuesto sobre el valor añadido |
| IR | impôt sur le revenu, income tax, personal income tax, IRPF, impuesto sobre la renta (de las personas físicas) |
| IS | impôt sur les sociétés, corporate tax, corporation tax, corporate income tax, impuesto sobre sociedades |
| BIC / BNC / BA | bénéfices industriels et commerciaux / bénéfices non commerciaux / bénéfices agricoles |
| RFPI | revenus fonciers, plus-values immobilières |
| RPPM | revenus et profits du patrimoine mobilier, revenus de capitaux mobiliers |
| RSA | revenus salariaux et assimilés |
| ENR | droits d'enregistrement, enregistrement, registration duties |
| PAT | impôt sur la fortune immobilière, IFI |
| IF | impôts fonciers, impôts locaux fonciers |
| CVAE | cotisation sur la valeur ajoutée des entreprises |
| TPS | taxe sur les salaires, payroll tax |
| INT | fiscalité internationale, international tax(ation) |
| CF / CTX / REC | contrôle fiscal, tax audit / contentieux (fiscal), tax litigation / recouvrement, tax collection |

#### Examples

Store prefilled input: the 5 most recent documents in force, all series, in a few seconds:

```json
{ "maxItems": 5 }
```

If `maxItems` is not given, the default is 20.

All VAT and corporate-tax doctrine published since 2024 (series and tax shortcuts can be mixed):

```json
{ "series": ["TVA"], "taxes": ["corporate tax"], "dateFrom": "2024-01-01", "maxItems": 0 }
```

One document by its identifier:

```json
{ "identifiant": "BOI-TVA-CHAMP-10-10-20" }
```

Only the VAT rescrits, with their question and answer:

```json
{ "onlyRescrits": true, "taxes": ["VAT"], "maxItems": 0 }
```

Scheduled monitoring (incremental): new or updated income-tax doctrine from the last 14 days, skipping what earlier runs already saved:

```json
{ "taxes": ["income tax"], "incremental": true, "lookbackDays": 14, "maxItems": 0, "stateKey": "ir-watch" }
```

A full export (`maxItems: 0`, no filter) makes about 93 API requests (92 pages of 100 plus metadata) at ≥ 1 s each, and takes several minutes. It is billed per document saved.

### Output

One dataset item per document. Example below: illustrative values for a TVA commentary, with the long texts cut short (marked «…»):

```json
{
  "identifiant": "BOI-TVA-CHAMP-10-10-20",
  "titre": "TVA - Champ d'application et territorialité - …",
  "documentKind": "contenu",
  "type": "Contenu",
  "serie": "TVA",
  "division": "CHAMP",
  "datePublication": "2025-06-04",
  "question": null,
  "reponse": null,
  "texte": "I. … 1 … article 256 du code général des impôts (CGI) … [text cut short]",
  "url": "https://bofip.impots.gouv.fr/bofip/…-PGP.html/identifiant=BOI-TVA-CHAMP-10-10-20-20250604",
  "personalDataRedactions": 0,
  "source": "BOFiP-Impôts",
  "sourceFullName": "Bulletin Officiel des Finances Publiques-Impôts",
  "publisher": "Direction générale des Finances publiques (DGFiP)",
  "licence": "Licence Ouverte / Open Licence 2.0 (Etalab)",
  "licenceUrl": "https://www.etalab.gouv.fr/wp-content/uploads/2017/04/ETALAB-Licence-Ouverte-v2.0.pdf",
  "datasetId": "bofip-vigueur",
  "datasetUrl": "https://data.economie.gouv.fr/explore/dataset/bofip-vigueur/",
  "datasetUpdatedAt": "2026-11-19T…",
  "attribution": "Source : BOFiP-Impôts (Bulletin Officiel des Finances Publiques-Impôts), DGFiP — BOI-TVA-CHAMP-10-10-20, publié le 04/06/2025, jeu de données « bofip-vigueur » mis à jour le 19/11/2026, Licence Ouverte / Open Licence 2.0 (Etalab)",
  "disclaimer": "Unofficial reuse of BOFiP-Impôts open data. …",
  "extractedAt": "2026-11-23T…"
}
```

- `documentKind` is derived from the identifier: `contenu` (any BOI document: commentaries, barèmes, forms, annexes), `rescrit`, `actualite`, `section` (RES index page) or `other`.
- `question` and `reponse` are filled **only for rescrits** that have explicit **Question :** / **Réponse :** blocks. In every other case they are `null` and the full text stays in `texte`. Nothing is invented.
- Commentaries can be long (tens of thousands of characters).

Dataset views: **Overview** (no long texts), **Full text** and **Rescrits: Question / Réponse**. A `RUN_SUMMARY` record in the key-value store gives counts, the API's total for your filters and the number of API requests.

### Source, licence and how to cite

- Source: BOFiP-Impôts, Direction générale des Finances publiques (DGFiP), open data published on [data.economie.gouv.fr](https://data.economie.gouv.fr/explore/dataset/bofip-vigueur/) and [data.gouv.fr](https://www.data.gouv.fr/datasets/bofip-impots-publications-en-vigueur).
- Licence: [Licence Ouverte / Open Licence 2.0](https://www.etalab.gouv.fr/wp-content/uploads/2017/04/ETALAB-Licence-Ouverte-v2.0.pdf) (Etalab). Commercial reuse is allowed if you credit the source and the date of last update, do not distort the content, and do not suggest any official endorsement.
- When you reuse the output, keep the `attribution` field or cite it like this: *« Source : BOFiP-Impôts (DGFiP), BOI-TVA-CHAMP-10-10-20, publié le 04/06/2025 — Licence Ouverte 2.0 »*.

### Limits and politeness

- At most 2 concurrent requests and at least 1 s between requests, enforced in code. The User-Agent identifies the Actor. A 403 is never retried.
- Short runs ask the API for small pages (as many records as needed, minimum 10), so the default 20-item run makes 2 requests.
- The API serves at most 10,000 records per query. The whole dataset (9,175) fits; if it ever grows past that, the run logs a warning and you should split by series or dates.
- The content is what the official dataset contains. It may differ slightly from what the BOFiP website shows at a given moment.
- Personal-data masking is best effort, using patterns. BOFiP doctrine is normally already anonymised.

***

### Français

Cet Actor extrait **toute la doctrine fiscale en vigueur publiée au BOFiP-Impôts**, sous forme de JSON structuré : commentaires de **toutes les séries BOI** (TVA, IR, IS, BIC, BNC, BA, ENR, RFPI, RPPM, INT, PAT, IF, CVAE…), **rescrits** (avec question et réponse) et **actualités**. Chaque élément contient l'identifiant, le titre, la série, la division, la date de publication, le texte intégral nettoyé, le permalien officiel et une mention d'attribution.

Il interroge l'**API officielle de données ouvertes** de la DGFiP sur data.economie.gouv.fr (jeu `bofip-vigueur`, 9 175 documents en vigueur au 23/11/2026). Il n'aspire pas le site, ni son moteur de recherche.

> **Non officiel.** Cet Actor n'est ni produit, ni validé, ni certifié par la DGFiP ou une autre administration. Il ne constitue **pas un conseil fiscal**. Seule la version publiée sur bofip.impots.gouv.fr fait foi.

**Cas d'usage** : cabinets d'expertise comptable et d'avocats (veille par impôt), éditeurs de logiciels fiscaux, pipelines RAG / LLM et agents d'IA (textes citables avec identifiant, date et permalien), recherche juridique.

**Entrée** : `maxItems` (20 par défaut pour un échantillon rapide ; 0 = tout, exécution longue), `series` (codes BOI), `taxes` (noms usuels traduits en séries : TVA/VAT/IVA → TVA, impôt sur le revenu/IRPF → IR, impôt sur les sociétés → IS, IFI → PAT… ; un nom sans équivalence claire est refusé), `onlyRescrits`, `identifiant`, `division`, `query` (plein texte), `dateFrom` / `dateTo` (AAAA-MM-JJ), `sortBy`, actualités incluses par défaut, pages d'index RES exclues par défaut, masquage des données personnelles activé par défaut, mode incrémental.

Exemples : `{ "maxItems": 5 }` (entrée préremplie de la Store ; sans `maxItems`, 20 par défaut) · `{ "taxes": ["TVA"], "dateFrom": "2024-01-01", "maxItems": 0 }` · `{ "identifiant": "BOI-TVA-CHAMP-10-10-20" }` · `{ "onlyRescrits": true, "maxItems": 0 }` · `{ "series": ["IR"], "incremental": true, "lookbackDays": 14, "maxItems": 0 }`.

**Sortie** : `question` / `reponse` ne sont renseignés que pour les rescrits qui contiennent ces blocs ; sinon `null`, et le texte complet reste dans `texte`.

**Licence et citation** : données sous [Licence Ouverte 2.0](https://www.etalab.gouv.fr/wp-content/uploads/2017/04/ETALAB-Licence-Ouverte-v2.0.pdf). Réutilisation, y compris commerciale, sous réserve de mentionner la source (« BOFiP-Impôts » ou « Bulletin Officiel des Finances Publiques-Impôts ») et la date. Il ne faut ni dénaturer le contenu, ni laisser croire à un aval officiel. Chaque élément contient un champ `attribution` prêt à l'emploi.

**Limites** : 2 requêtes simultanées au maximum et au moins 1 s entre deux requêtes ; un export complet prend plusieurs minutes.

***

### Español

Extrae **toda la doctrina fiscal francesa en vigor** del BOFiP-Impôts desde la **API oficial de datos abiertos** de la DGFiP (dataset `bofip-vigueur`, 9.175 documentos a 23/11/2026). Cubre todas las series BOI: TVA (IVA), IR (renta), IS (sociedades), BIC, ENR, INT, etc., además de los rescrits (con pregunta y respuesta) y las actualités. Cada resultado incluye identificador, título, serie, división, fecha, texto completo, permalink y una línea de atribución lista para usar.

**Entrada**: la entrada prellenada de la Store es `{ "maxItems": 5 }`; si no se pasa `maxItems`, devuelve por defecto los 20 documentos más recientes; `maxItems: 0` exporta todo lo que pase los filtros (ejecución larga). Filtros: `series`, `taxes` (IVA/VAT → TVA, IRPF/income tax → IR, impuesto sobre sociedades → IS…; si un nombre no tiene equivalencia clara, se rechaza), `onlyRescrits`, `identifiant`, `division`, `query`, `dateFrom`/`dateTo`, modo incremental.

Licencia de los datos: Licence Ouverte 2.0. Hay que citar «BOFiP-Impôts» y la fecha, y no presentar los datos como oficiales. **No es un producto oficial de la DGFiP ni constituye asesoramiento fiscal.**

# Actor input Schema

## `maxItems` (type: `integer`):

Maximum number of documents to save. The default (20) is a quick sample. 0 = every document matching the filters: up to all 9,175 documents in force, which is a long run (about 93 API requests, several minutes) billed per document.

## `series` (type: `array`):

Keep only these BOI series, e.g. TVA, IR, IS, BIC, BNC, BA, ENR, RFPI, RPPM, INT, PAT, IF, CVAE, TPS, CF, CTX, REC, RES (rescrits), FORM, DJC… Empty = all series.

## `taxes` (type: `array`):

Shortcut translated to series, e.g. VAT / IVA / TVA → TVA, income tax / IRPF → IR, corporate tax / impôt sur les sociétés → IS, IFI → PAT, payroll tax → TPS. Combined with 'BOI series' (union). See the README for the full mapping; unknown names are rejected rather than guessed.

## `onlyRescrits` (type: `boolean`):

Keep only rescrits (BOI-RES-<division>-<number>). In this mode, series / taxes select the rescrit division: e.g. taxes = VAT gives the BOI-RES-TVA-… rescrits.

## `includeActualites` (type: `boolean`):

Include BOFiP news items (type Actualité, ACTU-YYYY-NNNNN). On by default: they are part of the doctrine in force.

## `includeSectionPages` (type: `boolean`):

Also save the RES index pages (BOI-RES, BOI-RES-TVA, …) that only list rescrits. Off by default.

## `identifiant` (type: `string`):

Fetch a single document by its legal identifier, e.g. BOI-TVA-CHAMP-10-10-20, BOI-RES-TVA-000001 or ACTU-2024-00123. A trailing -YYYYMMDD date suffix is ignored.

## `division` (type: `string`):

Second segment of the BOI identifier: BOI-<series>-<division>-…, e.g. CHAMP (BOI-TVA-CHAMP-…), BASE, LIQ. For rescrits the division is the tax: BOI-RES-TVA-… → TVA. You can also write BOI-TVA-CHAMP. Ignored if an identifiant is given.

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

Free text searched by the official API in title and text (e.g. "auto-entrepreneur", "crédit d'impôt"). Quotes and backslashes are removed.

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

Lower bound on the document's publication / start-of-validity date (debut_de_validite), inclusive.

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

Upper bound on debut_de_validite, inclusive.

## `sortBy` (type: `string`):

newest = most recent publication date first (default); identifiant = alphabetical by legal identifier.

## `includeHtml` (type: `boolean`):

Add the official contenu_html field to each item (much larger output).

## `redactPersonalData` (type: `boolean`):

Mask e-mails, phone numbers, NIR, labelled SIREN/SIRET/numéro fiscal and civility + surname patterns, if any appear. BOFiP doctrine is normally already anonymised.

## `incremental` (type: `boolean`):

Only save documents (or new versions of documents) not saved by a previous incremental run with the same state key. State is kept in the run's default key-value store.

## `stateKey` (type: `string`):

Key-value store key holding the incremental state.

## `lookbackDays` (type: `integer`):

In incremental mode without dateFrom, only query documents published since (last run − N days). 0 = query everything and rely on the seen list. For scheduled runs over all series, 7–30 keeps each run to a few requests.

## `requestDelaySecs` (type: `number`):

Minimum gap between API requests. Cannot be lower than 1 second.

## `maxConcurrency` (type: `integer`):

1 or 2. Hard-capped at 2 in code.

## `maxRequestRetries` (type: `integer`):

Retries with exponential backoff on network errors, 408, 429 and 5xx. 403 is never retried.

## `healthCheck` (type: `boolean`):

Fail the run when no document is saved (useful for monitoring scheduled runs).

## `proxyConfiguration` (type: `object`):

Not needed for the public API; kept for consistency. Leave off.

## Actor input object example

```json
{
  "maxItems": 5,
  "onlyRescrits": false,
  "includeActualites": true,
  "includeSectionPages": false,
  "sortBy": "newest",
  "includeHtml": false,
  "redactPersonalData": true,
  "incremental": false,
  "stateKey": "bofip-doctrine-state",
  "lookbackDays": 0,
  "requestDelaySecs": 1.5,
  "maxConcurrency": 1,
  "maxRequestRetries": 4,
  "healthCheck": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `fullText` (type: `string`):

No description

## `questionReponse` (type: `string`):

No description

## `allFields` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# 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 = {
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("crispish_guava/bofip-doctrine").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 = { "maxItems": 5 }

# Run the Actor and wait for it to finish
run = client.actor("crispish_guava/bofip-doctrine").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 '{
  "maxItems": 5
}' |
apify call crispish_guava/bofip-doctrine --silent --output-dataset

```

## MCP server setup

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

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/3sa0Yg4S2ckOE1SQC/builds/54R7j5HueCLoSmgRs/openapi.json
