{
  "openapi": "3.0.1",
  "info": {
    "title": "DECP Scraper: French Public Contracts Awarded (Marches Publics)",
    "description": "Scrape 650K+ awarded French public contracts (DECP) — buyer SIRET, winner SIRET, amount, CPV, procedure. Filter by date, CPV, montant, departement. For B2G prospection, market intel, lead gen. $5/1K records.",
    "version": "0.0",
    "x-build-id": "8ZFiwz0eorkkaJkfC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dltik~decp-fr-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dltik-decp-fr-scraper",
        "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/dltik~decp-fr-scraper/runs": {
      "post": {
        "operationId": "runs-sync-dltik-decp-fr-scraper",
        "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/dltik~decp-fr-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-dltik-decp-fr-scraper",
        "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": {
          "query": {
            "title": "Keywords",
            "type": "string",
            "description": "Free-text search in the contract object (objet). Examples: 'voirie', 'restauration scolaire', 'logiciel'. Leave empty to get every contract matching the other filters."
          },
          "cpv": {
            "title": "CPV codes (prefix match)",
            "type": "array",
            "description": "Common Procurement Vocabulary codes. Prefix-matched against codecpv. Examples: '72' (IT), '45' (construction), '85' (health), '50410000' (metrology). Multiple = OR.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "acheteurSiret": {
            "title": "Buyer SIRET",
            "type": "string",
            "description": "Exact 14-digit SIRET of the public buyer (mairie, departement, region, CHU, ministry...). Example: '21750001600019' (Mairie de Paris)."
          },
          "titulaireSiret": {
            "title": "Winner SIRET",
            "type": "string",
            "description": "Exact 14-digit SIRET of the awarded company (titulaire). Use to track every public contract a given company has won."
          },
          "notifiedSince": {
            "title": "Notified since",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD). Only contracts notified on or after this date. Tip: 'today-30' for the last 30 days. DECP has a typical 2-6 month publication lag — use 6-12 month windows for active prospection."
          },
          "notifiedUntil": {
            "title": "Notified until",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD). Only contracts notified on or before this date. Combine with 'Notified since' for a window."
          },
          "montantMin": {
            "title": "Min amount (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum contract value in euros (montant). Useful to skip micro-contracts. Example: 100000 = ignore contracts under 100k."
          },
          "montantMax": {
            "title": "Max amount (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum contract value in euros. Useful for sub-threshold (MAPA) targeting where smaller B2G specialists win."
          },
          "lieuExecutionCode": {
            "title": "Location code (commune / postcode / departement)",
            "type": "string",
            "description": "INSEE code, postcode, or departement code. The DECP feed mixes types — use the raw code as published. Examples: '75056' (Paris commune), '75001' (Paris postcode), '75' (Paris departement)."
          },
          "departement": {
            "title": "Departement (2-digit prefix)",
            "type": "string",
            "description": "Two-digit French department code, prefix-matched against lieuexecution_code. Examples: '75' (Paris), '13' (Bouches-du-Rhone), '2A' (Corse-du-Sud). Most municipalities publish a 5-digit postcode that starts with the departement."
          },
          "procedure": {
            "title": "Procedure label",
            "type": "string",
            "description": "Partial match on the procedure type. Examples: 'adaptee' (Procedure adaptee / MAPA), 'ouvert' (Appel d'offres ouvert), 'restreint' (Appel d'offres restreint), 'negocie'."
          },
          "marcheInnovant": {
            "title": "Innovative contracts only",
            "type": "boolean",
            "description": "Filter on marcheinnovant=oui. Use to find R&D-flavoured contracts (innovation procurement).",
            "default": false
          },
          "considerationsEnv": {
            "title": "Environmental considerations only",
            "type": "boolean",
            "description": "Keep only contracts with explicit environmental considerations (green public procurement / RSE).",
            "default": false
          },
          "includeConcessions": {
            "title": "Include concessions",
            "type": "boolean",
            "description": "Also pull contracts from the decp-2022-concessions-valides dataset (~600 records, long-term public service delegations). Off by default — the main marches dataset already covers 650K+ rows.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum contracts to return (newest first). Hard cap of 10000 per run (Opendatasoft window limit) — narrow with filters for large searches. Aliases accepted: 'limit', 'max'. Each result is charged at the per-event price — start small to validate.",
            "default": 50
          },
          "analyzeContracts": {
            "title": "AI analysis (premium)",
            "type": "boolean",
            "description": "Enrich each awarded contract with an AI 'ai' object: a plain-language summary (what was bought, from whom), the concrete deliverables, and a recommended action (prospect / watch / skip). Add 'Business profile' below to also get a 0-100 relevance score per contract - turns the DECP archive into a ranked prospecting/market-intelligence list. Requires a paid Apify plan; billed as a separate 'record-analyzed' event. If not on a paid plan the scrape still runs without analysis.",
            "default": false
          },
          "businessProfile": {
            "title": "Business profile (for AI relevance scoring)",
            "type": "string",
            "description": "One or two sentences describing what your company sells or does, e.g. 'Entreprise de nettoyage industriel et proprete, region PACA' or 'ESN specialisee data et IA, 60 personnes'. When set (and AI analysis is on), each contract gets a relevance_score (0-100) and a one-line reason for how relevant it is to prospect or watch. Leave empty to get summaries only."
          },
          "proxyConfig": {
            "title": "Proxy (rarely needed)",
            "type": "object",
            "description": "Optional Apify proxy. The data.economie.gouv.fr endpoint has no anti-bot — proxy is rarely useful unless your egress IP is rate-limited.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}