{
  "openapi": "3.0.1",
  "info": {
    "title": "France Building Energy Use by Address: Electricity & Gas",
    "description": "Official SDES open data: annual electricity and gas consumption (MWh) and meter counts of French buildings by address. Find big energy users by sector or NAF code, apartment blocks with collective gas heating, and year-on-year changes. Pay per building.",
    "version": "1.0",
    "x-build-id": "WR7YOgLAJPBmcZqvu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datacraft-studio~france-building-energy-consumption/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datacraft-studio-france-building-energy-consumption",
        "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-building-energy-consumption/runs": {
      "post": {
        "operationId": "runs-sync-datacraft-studio-france-building-energy-consumption",
        "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-building-energy-consumption/run-sync": {
      "post": {
        "operationId": "run-sync-datacraft-studio-france-building-energy-consumption",
        "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 75015.",
            "items": {
              "type": "string"
            }
          },
          "townNames": {
            "title": "Town names",
            "type": "array",
            "description": "Exact town names, e.g. Bordeaux, Lyon, 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. 69, 2A, 974. Leave all area fields empty for the whole of France (slower, a few minutes).",
            "items": {
              "type": "string"
            }
          },
          "energies": {
            "title": "Energies",
            "type": "array",
            "description": "Electricity, gas or both (default both). Rows of the same address and sector are merged.",
            "items": {
              "type": "string",
              "enum": [
                "electricity",
                "gas"
              ],
              "enumTitles": [
                "Electricity",
                "Natural gas"
              ]
            },
            "default": [
              "electricity",
              "gas"
            ]
          },
          "sectors": {
            "title": "Sectors",
            "type": "array",
            "description": "Residential = buildings of 10+ dwellings (or collective gas boilers above 200 MWh). Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "residential",
                "tertiary",
                "industry",
                "agriculture",
                "unassigned"
              ],
              "enumTitles": [
                "Residential (10+ dwellings)",
                "Tertiary (offices, shops, public)",
                "Industry",
                "Agriculture",
                "Unassigned"
              ]
            }
          },
          "naf2Codes": {
            "title": "NAF activity codes (2 digits)",
            "type": "array",
            "description": "Professional sites only, e.g. 47 (retail), 86 (health), 10 (food industry), 55 (hotels).",
            "items": {
              "type": "string"
            }
          },
          "addressContains": {
            "title": "Address contains",
            "type": "string",
            "description": "Keep addresses containing this text, e.g. 'centre commercial' or a street name."
          },
          "minTotalMwh": {
            "title": "Minimum consumption (MWh/year)",
            "minimum": 0,
            "type": "integer",
            "description": "Electricity + gas of the address. 1 MWh = 1,000 kWh."
          },
          "maxTotalMwh": {
            "title": "Maximum consumption (MWh/year)",
            "minimum": 0,
            "type": "integer",
            "description": "Upper bound on electricity + gas."
          },
          "minDeliveryPoints": {
            "title": "Minimum number of meters",
            "minimum": 0,
            "type": "integer",
            "description": "Total electricity + gas meters at the address (for residential: about the number of dwellings)."
          },
          "minMwhPerPoint": {
            "title": "Minimum MWh per meter",
            "minimum": 0,
            "type": "integer",
            "description": "Find energy-intensive sites."
          },
          "onlyWithGas": {
            "title": "Only addresses with gas",
            "type": "boolean",
            "description": "Keep only addresses supplied with natural gas (e.g. boiler replacement or heat-pump leads).",
            "default": false
          },
          "year": {
            "title": "Year",
            "minimum": 2018,
            "maximum": 2100,
            "type": "integer",
            "description": "Consumption year, 2018 to latest (default: latest published, currently 2025). Addresses were re-normalised in 2021."
          },
          "includePreviousYear": {
            "title": "Compare with previous year",
            "type": "boolean",
            "description": "Adds previous-year MWh and change in % (doubles download time).",
            "default": false
          },
          "minChangePct": {
            "title": "Minimum change vs previous year (%)",
            "type": "integer",
            "description": "e.g. 20 for addresses whose consumption rose by 20% or more. Turns on the comparison."
          },
          "maxChangePct": {
            "title": "Maximum change vs previous year (%)",
            "type": "integer",
            "description": "e.g. -20 for addresses whose consumption fell by 20% or more. Turns on the comparison."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "total_desc",
              "per_point_desc",
              "points_desc",
              "change_desc",
              "change_asc",
              "address"
            ],
            "type": "string",
            "description": "Order of the results.",
            "default": "total_desc"
          },
          "maxItems": {
            "title": "Maximum buildings",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of buildings to return (each one is 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}