{
  "openapi": "3.0.1",
  "info": {
    "title": "DECP Win Intelligence",
    "description": "French public-procurement (DECP) market intelligence: competitor dossiers, market benchmarks and buyer histories over the consolidated data.gouv.fr dataset, served from a normalized cache.",
    "version": "0.1",
    "x-build-id": "47Qp9DUNV3igiYmJS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dr1ms~decp-win-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dr1ms-decp-win-intelligence",
        "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/dr1ms~decp-win-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-dr1ms-decp-win-intelligence",
        "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/dr1ms~decp-win-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-dr1ms-decp-win-intelligence",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "competitor-dossier",
              "market-benchmark",
              "buyer-history",
              "refresh-cache"
            ],
            "type": "string",
            "description": "Which operation to run. / Opération à exécuter. Query modes read a cache that 'refresh-cache' must build first.",
            "default": "competitor-dossier"
          },
          "siren": {
            "title": "Awardee SIREN",
            "pattern": "^[0-9]{9}$",
            "type": "string",
            "description": "competitor-dossier: 9-digit SIREN of the company to profile. / SIREN (9 chiffres) du titulaire. Example: 444608442 (ENEDIS)."
          },
          "cpv": {
            "title": "CPV prefix",
            "pattern": "^[0-9]{2,8}$",
            "type": "string",
            "description": "market-benchmark: 2 to 8 digit CPV code prefix (first 2 = CPV division). / Préfixe CPV (2 à 8 chiffres). Example: 45 (construction works)."
          },
          "departement": {
            "title": "Département",
            "type": "string",
            "description": "market-benchmark: département of execution — 01-95 (except 20), Corsica 2A/2B, overseas 971-978 / 984-989. / Département d'exécution. Example: 35 (Ille-et-Vilaine)."
          },
          "annee_min": {
            "title": "Period start year",
            "minimum": 2000,
            "maximum": 2100,
            "type": "integer",
            "description": "market-benchmark (optional): earliest notification year. Provide both years or neither. / Année de début (les deux ou aucune)."
          },
          "annee_max": {
            "title": "Period end year",
            "minimum": 2000,
            "maximum": 2100,
            "type": "integer",
            "description": "market-benchmark (optional): latest notification year. / Année de fin."
          },
          "siret": {
            "title": "Buyer SIRET",
            "pattern": "^[0-9]{14}$",
            "type": "string",
            "description": "buyer-history: 14-digit SIRET of the public buyer. / SIRET (14 chiffres) de l'acheteur. Example: 21750001600019 (Ville de Paris)."
          },
          "top_n": {
            "title": "Top-N",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Size of the ranked lists (CPV, buyers, awardees, win-rate segments). Default 20, range 1-100. / Taille des classements (défaut 20).",
            "default": 20
          },
          "include_records": {
            "title": "Include raw attribution records",
            "type": "boolean",
            "description": "competitor-dossier / buyer-history only: also deliver the raw line-to-line attribution records (billed per record, capped). Default off. / Livrer aussi le détail ligne à ligne (facturé par enregistrement, plafonné).",
            "default": false
          },
          "records_limit": {
            "title": "Max attribution records",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Hard cap on delivered/charged attribution records when include_records is on. Default 5000, max 20000. / Plafond d'enregistrements livrés.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}