{
  "openapi": "3.0.1",
  "info": {
    "title": "France Building Permits Properties and Details Scraper",
    "description": "France SITADEL permits Actor. Default runs succeed as policy-skipped with zero source requests while the official endpoint cannot be verified in connected Chrome; only validated permit records are written.",
    "version": "1.1",
    "x-build-id": "RBJ2HE4di4LyLYHBV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/realestateapi~france-building-permits-properties-and-details-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-realestateapi-france-building-permits-properties-and-details-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/realestateapi~france-building-permits-properties-and-details-scraper/runs": {
      "post": {
        "operationId": "runs-sync-realestateapi-france-building-permits-properties-and-details-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/realestateapi~france-building-permits-properties-and-details-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-realestateapi-france-building-permits-properties-and-details-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": {
          "permitTypes": {
            "title": "Permit datasets",
            "type": "array",
            "description": "One or more datasets: logements, locaux, amenager, or demolir.",
            "items": {
              "type": "string",
              "enum": [
                "logements",
                "locaux",
                "amenager",
                "demolir"
              ]
            },
            "default": [
              "logements"
            ]
          },
          "millesime": {
            "title": "Data vintage",
            "type": "string",
            "description": "SITADEL/DiDo vintage such as 2026-07. Leave blank to use the latest vintage for each dataset. Used only when millesimes is empty.",
            "default": ""
          },
          "millesimes": {
            "title": "Selected data periods (vintages)",
            "maxItems": 4,
            "type": "array",
            "description": "Up to four DiDo vintages (YYYY-MM) to cover with bounded pagination. When set, each period is queried per selected dataset and stable permit IDs are deduplicated across periods. Empty means use millesime / latest vintage.",
            "items": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}$"
            },
            "default": []
          },
          "regionCode": {
            "title": "Region code",
            "type": "string",
            "description": "Optional official region code, for example 84 for Auvergne-Rhône-Alpes.",
            "default": ""
          },
          "departmentCode": {
            "title": "Department code",
            "type": "string",
            "description": "Optional department code, for example 01 for Ain.",
            "default": ""
          },
          "communeCode": {
            "title": "Commune code",
            "type": "string",
            "description": "Optional INSEE commune code, for example 01099.",
            "default": ""
          },
          "permitNumber": {
            "title": "Permit number",
            "type": "string",
            "description": "Optional exact NUM_DAU, NUM_PA, or NUM_PD value, depending on the selected dataset.",
            "default": ""
          },
          "dateFrom": {
            "title": "Authorization from",
            "type": "string",
            "description": "Optional lower bound for DATE_REELLE_AUTORISATION in YYYY-MM-DD format.",
            "default": ""
          },
          "dateTo": {
            "title": "Authorization through",
            "type": "string",
            "description": "Optional upper bound for DATE_REELLE_AUTORISATION in YYYY-MM-DD format.",
            "default": ""
          },
          "statusCode": {
            "title": "Project status code",
            "minimum": 1,
            "maximum": 99,
            "type": "integer",
            "description": "Optional SITADEL ETAT_* code filter."
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum normalized permit records across all selected datasets.",
            "default": 10
          },
          "pageSize": {
            "title": "API page size",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "DiDo API page size. The API accepts 10, 20, 50, or 100.",
            "default": 10
          },
          "maxPages": {
            "title": "Maximum API pages per dataset",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Safety bound for paginated DiDo row requests per selected dataset.",
            "default": 10
          },
          "maxRequests": {
            "title": "Maximum total requests",
            "minimum": 1,
            "maximum": 80,
            "type": "integer",
            "description": "Hard cap on all DiDo requests across datasets, periods, and pages.",
            "default": 40
          },
          "testMode": {
            "title": "Conservative smoke mode",
            "type": "boolean",
            "description": "When true, caps this run to one period, one page, two requests, and three records without changing saved input.",
            "default": false
          },
          "includeRaw": {
            "title": "Include raw SITADEL row",
            "type": "boolean",
            "description": "Include the full non-null source row under rawSourceRow.",
            "default": false
          },
          "timeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 60,
            "type": "integer",
            "description": "Timeout for each DiDo metadata or row request.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}