{
  "openapi": "3.0.1",
  "info": {
    "title": "BOFiP Doctrine Scraper – French Tax Guidance",
    "description": "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.",
    "version": "0.2",
    "x-build-id": "54R7j5HueCLoSmgRs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crispish_guava~bofip-doctrine/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crispish_guava-bofip-doctrine",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/crispish_guava~bofip-doctrine/runs": {
      "post": {
        "operationId": "runs-sync-crispish_guava-bofip-doctrine",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/crispish_guava~bofip-doctrine/run-sync": {
      "post": {
        "operationId": "run-sync-crispish_guava-bofip-doctrine",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "maxItems": {
            "title": "Maximum documents",
            "minimum": 0,
            "type": "integer",
            "description": "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.",
            "default": 20
          },
          "series": {
            "title": "BOI series",
            "type": "array",
            "description": "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.",
            "items": {
              "type": "string"
            }
          },
          "taxes": {
            "title": "Taxes (common names)",
            "type": "array",
            "description": "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.",
            "items": {
              "type": "string"
            }
          },
          "onlyRescrits": {
            "title": "Only rescrits",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "includeActualites": {
            "title": "Include actualités",
            "type": "boolean",
            "description": "Include BOFiP news items (type Actualité, ACTU-YYYY-NNNNN). On by default: they are part of the doctrine in force.",
            "default": true
          },
          "includeSectionPages": {
            "title": "Include RES index pages",
            "type": "boolean",
            "description": "Also save the RES index pages (BOI-RES, BOI-RES-TVA, …) that only list rescrits. Off by default.",
            "default": false
          },
          "identifiant": {
            "title": "Identifiant",
            "type": "string",
            "description": "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": {
            "title": "Division",
            "type": "string",
            "description": "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": {
            "title": "Full-text search",
            "type": "string",
            "description": "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": {
            "title": "Published from (YYYY-MM-DD)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Lower bound on the document's publication / start-of-validity date (debut_de_validite), inclusive."
          },
          "dateTo": {
            "title": "Published until (YYYY-MM-DD)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Upper bound on debut_de_validite, inclusive."
          },
          "sortBy": {
            "title": "Order",
            "enum": [
              "newest",
              "identifiant"
            ],
            "type": "string",
            "description": "newest = most recent publication date first (default); identifiant = alphabetical by legal identifier.",
            "default": "newest"
          },
          "includeHtml": {
            "title": "Include original HTML",
            "type": "boolean",
            "description": "Add the official contenu_html field to each item (much larger output).",
            "default": false
          },
          "redactPersonalData": {
            "title": "Mask personal data",
            "type": "boolean",
            "description": "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.",
            "default": true
          },
          "incremental": {
            "title": "Incremental mode",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Key-value store key holding the incremental state.",
            "default": "bofip-doctrine-state"
          },
          "lookbackDays": {
            "title": "Lookback days",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "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.",
            "default": 0
          },
          "requestDelaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 1,
            "maximum": 60,
            "type": "number",
            "description": "Minimum gap between API requests. Cannot be lower than 1 second.",
            "default": 1.5
          },
          "maxConcurrency": {
            "title": "Max concurrent requests",
            "minimum": 1,
            "maximum": 2,
            "type": "integer",
            "description": "1 or 2. Hard-capped at 2 in code.",
            "default": 1
          },
          "maxRequestRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Retries with exponential backoff on network errors, 408, 429 and 5xx. 403 is never retried.",
            "default": 4
          },
          "healthCheck": {
            "title": "Health check",
            "type": "boolean",
            "description": "Fail the run when no document is saved (useful for monitoring scheduled runs).",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed for the public API; kept for consistency. Leave off.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}