{
  "openapi": "3.0.1",
  "info": {
    "title": "France Social Housing (HLM) by Address: Energy Labels & Age",
    "description": "Official SDES RPLS open data: every French social housing (HLM) address with 5+ dwellings, or a town summary. Dwellings, rooms, surface, DPE energy and GHG labels, share of F/G 'passoires', build year, priority neighbourhoods, financing, APL conventions. Pay per row.",
    "version": "1.0",
    "x-build-id": "LwXhQhqI815qSUzX6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datacraft-studio~france-social-housing-buildings/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datacraft-studio-france-social-housing-buildings",
        "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/datacraft-studio~france-social-housing-buildings/runs": {
      "post": {
        "operationId": "runs-sync-datacraft-studio-france-social-housing-buildings",
        "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/datacraft-studio~france-social-housing-buildings/run-sync": {
      "post": {
        "operationId": "run-sync-datacraft-studio-france-social-housing-buildings",
        "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": {
          "postalCodes": {
            "title": "Postal codes",
            "type": "array",
            "description": "French postal codes, e.g. 69003 or 75019.",
            "items": {
              "type": "string"
            }
          },
          "townNames": {
            "title": "Town names",
            "type": "array",
            "description": "Exact town names, e.g. Lille, Marseille, Saint-Denis (all towns with that name).",
            "items": {
              "type": "string"
            }
          },
          "inseeCodes": {
            "title": "INSEE commune codes",
            "type": "array",
            "description": "5-character INSEE codes, e.g. 69123 (Lyon, all arrondissements) or 69383 (Lyon 3e).",
            "items": {
              "type": "string"
            }
          },
          "departments": {
            "title": "Departments",
            "type": "array",
            "description": "Department codes, e.g. 59, 2A, 974. Leave all area fields empty for the whole of France (slow: 10-20 minutes, use filters).",
            "items": {
              "type": "string"
            }
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "buildings",
              "towns"
            ],
            "type": "string",
            "description": "One row per address (5+ social dwellings) or one summary row per town.",
            "default": "buildings"
          },
          "minDwellings": {
            "title": "Minimum social dwellings",
            "minimum": 0,
            "type": "integer",
            "description": "Per address (never below 5) or per town in town mode."
          },
          "minPoorDpeSharePct": {
            "title": "Minimum share of F/G energy labels (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Share of dwellings labelled F or G ('passoires thermiques') among those with a DPE."
          },
          "dominantDpeLabels": {
            "title": "Dominant DPE energy label",
            "type": "array",
            "description": "Keep rows whose most frequent energy label is one of these.",
            "items": {
              "type": "string",
              "enum": [
                "A",
                "B",
                "C",
                "D",
                "E",
                "F",
                "G"
              ]
            }
          },
          "constructionTypes": {
            "title": "Main construction type",
            "type": "array",
            "description": "Collective (apartment blocks), individual (houses) or student housing.",
            "items": {
              "type": "string",
              "enum": [
                "collective",
                "individual",
                "student"
              ],
              "enumTitles": [
                "Collective",
                "Individual houses",
                "Student housing"
              ]
            }
          },
          "builtBefore": {
            "title": "Built before (median year)",
            "minimum": 1000,
            "maximum": 2100,
            "type": "integer",
            "description": "e.g. 1975 for buildings before the first thermal regulation."
          },
          "builtAfter": {
            "title": "Built after (median year)",
            "minimum": 1000,
            "maximum": 2100,
            "type": "integer",
            "description": "e.g. 2012 for recent buildings."
          },
          "onlyPriorityNeighbourhoods": {
            "title": "Only priority neighbourhoods (QPV)",
            "type": "boolean",
            "description": "Keep rows with at least one dwelling in a 'quartier prioritaire de la ville'.",
            "default": false
          },
          "conventionExpiringBy": {
            "title": "APL convention expiring by (year)",
            "minimum": 2000,
            "maximum": 2200,
            "type": "integer",
            "description": "Keep rows whose next convention expiry year (from this year on) is on or before this year."
          },
          "addressContains": {
            "title": "Address or programme contains",
            "type": "string",
            "description": "Text to find in the address, the programme name or the town."
          },
          "year": {
            "title": "Stock year",
            "minimum": 2022,
            "maximum": 2100,
            "type": "integer",
            "description": "Stock on 1 January of this year: 2022 to latest (default: latest published, currently 2025)."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "dwellings_desc",
              "poor_dpe_share_desc",
              "oldest_first",
              "newest_first",
              "address"
            ],
            "type": "string",
            "description": "Order of the delivered rows (applied before maxItems).",
            "default": "dwellings_desc"
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum rows delivered (and charged).",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}