{
  "openapi": "3.0.1",
  "info": {
    "title": "ADEME Emission Factors – French Carbon Calculator",
    "description": "Search ADEME Base Carbone emission factors (France), look them up by id, or compute kgCO2e for a list of activities. Unofficial, open data, AI-agent friendly.",
    "version": "0.1",
    "x-build-id": "6BCYOnWoTZ9hRshUI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/shadow-tools~ademe-emission-factors/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-shadow-tools-ademe-emission-factors",
        "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/shadow-tools~ademe-emission-factors/runs": {
      "post": {
        "operationId": "runs-sync-shadow-tools-ademe-emission-factors",
        "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/shadow-tools~ademe-emission-factors/run-sync": {
      "post": {
        "operationId": "run-sync-shadow-tools-ademe-emission-factors",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "lookup",
              "calculate"
            ],
            "type": "string",
            "description": "Pick one. \"search\" = use when you do not know the factor id and want to find emission factors by words/category/unit (needs query or other filters; returns factor records). \"lookup\" = use when you already have ADEME ids (factorIds, e.g. [\"28153\"]) and want those exact factors. \"calculate\" = use when you have activities with quantities (lines) and want kgCO2e per line plus a total. Allowed values: search, lookup, calculate. Default: search.",
            "default": "search"
          },
          "query": {
            "title": "Search words (search mode)",
            "type": "string",
            "description": "Search mode: words that must all appear in the factor (name, attribute, tags, category), French or English, e.g. \"gaz naturel\", \"natural gas\", \"TGV\", \"electricity\". Format: plain text, accents and case ignored, typos not corrected. Empty = no text filter (returns the first factors)."
          },
          "category": {
            "title": "Category words (search mode)",
            "type": "string",
            "description": "Search mode: words that must appear in the ADEME category path, e.g. \"Transport de personnes ferroviaire\" or \"Combustibles\". Format: plain text. Empty = any category."
          },
          "unit": {
            "title": "Exact unit (search mode)",
            "type": "string",
            "description": "Search mode: keep only factors whose unit is exactly this French ADEME unit string, e.g. \"kgCO2e/kWh\", \"kgCO2e/litre\", \"kgCO2e/passager.km\", \"kgCO2e/kg de poids net\", \"kgCO2e/t.km\". Empty = any kgCO2e unit."
          },
          "location": {
            "title": "Geographic area (search mode)",
            "enum": [
              "",
              "France continentale",
              "Outre-mer",
              "Europe",
              "Monde",
              "Autre pays du monde"
            ],
            "type": "string",
            "description": "Search mode: keep only factors for this ADEME geographic area. Allowed values: France continentale, Outre-mer, Europe, Monde, Autre pays du monde (exact spelling, example: \"France continentale\"). Empty = all areas."
          },
          "validityYear": {
            "title": "Validity year (search mode)",
            "minimum": 1990,
            "maximum": 2100,
            "type": "integer",
            "description": "Search mode: keep factors whose validity period mentions this 4-digit year (1990-2100), e.g. 2024. The period is free text in the source, so this is a text match."
          },
          "modifiedSince": {
            "title": "Modified since (search mode)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Search mode: keep factors last modified on or after this date. Format YYYY-MM-DD, example: 2024-01-01. An invalid date makes the run fail with a clear error."
          },
          "includeArchived": {
            "title": "Include archived factors",
            "type": "boolean",
            "description": "Search mode: by default only valid factors (generic or specific) are returned; set true to also get archived ones (old versions). Lookup mode always returns the status of each id. Example: true.",
            "default": false
          },
          "includeGases": {
            "title": "Include gas breakdown",
            "type": "boolean",
            "description": "Search/lookup modes: set true to add the per-gas values (CO2 fossil, CH4, N2O, biogenic CO2...) when ADEME publishes them. Default false (shorter records).",
            "default": false
          },
          "factorIds": {
            "title": "Factor ids (lookup mode)",
            "type": "array",
            "description": "Lookup mode (required there): list of 1 or more ADEME element identifiers as strings of digits, e.g. [\"34722\", \"28153\"] (34722 = electricity, mainland France). Ids come from the search output field factorId.",
            "items": {
              "type": "string"
            }
          },
          "lines": {
            "title": "Lines to compute (calculate mode)",
            "type": "array",
            "description": "Calculate mode (required there): list of 1 to 500 objects (see the example in the prefilled value) {\"item\": \"gaz naturel\" OR \"factorId\": \"13515\", \"quantity\": 1000 (number >= 0), \"unit\": \"kWh\", \"location\": optional area, \"label\": optional text}. Each line needs item or factorId, and quantity and unit are mandatory. With \"item\" the best match having a compatible unit is used and a warning asks you to check it; with \"factorId\" the factor is exact. Units are converted only inside kg/t, Wh/kWh/MWh/GJ, m/km, mL/L/m3, kg.km/t.km; any other mismatch gives no value and a warning (never a guess). Example: [{\"item\": \"gazole\", \"quantity\": 300, \"unit\": \"litre\"}]."
          },
          "maxResults": {
            "title": "Maximum results (search mode)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Search mode: maximum number of factors returned, integer 1-1000, default 20 (keep it small, e.g. 20; raise only if the run SUMMARY says capped). Your run cost cap may lower it.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}