{
  "openapi": "3.0.1",
  "info": {
    "title": "Carbon Footprint API - CO2 Calculator, Official Factors",
    "description": "No API key. CO2e emissions calculator on the official UK government (DESNZ) conversion factors 2023-2026: flights by IATA code (haul, cabin class, radiative forcing, +8% routing uplift), cars by size/segment and fuel incl. EV and hybrid, fuels by litre/kWh/tonne/gallon, UK electricity with grid loss",
    "version": "0.1",
    "x-build-id": "l3LsARgJEnqtXuERg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/martin10291~carbon-footprint-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-martin10291-carbon-footprint-api",
        "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/martin10291~carbon-footprint-api/runs": {
      "post": {
        "operationId": "runs-sync-martin10291-carbon-footprint-api",
        "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/martin10291~carbon-footprint-api/run-sync": {
      "post": {
        "operationId": "run-sync-martin10291-carbon-footprint-api",
        "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": [
              "calculate",
              "search",
              "categories"
            ],
            "type": "string",
            "description": "calculate = CO2e of your activities (one result row per activity); search = find official DESNZ factors by words (e.g. 'diesel litres', 'container ship', 'hotel japan') and get their factorId; categories = all factor categories with Scope, count and units.",
            "default": "calculate"
          },
          "activities": {
            "title": "Activities",
            "type": "array",
            "description": "List of activities (max 100). Each object has a 'type': flight {from, to (IATA codes) or distanceKm, cabin: economy|premium_economy|business|first|average, passengers, roundTrip, radiativeForcing (default true)}; car {distance, unit: km|miles, size: small|medium|large|average or segment: mini|supermini|lower_medium|upper_medium|executive|luxury|sports|suv|mpv, fuel: petrol|diesel|hybrid|phev|bev|cng|lpg|unknown, owned: true for company cars}; fuel {fuel: diesel|petrol|natural gas|lpg|propane|heating oil|coal|jet fuel|wood pellets..., amount, unit: litres|kWh|kwh_net|tonnes|kg|m3|gallons}; electricity {kwh} (UK grid); hotel {country: ISO code or name, nights, rooms}; rail/bus/coach/tram/underground {distance, passengers}; taxi {distance}; motorbike {distance, size}; ferry {distance, passengerType: foot|car}; freight {mode: hgv|hgv_refrigerated|van|rail|container_ship|bulk_carrier|general_cargo|tanker|air, weightTonnes or weightKg, distance or from/to IATA for air}; factor {factorId, amount} for any official factor from search. Optional per activity: includeWellToTank (adds upstream fuel Scope 3), year."
          },
          "query": {
            "title": "Search words",
            "type": "string",
            "description": "For mode=search: words that must all appear in the factor path, e.g. 'diesel litres', 'hotel japan', 'refrigerant R410A', 'waste landfill'."
          },
          "scope": {
            "title": "Scope filter",
            "enum": [
              "",
              "1",
              "2",
              "3"
            ],
            "type": "string",
            "description": "For mode=search: only factors of this GHG Protocol scope. Empty = all scopes."
          },
          "year": {
            "title": "Factor year",
            "enum": [
              "latest",
              "2026",
              "2025",
              "2024",
              "2023"
            ],
            "type": "string",
            "description": "Which official DESNZ factor set to use. latest = the newest published set (2026). Use an older year to match last year's report.",
            "default": "latest"
          },
          "includeTotal": {
            "title": "Add total row",
            "type": "boolean",
            "description": "For mode=calculate with 2+ activities: add one extra row with the total kgCO2e and the Scope 1/2/3 split of all activities.",
            "default": false
          },
          "limit": {
            "title": "Max search results",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "For mode=search: maximum number of factors returned.",
            "default": 50
          },
          "onlyNew": {
            "title": "Only new or changed results",
            "type": "boolean",
            "description": "Monitor mode: return only activities/factors whose result is new or changed since the last run with the same Monitor ID (for example when DESNZ publishes a new factor set each June).",
            "default": false
          },
          "monitorId": {
            "title": "Monitor ID",
            "type": "string",
            "description": "Name of the saved state used by 'Only new or changed results'. Use one ID per scheduled report."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}