{
  "openapi": "3.0.1",
  "info": {
    "title": "France SIRENE → Company Markdown DD Card",
    "description": "Batch French SIREN/SIRET lookups via Recherche Entreprises (keyless) or your own INSEE API Sirene key. Markdown due-diligence cards: denomination, status, NAF/APE, address, établissements summary, source. RAG chunks. No email/phone. Failed rows free. 256 MB.",
    "version": "0.1",
    "x-build-id": "GfdbAYQ85xnZOcng8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ingenious_quip_bxq~france-sirene-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ingenious_quip_bxq-france-sirene-markdown",
        "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/ingenious_quip_bxq~france-sirene-markdown/runs": {
      "post": {
        "operationId": "runs-sync-ingenious_quip_bxq-france-sirene-markdown",
        "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/ingenious_quip_bxq~france-sirene-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-ingenious_quip_bxq-france-sirene-markdown",
        "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": {
          "sirens": {
            "title": "SIREN / SIRET list",
            "type": "array",
            "description": "One SIREN (9 digits) or SIRET (14 digits) per line, e.g. 380 129 866 or 38012986648625. Punctuation and spaces are stripped. Luhn check digits are validated (invalid rows are free). Duplicates dropped.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset ID (SIREN/SIRET list)",
            "type": "string",
            "description": "Optional. Read ids from another run's dataset (field from 'SIREN field', else siren / siret / taxId / numero)."
          },
          "keyValueStoreId": {
            "title": "Key-value store ID (SIREN/SIRET list)",
            "type": "string",
            "description": "Optional. Read ids from a key-value record: JSON array, {\"sirens\": [...]}, or plain text with one id per line."
          },
          "keyValueRecordKey": {
            "title": "Key-value record key",
            "type": "string",
            "description": "Record key inside the key-value store.",
            "default": "INPUT_SIRENS"
          },
          "sirenField": {
            "title": "SIREN/SIRET field (dataset / JSON objects)",
            "type": "string",
            "description": "Optional. Name of the field holding the SIREN or SIRET in dataset items or JSON objects."
          },
          "provider": {
            "title": "Provider",
            "enum": [
              "auto",
              "recherche",
              "insee"
            ],
            "type": "string",
            "description": "auto = with apiKey try INSEE first then Recherche Entreprises; without key use Recherche only. recherche = keyless official search API only. insee = INSEE API Sirene only (requires apiKey).",
            "default": "auto"
          },
          "apiKey": {
            "title": "INSEE API key (optional BYOK)",
            "type": "string",
            "description": "Optional. Your INSEE API Sirene integration key from https://portail-api.insee.fr (sent as header X-INSEE-Api-Key-Integration). Not needed for the default Recherche Entreprises path. Stored encrypted, never logged or output. Placeholders like YOUR_KEY are ignored. The Actor publisher does not provide or top-up an INSEE key."
          },
          "stopOnAuthError": {
            "title": "Stop using INSEE key after auth error",
            "type": "boolean",
            "description": "After INSEE returns 401/403 once, skip it for the remaining ids (auto mode keeps using Recherche Entreprises). Failed rows are free.",
            "default": true
          },
          "includeEtablissements": {
            "title": "Include établissements summary",
            "type": "boolean",
            "description": "Add a short establishments summary: total/open counts, head-office SIRET, and a small sample. Never dumps thousands of establishments.",
            "default": true
          },
          "includeRagChunks": {
            "title": "Write RAG chunks (CHUNKS.jsonl)",
            "type": "boolean",
            "description": "Write one self-describing chunk per card section to the key-value store record CHUNKS.jsonl.",
            "default": true
          },
          "maxItems": {
            "title": "Max ids",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many unique valid SIREN/SIRET (0 = no limit).",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Parallel lookups. Public endpoints are rate-limited; 2 is a safe default.",
            "default": 2
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "Retries per provider for HTTP 429 (honours Retry-After, capped at 30 s), 5xx, timeouts and network errors. 400/401/403/404 are not retried.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for each provider HTTP call.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}